Commit 09c2cd9
committed
fix(spatial): fall back to PyTorch path on Blackwell (sm_120) GPUs when USE_COMPILED=True
monai._C (grid_pull) was not compiled with sm_120 (Blackwell) architecture
support, causing spatial_resample to produce incorrect results on RTX 50-series
GPUs when USE_COMPILED=True.
Add _compiled_unsupported() to detect compute capability major >= 12 at
runtime and transparently fall back to the PyTorch-native affine_grid +
grid_sample path, which is verified correct on sm_120.
Fixes test_flips_inverse_124 in tests.transforms.spatial.test_spatial_resampled
on NVIDIA GeForce RTX 5090 (Blackwell, sm_120).1 parent 19cab57 commit 09c2cd9
1 file changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
57 | 78 | | |
58 | 79 | | |
59 | 80 | | |
| |||
158 | 179 | | |
159 | 180 | | |
160 | 181 | | |
161 | | - | |
| 182 | + | |
| 183 | + | |
162 | 184 | | |
163 | 185 | | |
164 | 186 | | |
| |||
0 commit comments