Skip to content

CI

CI #1

name: CI
on:
workflow_dispatch:
env:
TINY_CUDA_NN_VERSION: "1.7"
jobs:
build-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TINY_CUDA_NN_VERSION }}
release_name: ${{ env.TINY_CUDA_NN_VERSION }}
draft: false
prerelease: false
build_linux:
needs: build-tag
name: Build on linux systems
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.cuda }}
strategy:
matrix:
include:
- os: ubuntu-22.04
cuda: nvidia/cuda:12.1.0-devel-ubuntu22.04
arch: 75 # for T4 on google colab
- os: ubuntu-22.04
cuda: nvidia/cuda:12.1.0-devel-ubuntu22.04
arch: 70 # for v100 on google colab
- os: ubuntu-22.04
cuda: nvidia/cuda:12.1.0-devel-ubuntu22.04
arch: 89 # for a100 on google colab
env:
build_dir: "build"
config: "Release"
TCNN_CUDA_ARCHITECTURES: ${{ matrix.arch }}
steps:
- name: Install Git and Python
run: |
apt-get update
apt-get install -y git python3 python3-pip
- name: Install GitHub CLI
run: |
apt-get update
apt-get install -y gh
- uses: actions/checkout@v3
with:
repository: 'NVlabs/tiny-cuda-nn'
submodules: 'recursive'
token: ${{ secrets.GITHUB_TOKEN }}
- name: List directory structure
run: |
ls -R
- name: Install Wheel
run:
pip install setuptools wheel
- name: Install Pytorch
run: |
pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu121
- name: Generate Wheels
run: |
cd bindings/torch
python3 setup.py bdist_wheel --plat-name linux_x86_64
env:
INCLUDE_ARCH: ${{ matrix.arch }}
- name: Upload assets
run: |
cd bindings/torch/dist
for filename in *; do
# Rename the file by inserting .post${{ matrix.arch }} directly after "1.7"
new_filename=$(echo "$filename" | sed "s/1.7/1.7.post${{ matrix.arch }}/")
mv "$filename" "$new_filename"
echo "Uploading $new_filename"
gh release upload ${{ env.TINY_CUDA_NN_VERSION }} "$new_filename" --clobber --repo ${{ github.repository }}
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}