Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] support multiple CUDA versions #1234

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .github/workflows/fbgemmci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,17 @@ jobs:
set -e
./bazel test --compilation_mode opt :*

build_gpu:
build_nvidia_gpu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
cuda_version: [11.3, 11.5, 11.6] # 11.7

steps:
- uses: actions/checkout@v2

- name: Install CUDA 11.3
- name: Install CUDA
shell: bash
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
Expand All @@ -212,7 +213,9 @@ jobs:
# sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda-minimal-build-11-3 cuda-nvrtc-dev-11-3 cuda-nvtx-11-3 cuda-libraries-dev-11-3
# "11.5 -> 11-5"
cuda_apt_version=$(echo "${{ matrix.cuda_version }}" | sed "s/\./-/")
sudo apt-get -y install cuda-minimal-build-${cuda_apt_version} cuda-nvrtc-dev-${cuda_apt_version} cuda-nvtx-${cuda_apt_version} cuda-libraries-dev-${cuda_apt_version}
sudo apt-get -y install libcudnn8-dev

- name: Install dependencies
Expand All @@ -221,8 +224,10 @@ jobs:
sudo apt-get update
sudo apt-get -y install git pip python3-dev
sudo pip install cmake scikit-build ninja jinja2 numpy hypothesis --no-input
# Install pytorch 1.11 as required by fbgemm_gpu
sudo pip install --pre torch -f https://download.pytorch.org/whl/nightly/cu113/torch_nightly.html
# "11.5" -> "115"
cuda_torch_version=$(echo "${{ matrix.cuda_version }}" | sed "s/\.//")
# Install PyTorch (nightly) as required by fbgemm_gpu
sudo pip install --pre torch -f https://download.pytorch.org/whl/nightly/cu${cuda_torch_version}/torch_nightly.html

- name: Checkout submodules
shell: bash
Expand All @@ -235,7 +240,8 @@ jobs:
shell: bash
run: |
cd fbgemm_gpu
sudo CUDACXX=/usr/local/cuda-11.3/bin/nvcc python setup.py install -DTORCH_CUDA_ARCH_LIST="6.0"
CUDA_PATH="/usr/local/cuda-${{ matrix.cuda_version }}"
sudo CUDACXX="${CUDA_PATH}/bin/nvcc" python setup.py install -DTORCH_CUDA_ARCH_LIST="6.0"

- name: Test fbgemm_gpu installation
shell: bash
Expand All @@ -253,14 +259,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rocm_version: [5.1.1]

steps:
- name: Free space
run: sudo rm -rf /usr/local/android /usr/share/dotnet /usr/local/share/boost /opt/ghc /usr/local/share/chrom* /usr/share/swift /usr/local/julia* /usr/local/lib/android

- uses: actions/checkout@v2

- name: Install ROCm 5.1.1
- name: Install ROCm
shell: bash
run: |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
Expand All @@ -278,7 +285,7 @@ jobs:
sudo apt-get install -y hipify-clang || true
sudo pip install cmake scikit-build ninja jinja2 numpy hypothesis --no-input
sudo apt-get clean
# Install pytorch 1.11 as required by fbgemm_gpu
# Install PyTorch (nightly) as required by fbgemm_gpu
sudo pip install --pre torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/rocm5.1.1/

- name: Checkout submodules
Expand Down Expand Up @@ -370,7 +377,7 @@ jobs:
sudo apt-get update
sudo apt-get -y install git pip python3-dev
sudo pip install cmake scikit-build ninja jinja2 numpy hypothesis --no-input
# Install pytorch 1.11 as required by fbgemm_gpu
# Install PyTorch (nightly) as required by fbgemm_gpu
sudo pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html

- name: Checkout submodules
Expand Down
2 changes: 1 addition & 1 deletion fbgemm_gpu/include/fbgemm_gpu/cub_namespace_postfix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// PR https://github.com/NVIDIA/cub/pull/350 introduced breaking change.
// When the CUB_NS_[PRE|POST]FIX macros are set,
// CUB_NS_QUALIFIER must also be defined to the fully qualified CUB namespace
#if CUB_VERSION >= 101400
#if CUB_VERSION >= 101301
#undef CUB_NS_QUALIFIER
#endif

Expand Down
4 changes: 2 additions & 2 deletions fbgemm_gpu/include/fbgemm_gpu/cub_namespace_prefix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// PR https://github.com/NVIDIA/cub/pull/350 introduced breaking change.
// When the CUB_NS_[PRE|POST]FIX macros are set,
// CUB_NS_QUALIFIER must also be defined to the fully qualified CUB namespace
#if CUB_VERSION >= 101400
#if CUB_VERSION >= 101301
#undef CUB_NS_QUALIFIER
#endif

Expand All @@ -30,7 +30,7 @@
// PR https://github.com/NVIDIA/cub/pull/350 introduced breaking change.
// When the CUB_NS_[PRE|POST]FIX macros are set,
// CUB_NS_QUALIFIER must also be defined to the fully qualified CUB namespace
#if CUB_VERSION >= 101400
#if CUB_VERSION >= 101301
#define CUB_NS_QUALIFIER ::fbgemm_gpu::cub
#endif

Expand Down