Commit 2981bfd
Add nvvm bindings (NVIDIA#421)
* Add nvvm to setup.py
* Add test_nvvm.py
* test_nvvm.py version(), ir_version()
* Snapshot of generated files.
* Add in `nvvm.create_program()`
* Add in `nvvm.destroy_program()`
* Add in `nvvm.compile_program()`
* Add in add_module_to_program()
* Add in verify_program()
* Add in lazy_add_module_to_program()
* Add in get_compiled_result_size(), get_program_log_size()
* Add in get_compiled_result(), get_program_log()
* Change Copyright dates to 2025
* Use cybind results "automatically generated across versions from 12.0.1 to 12.8.0."
* update to use NVKS runners
* Add tests/run_simple.py
* update fetch_ctk to find nvvm shared lib
* fix wheel rel path
* add nvcc wheel to [all]
* Fix cybind bindings for add_module_to_program(), lazy_add_module_to_program()
* Add test_with_minimal_nnvm_ir()
* Remove tests/run_simple.py
* Update cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx
Co-authored-by: Leo Fang <[email protected]>
* Update cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx
Co-authored-by: Leo Fang <[email protected]>
* Remove stray `f` (it is now a plain string, not an f-string anymore)
* Add bootstrap_local_dev.sh script.
* Fix nvvm.compile_program() failure for CUDA version 12.0
The original datalayout lacked explicit alignment and size definitions for i1, i8, i16, f32, f64, v64, and v128.
The missing types are crucial for LLVM-based compilation in CUDA 12.0.
Later CUDA versions are more forgiving, but 12.0 enforces a stricter layout. The stricter layout should resolve the issue for CUDA 12.0
without breaking compatibility with later versions.
* Add test_verify_program_with_minimal_nnvm_ir() and rename some tests for clarity.
* Complete test coverage.
* Introduce noregex() to reduce backslash clutter.
* Use a contextmanager to replace repeated try-finally.
* Rename noregex to match_exact
* Introduce get_program_log() helper.
* Improve nvvm_program() Context Manager
* Remove redundant "utf-8"
* Also test with NVVM Bitcode (using a new pytest fixture).
* Introduce compile_or_verify fixture.
* Remove bootstrap_local_dev.sh, to be moved to a separate PR.
* Update from codegen after config fix.
* Update from codegen after config fix.
* Update from codegen after adding CTK 11.x nvvm.h headers. Functional NO-OP.
* Fix get_nvvm_dso_version_suffix() to match actual version numbers:
./11.0.3_450.51.06/cuda_nvcc/nvvm/lib64/libnvvm.so.3.3.0
./11.1.1_455.32.00/cuda_nvcc/nvvm/lib64/libnvvm.so.3.3.0
./11.2.2_460.32.03/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./11.3.1_465.19.01/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./11.4.4_470.82.01/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./11.5.1_495.29.05/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./11.6.2_510.47.03/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./11.7.1_515.65.01/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./11.8.0_520.61.05/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.0.1_525.85.12/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.1.1_530.30.02/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.2.2_535.104.05/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.3.2_545.23.08/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.4.1_550.54.15/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.5.1_555.42.06/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.6.2_560.35.03/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
./12.8.0_570.86.10/cuda_nvcc/nvvm/lib64/libnvvm.so.4.0.0
For completeness, since the nvjitlink code is touched in this commit, these are the libnvJitLink version numbers:
./12.0.1_525.85.12/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.0.140
./12.1.1_530.30.02/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.1.105
./12.2.2_535.104.05/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.2.140
./12.3.2_545.23.08/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.3.101
./12.4.1_550.54.15/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.4.127
./12.5.1_555.42.06/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.5.82
./12.6.2_560.35.03/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.6.77
./12.8.0_570.86.10/libnvjitlink/targets/x86_64-linux/lib/libnvJitLink.so.12.8.61
* find_libnvvm_so_via_proc_self_maps() Proof Of Concept
* Revert "find_libnvvm_so_via_proc_self_maps() Proof Of Concept"
This reverts commit b45bac2.
* Add another rpath for finding libnvvm.so
---------
Co-authored-by: Leo Fang <[email protected]>1 parent 27317a0 commit 2981bfd
File tree
13 files changed
+1404
-4
lines changed- .github/actions/fetch_ctk
- cuda_bindings
- cuda/bindings
- _internal
- tests
13 files changed
+1404
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
0 commit comments