From 04304fdae6612fb173d31819d50a8de5e31bce25 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Fri, 8 May 2026 23:28:32 +0000 Subject: [PATCH] Add export crash fix patches, update README with bug #5 (repr CUDA crash) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5c0d618..9122f70 100644 --- a/README.md +++ b/README.md @@ -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).