From 3465f69884b7c9d20eeb8f7732454f26f88e3dd2 Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Thu, 8 Feb 2024 15:57:26 +0900 Subject: [PATCH 1/3] CI: fix cuda-toolkit speed issue --- .github/workflows/python-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 81c5ae360..a7b825b34 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -106,7 +106,9 @@ jobs: with: cuda: ${{ matrix.cuda_version }} method: 'local' - # sub-packages: '["nvcc","cudart","nvrtc_dev","cublas_dev","cusparse_dev","visual_studio_integration"]' + sub-packages: '["nvcc","cudart","cusparse","cublas","thrust","nvrtc_dev","cublas_dev","cusparse_dev"]' + linux-local-args: '["--toolkit"]' + use-github-cache: false - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 if: ${{ startsWith(matrix.os, 'windows') }} From f64366902f17292eb15cc9832bce70694bac95fc Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Thu, 8 Feb 2024 16:14:04 +0900 Subject: [PATCH 2/3] CI: use MSVC instead msbuild to remove 'visual_stuido_integration' dependency * use Ninja to compile without MS toolset --- .github/workflows/python-package.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a7b825b34..bf02d9320 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -41,9 +41,10 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.14 with: cmake-version: '3.26.x' - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 - if: ${{ startsWith(matrix.os, 'windows') }} + - name: Setup MSVC + if: startsWith(matrix.os, 'windows') + #uses: microsoft/setup-msbuild@v1.1 # to use msbuild + uses: ilammy/msvc-dev-cmd@v1.13.0 # to use cl # Compile C++ code - name: Build C++ shell: bash @@ -60,11 +61,7 @@ jobs: else cmake -DCOMPUTE_BACKEND=cpu . fi - if [ ${build_os:0:7} == windows ]; then - pwsh -Command "msbuild bitsandbytes.vcxproj /property:Configuration=Release" - else - make - fi + cmake --build . --config Release mkdir -p output/${{ matrix.os }}/${{ matrix.arch }} ( shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} output/${{ matrix.os }}/${{ matrix.arch }}/ ) - name: Upload build artifact @@ -109,9 +106,10 @@ jobs: sub-packages: '["nvcc","cudart","cusparse","cublas","thrust","nvrtc_dev","cublas_dev","cusparse_dev"]' linux-local-args: '["--toolkit"]' use-github-cache: false - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 - if: ${{ startsWith(matrix.os, 'windows') }} + - name: Setup MSVC + if: startsWith(matrix.os, 'windows') + #uses: microsoft/setup-msbuild@v1.1 # to use msbuild + uses: ilammy/msvc-dev-cmd@v1.13.0 # to use cl # Compile C++ code - name: Build C++ shell: bash @@ -127,10 +125,11 @@ jobs: "apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cmake \ && cmake -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} . \ - && make" + && cmake --build ." else - cmake -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} . - pwsh -Command "msbuild bitsandbytes.vcxproj /property:Configuration=Release" + python3 -m pip install cmake==3.27.9 ninja + cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} -DCMAKE_BUILD_TYPE=Release -S . + cmake --build . --config Release fi done mkdir -p output/${{ matrix.os }}/${{ matrix.arch }} From e2752963bdd72ba6357207165d6cb88c093f387b Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Fri, 9 Feb 2024 06:58:11 +0900 Subject: [PATCH 3/3] use 'network', install 'ninja' only Co-authored-by: Rickard --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index bf02d9320..07c3b5217 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -102,7 +102,7 @@ jobs: id: cuda-toolkit with: cuda: ${{ matrix.cuda_version }} - method: 'local' + method: 'network' sub-packages: '["nvcc","cudart","cusparse","cublas","thrust","nvrtc_dev","cublas_dev","cusparse_dev"]' linux-local-args: '["--toolkit"]' use-github-cache: false @@ -117,6 +117,7 @@ jobs: set -ex build_os=${{ matrix.os }} build_arch=${{ matrix.arch }} + [[ "${{ matrix.os }}" = windows-* ]] && python3 -m pip install ninja for NO_CUBLASLT in ON OFF; do if [ ${build_os:0:6} == ubuntu ]; then image=nvidia/cuda:${{ matrix.cuda_version }}-devel-ubuntu22.04 @@ -127,7 +128,6 @@ jobs: && cmake -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} . \ && cmake --build ." else - python3 -m pip install cmake==3.27.9 ninja cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} -DCMAKE_BUILD_TYPE=Release -S . cmake --build . --config Release fi