You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add BNB_ROCM_VERSION and ROCM_VERSION for ROCm/PyTorch version mismatch (#1878)
* Add BNB_ROCM_VERSION and ROCM_VERSION for ROCm/PyTorch version mismatch
When PyTorch is built with a different ROCm version than the system (e.g. torch+rocm7.0 on ROCm 7.2), bitsandbytes fails to find the native library because the build uses hipconfig (system) while runtime uses torch.version.hip (PyTorch).
- Add BNB_ROCM_VERSION env var (runtime): override which ROCm library is loaded, analogous to BNB_CUDA_VERSION. Takes priority when both BNB_ROCM_VERSION and BNB_CUDA_VERSION are set on ROCm.
- Add ROCM_VERSION CMake cache variable (build): override the version shortcode in the output library name (e.g. -DROCM_VERSION=70 produces libbitsandbytes_rocm70.so on a 7.2 system).
- Update diagnostics and error messages to mention BNB_ROCM_VERSION; align _print_hip_runtime_diagnostics with _print_cuda_runtime_diagnostics.
- Reject BNB_CUDA_VERSION on ROCm with a clear error pointing to BNB_ROCM_VERSION.
- Add ROCm tests: default path, override, rejection of BNB_CUDA_VERSION, and both vars set (ROCM wins).
FixesROCm#82.
* Lint
0 commit comments