[Fix] Make DeepGEMM triton fallback more robust (#47126)
* Catch DeepGEMM errors on call
* Add real call to fallback to triton for broken homes
* Remove extra wrapper
* Better deepgemm errors (#47154)
* Gate DeepGEMM JIT on the CUDA toolkit (nvcc/NVRTC), not the runtime
DeepGEMM JIT-compiles its kernels with the system CUDA toolkit, so gating on the
CUDA runtime version was the wrong signal (and on multi-toolkit boxes could read a
stray/mismatched libcudart). Resolve the toolkit the way DeepGEMM does (respecting
CUDA_HOME) and validate it statically before loading the kernel.
- import_utils: add get_cuda_home + get_nvcc_version (read the toolkit version from
version.json/version.txt/cuda.h, no subprocess); deprecate get_cuda_runtime_version.
- deepgemm: gate on the resolved nvcc toolkit; when nvcc is missing/too old but torch's
bundled libnvrtc is new enough, fall back to the NVRTC backend instead of failing.
- test_modeling_common: mirror the gate (Hopper -> CUDA 12.3, Blackwell -> 12.9).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* TRANSFORMERS_DISABLE_DEEPGEMM_LINEAR in worst case scenario
* remove nvrtc path as not usable with kernel hub build
* trim comment
* address comments
* update comment
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* Nit
---------
Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>