This repository was archived by the owner on Jan 27, 2026. It is now read-only.
Commit 9ea57a8
authored
Improve CUDA capability handling (#329)
We computed a kernel's capabilities by taking the loose intersection of
the stated kernel capabilities (or the default) and the capabilities
reported to be supported by CMake/Torch. However, this led to issues
with e.g. capability 8.9, which is not in these lists (anymore?), but is
fine to compile for.
To solve this issue, we will ignore the capabilities reported by
CMake/Torch and instead use our own list of capabilities for the loose
intersection with the kernel capabilities. This list is the list of all
capabilities supported by a CUDA version minus some really old
capabilities that are not supported by Torch anyway. This behavior is
used by enabling the new `BUILD_ALL_SUPPORTED_ARCHS` CMake option (which
is the default for the Nix and Windows builders).
When `BUILD_ALL_SUPPORTED_ARCHS` is not set, we will try to detect the
capability of the user's CUDA GPU. This speeds up development - since
one then only has to compile for a single capability. If this fails for
some reason, we'll revert to using all capabilities as if
`BUILD_ALL_SUPPORTED_ARCHS` was set.1 parent 0253b68 commit 9ea57a8
File tree
7 files changed
+91
-44
lines changed- build2cmake/src
- templates
- cuda
- torch
- lib/torch-extension
- pkgs/build2cmake
- scripts/windows
7 files changed
+91
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
45 | 68 | | |
46 | 69 | | |
47 | 70 | | |
| |||
152 | 175 | | |
153 | 176 | | |
154 | 177 | | |
155 | | - | |
156 | | - | |
| 178 | + | |
157 | 179 | | |
158 | 180 | | |
159 | 181 | | |
160 | | - | |
161 | | - | |
| 182 | + | |
162 | 183 | | |
163 | 184 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 185 | + | |
169 | 186 | | |
170 | 187 | | |
171 | 188 | | |
172 | 189 | | |
173 | 190 | | |
174 | 191 | | |
175 | 192 | | |
176 | | - | |
177 | | - | |
178 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
179 | 196 | | |
180 | 197 | | |
181 | 198 | | |
182 | | - | |
| 199 | + | |
183 | 200 | | |
184 | 201 | | |
185 | 202 | | |
| |||
200 | 217 | | |
201 | 218 | | |
202 | 219 | | |
203 | | - | |
204 | | - | |
| 220 | + | |
| 221 | + | |
205 | 222 | | |
206 | 223 | | |
207 | 224 | | |
208 | 225 | | |
209 | 226 | | |
210 | 227 | | |
211 | | - | |
| 228 | + | |
212 | 229 | | |
213 | 230 | | |
214 | 231 | | |
| |||
228 | 245 | | |
229 | 246 | | |
230 | 247 | | |
231 | | - | |
| 248 | + | |
232 | 249 | | |
233 | 250 | | |
234 | 251 | | |
235 | 252 | | |
236 | 253 | | |
237 | 254 | | |
238 | | - | |
| 255 | + | |
239 | 256 | | |
240 | 257 | | |
241 | 258 | | |
| |||
383 | 400 | | |
384 | 401 | | |
385 | 402 | | |
| 403 | + | |
| 404 | + | |
386 | 405 | | |
387 | 406 | | |
388 | 407 | | |
389 | 408 | | |
390 | | - | |
391 | | - | |
| 409 | + | |
| 410 | + | |
392 | 411 | | |
393 | 412 | | |
394 | 413 | | |
| |||
404 | 423 | | |
405 | 424 | | |
406 | 425 | | |
407 | | - | |
| 426 | + | |
408 | 427 | | |
409 | 428 | | |
410 | 429 | | |
411 | | - | |
| 430 | + | |
412 | 431 | | |
413 | | - | |
| 432 | + | |
414 | 433 | | |
415 | 434 | | |
416 | 435 | | |
417 | 436 | | |
418 | 437 | | |
419 | 438 | | |
420 | | - | |
| 439 | + | |
421 | 440 | | |
422 | 441 | | |
423 | 442 | | |
424 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
425 | 464 | | |
426 | 465 | | |
427 | 466 | | |
428 | | - | |
| 467 | + | |
429 | 468 | | |
430 | 469 | | |
431 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 21 | | |
29 | 22 | | |
30 | 23 | | |
| |||
417 | 410 | | |
418 | 411 | | |
419 | 412 | | |
420 | | - | |
421 | 413 | | |
422 | 414 | | |
423 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
0 commit comments