Unverified Commit 344e8516 authored by Won-Kyu Park's avatar Won-Kyu Park Committed by GitHub
Browse files

CI: Fix cuda toolkit speed issue. (#1055)



* CI: fix cuda-toolkit speed issue

* CI: use MSVC instead msbuild to remove 'visual_stuido_integration' dependency

 * use Ninja to compile without MS toolset

* use 'network', install 'ninja' only
Co-authored-by: default avatarRickard <rickardp@users.noreply.github.com>

---------
Co-authored-by: default avatarRickard <rickardp@users.noreply.github.com>
parent 136721a8
...@@ -41,9 +41,10 @@ jobs: ...@@ -41,9 +41,10 @@ jobs:
uses: jwlawson/actions-setup-cmake@v1.14 uses: jwlawson/actions-setup-cmake@v1.14
with: with:
cmake-version: '3.26.x' cmake-version: '3.26.x'
- name: Add msbuild to PATH - name: Setup MSVC
uses: microsoft/setup-msbuild@v1.1 if: startsWith(matrix.os, 'windows')
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 # Compile C++ code
- name: Build C++ - name: Build C++
shell: bash shell: bash
...@@ -60,11 +61,7 @@ jobs: ...@@ -60,11 +61,7 @@ jobs:
else else
cmake -DCOMPUTE_BACKEND=cpu . cmake -DCOMPUTE_BACKEND=cpu .
fi fi
if [ ${build_os:0:7} == windows ]; then cmake --build . --config Release
pwsh -Command "msbuild bitsandbytes.vcxproj /property:Configuration=Release"
else
make
fi
mkdir -p output/${{ matrix.os }}/${{ matrix.arch }} mkdir -p output/${{ matrix.os }}/${{ matrix.arch }}
( shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} output/${{ matrix.os }}/${{ matrix.arch }}/ ) ( shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} output/${{ matrix.os }}/${{ matrix.arch }}/ )
- name: Upload build artifact - name: Upload build artifact
...@@ -105,11 +102,14 @@ jobs: ...@@ -105,11 +102,14 @@ jobs:
id: cuda-toolkit id: cuda-toolkit
with: with:
cuda: ${{ matrix.cuda_version }} cuda: ${{ matrix.cuda_version }}
method: 'local' method: 'network'
# 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"]'
- name: Add msbuild to PATH linux-local-args: '["--toolkit"]'
uses: microsoft/setup-msbuild@v1.1 use-github-cache: false
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 # Compile C++ code
- name: Build C++ - name: Build C++
shell: bash shell: bash
...@@ -117,6 +117,7 @@ jobs: ...@@ -117,6 +117,7 @@ jobs:
set -ex set -ex
build_os=${{ matrix.os }} build_os=${{ matrix.os }}
build_arch=${{ matrix.arch }} build_arch=${{ matrix.arch }}
[[ "${{ matrix.os }}" = windows-* ]] && python3 -m pip install ninja
for NO_CUBLASLT in ON OFF; do for NO_CUBLASLT in ON OFF; do
if [ ${build_os:0:6} == ubuntu ]; then if [ ${build_os:0:6} == ubuntu ]; then
image=nvidia/cuda:${{ matrix.cuda_version }}-devel-ubuntu22.04 image=nvidia/cuda:${{ matrix.cuda_version }}-devel-ubuntu22.04
...@@ -125,10 +126,10 @@ jobs: ...@@ -125,10 +126,10 @@ jobs:
"apt-get update \ "apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cmake \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cmake \
&& cmake -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} . \ && cmake -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} . \
&& make" && cmake --build ."
else else
cmake -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} . cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} -DCMAKE_BUILD_TYPE=Release -S .
pwsh -Command "msbuild bitsandbytes.vcxproj /property:Configuration=Release" cmake --build . --config Release
fi fi
done done
mkdir -p output/${{ matrix.os }}/${{ matrix.arch }} mkdir -p output/${{ matrix.os }}/${{ matrix.arch }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment