Add export crash fix patches, update README with bug #5 (repr CUDA crash)

This commit is contained in:
2026-05-08 23:28:32 +00:00
parent 50348989b2
commit 04304fdae6

View File

@@ -79,3 +79,4 @@ The `quant_module_patched.py` fix is for **modelopt 0.45.0.dev64** specifically.
2. `--low_memory_mode` → meta device error
3. Missing `kernels` package for FP8 ops
4. `--calib` not `--calib_size`, `--quant` not `--qformat` (shell script arg names)
5. **Export crash — `repr()` triggers CUDA illegal memory access.** After 5+ hours of calibration, modelopt's export step calls `repr(input_quantizer)` to check if a quantizer is disabled. This triggers `_short_amax()``tensor.item()` on a GPU tensor that's been sitting in VRAM for hours. CUDA says no. The fix: replace `"disabled" not in repr(input_quantizer)` with `not getattr(input_quantizer, '_disabled', False)`. One line. NVIDIA wrote a string-matching check on a full object repr instead of checking the boolean attribute directly. This is the kind of thing that makes you wonder if anyone at NVIDIA actually tested their export path on a model larger than 7B. Patched in `patches/unified_export_hf_patched.py` and `patches/tensor_quantizer_patched.py` (the latter wraps `_short_tensor` in a try/except as insurance).