6
6
pull_request :
7
7
branches : [ "main" ]
8
8
9
+ concurrency :
10
+ group : cmake-${{ github.ref }}
11
+ cancel-in-progress : true
12
+
9
13
jobs :
10
14
build :
11
15
runs-on : ${{ matrix.os }}
@@ -16,29 +20,11 @@ jobs:
16
20
17
21
matrix :
18
22
os : [ubuntu-latest, windows-latest]
19
- python-version : ['3.10', '3.11']
20
23
cuda-version : ['11.8', '12.1']
21
24
build_type : [Release]
22
- c_compiler : [gcc, cl]
23
- include :
24
- - os : windows-latest
25
- c_compiler : cl
26
- cpp_compiler : cl
27
- - os : ubuntu-latest
28
- c_compiler : gcc
29
- cpp_compiler : g++
30
- exclude :
31
- - os : ubuntu-latest
32
- c_compiler : cl
33
- - os : windows-latest
34
- c_compiler : gcc
35
25
36
26
steps :
37
27
- uses : actions/checkout@v4
38
- - name : Set up Python ${{ matrix.python-version }}
39
- uses : actions/setup-python@v5
40
- with :
41
- python-version : ${{ matrix.python-version }}
42
28
43
29
- name : Set up MSVC
44
30
if : matrix.os == 'windows-latest'
61
47
environment-file : environment-bnb.yml
62
48
use-only-tar-bz2 : false
63
49
auto-activate-base : true
64
- python-version : ${{ matrix.python-version }}
50
+ python-version : " 3.10 "
65
51
mamba-version : " *"
66
52
67
53
- name : Set reusable strings
97
83
echo CUDA_PATH=$CUDA_HOME >> "$GITHUB_ENV"
98
84
99
85
if [ "${{ matrix.os }}" = "windows-latest" ]; then
86
+ echo CXX_COMPILER=cl >> "$GITHUB_ENV"
87
+ echo C_COMPILER=cl >> "$GITHUB_ENV"
100
88
# without -DCMAKE_CUDA_COMPILER=nvcc, cmake config always fail for cuda-11.8
101
89
echo DCMAKE_CUDA_COMPILER=-DCMAKE_CUDA_COMPILER=nvcc >> "$GITHUB_ENV"
90
+ else
91
+ echo CXX_COMPILER=g++ >> "$GITHUB_ENV"
92
+ echo C_COMPILER=gcc >> "$GITHUB_ENV"
102
93
fi
103
94
104
95
nvcc --version
@@ -109,26 +100,27 @@ jobs:
109
100
- name : Prep build
110
101
run : python -m pip install cmake==3.27.9 ninja setuptools wheel
111
102
112
- - name : Configure CMake
103
+ # TODO: the following steps (CUDA, NOBLASLT, CPU) could be moved to the matrix, so they're built in parallel
104
+
105
+ - name : Configure CUDA
113
106
run : >
114
107
cmake -B ${{ steps.strings.outputs.build-output-dir }}
115
108
-G Ninja ${{ env.DCMAKE_CUDA_COMPILER }}
116
- -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
117
- -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
109
+ -DCMAKE_CXX_COMPILER=${{ env.CXX_COMPILER }}
110
+ -DCMAKE_C_COMPILER=${{ env.C_COMPILER }}
118
111
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
119
112
-DCOMPUTE_CAPABILITY="50;52;60;61;62;70;72;75;80;86;87;89;90"
120
113
-S ${{ github.workspace }}
121
114
122
- - name : Build
123
- # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
115
+ - name : Build CUDA
124
116
run : cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
125
117
126
118
- name : Configure NOBLASLT
127
119
run : >
128
120
cmake -B ${{ steps.strings.outputs.build-output-dir }}
129
121
-G Ninja ${{ env.DCMAKE_CUDA_COMPILER }}
130
- -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
131
- -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
122
+ -DCMAKE_CXX_COMPILER=${{ env.CXX_COMPILER }}
123
+ -DCMAKE_C_COMPILER=${{ env.C_COMPILER }}
132
124
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
133
125
-DCOMPUTE_CAPABILITY="50;52;60;61;62;70;72;75;80;86;87;89;90"
134
126
-DNO_CUBLASLT=ON
@@ -141,8 +133,8 @@ jobs:
141
133
run : >
142
134
cmake -B ${{ steps.strings.outputs.build-output-dir }}
143
135
-G Ninja ${{ env.DCMAKE_CUDA_COMPILER }}
144
- -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
145
- -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
136
+ -DCMAKE_CXX_COMPILER=${{ env.CXX_COMPILER }}
137
+ -DCMAKE_C_COMPILER=${{ env.C_COMPILER }}
146
138
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
147
139
-DNO_CUBLASLT=ON
148
140
-DBUILD_CUDA=OFF
@@ -151,12 +143,6 @@ jobs:
151
143
- name : Build CPU
152
144
run : cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
153
145
154
- - name : Test
155
- working-directory : ${{ steps.strings.outputs.build-output-dir }}
156
- # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
157
- # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
158
- run : ctest --build-config ${{ matrix.build_type }}
159
-
160
146
- name : Build dist
161
147
shell : bash -el {0}
162
148
run : |
@@ -168,6 +154,6 @@ jobs:
168
154
- name : Upload Build Artifacts
169
155
170
156
with :
171
- name : bitsandbytes-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix. cuda-version }}
157
+ name : bitsandbytes-${{ matrix.os }}-${{ matrix.cuda-version }}
172
158
path : |
173
159
${{ github.workspace }}/dist/
0 commit comments