Commit 95ea3a0
authored
[FIX] Resolve JIT GPU backend by explicit signals, not stray /opt/rocm (#652)
Fixes #651.
The JIT extension backend selector decided CUDA-vs-HIP by probing for a
ROCm
home, whose fallback returns `/opt/rocm` whenever that directory merely
exists.
A CUDA/NVIDIA host carrying a stray `/opt/rocm` was therefore
misclassified as
HIP even with `nvcc` present and no `hipcc`.
`_detect_gpu_backend()` now resolves the backend from explicit signals,
in
order: the `TVM_FFI_GPU_BACKEND` override, then PyTorch build signals
(`torch.version.hip` / `torch.version.cuda`), then an available `hipcc`
when no
`nvcc` is present. Detection defaults to CUDA when otherwise
inconclusive, and
the existence of `/opt/rocm` alone never forces HIP. Toolkit-home,
compiler,
include-path, flag, and architecture discovery are unchanged and run
only after
the backend is resolved, so CUDA and HIP state never mix.1 parent 458aaf7 commit 95ea3a0
1 file changed
Lines changed: 36 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
43 | 57 | | |
44 | 58 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
48 | 68 | | |
49 | | - | |
50 | 69 | | |
51 | 70 | | |
52 | 71 | | |
53 | 72 | | |
54 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
55 | 85 | | |
56 | | - | |
57 | | - | |
| 86 | + | |
58 | 87 | | |
59 | 88 | | |
60 | 89 | | |
| |||
0 commit comments