-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: Rickard <[email protected]> --------- Co-authored-by: Rickard <[email protected]>
- Loading branch information
Showing
1 changed file
with
17 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,9 +41,10 @@ jobs: | |
uses: jwlawson/[email protected] | ||
with: | ||
cmake-version: '3.26.x' | ||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ startsWith(matrix.os, 'windows') }} | ||
- name: Setup MSVC | ||
if: startsWith(matrix.os, 'windows') | ||
#uses: microsoft/[email protected] # to use msbuild | ||
uses: ilammy/[email protected] # 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 | ||
|
@@ -105,18 +102,22 @@ jobs: | |
id: cuda-toolkit | ||
with: | ||
cuda: ${{ matrix.cuda_version }} | ||
method: 'local' | ||
# sub-packages: '["nvcc","cudart","nvrtc_dev","cublas_dev","cusparse_dev","visual_studio_integration"]' | ||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ startsWith(matrix.os, 'windows') }} | ||
method: 'network' | ||
sub-packages: '["nvcc","cudart","cusparse","cublas","thrust","nvrtc_dev","cublas_dev","cusparse_dev"]' | ||
linux-local-args: '["--toolkit"]' | ||
use-github-cache: false | ||
- name: Setup MSVC | ||
if: startsWith(matrix.os, 'windows') | ||
#uses: microsoft/[email protected] # to use msbuild | ||
uses: ilammy/[email protected] # to use cl | ||
# Compile C++ code | ||
- name: Build C++ | ||
shell: bash | ||
run: | | ||
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 | ||
|
@@ -125,10 +126,10 @@ 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" | ||
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 }} | ||
|