NVFP4 quantized (shared) lm_head fails fake-quant in training forward: ScaledE4M3Function 'Only support E=4 & M=3'
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Área
- machine-learning
Línea de trabajo
Lee modelopt/torch/quantization/tensor_quant.py alrededor de la línea 436 y luego sigue _fake_quantize desde quant_linear durante process_mtp_loss. Reproduce la ruta de training-forward de QAD/MTP descrita en el issue; estará terminado cuando una output_layer NVFP4 pueda permanecer cuantizada sin provocar el NotImplementedError exclusivo de E4M3.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
When an NVFP4-quantized output_layer/lm_head (weight quantizer num_bits: e2m1, block scale e4m3) is exercised in the training forward (not just PTQ/export), _fake_quantize routes into ScaledE4M3Function.forward (modelopt/torch/quantization/tensor_quant.py), which raises NotImplementedError("Only support E=4 & M=3 for now.") because the NVFP4 weight format is E2M1, not E4M3.
Repro context
QAD (KD) on a hybrid-MoE model that has an MTP head, with the MTP loss enabled (#1805). The main LM head is skipped via skip_lm_loss, so PTQ/export never hit this path — but the MTP head shares the quantized output_layer and calls it during the MTP loss, triggering fake-quant in the training forward. Traceback: process_mtp_loss -> output_layer -> quant_linear -> tensor_quantizer._fake_quantize -> tensor_quant.py:436.
Impact / workaround
Blocks keeping lm_head/output_layer quantized (NVFP4) when the MTP head is involved during QAD. Workaround: keep lm_head/output_layer in BF16. A proper fix would let the NVFP4 weight quantizer fake-quant correctly in the training forward instead of dispatching to the E4M3-only path.
Verified on modelopt main 973cb09cb. cc @AAnoosheh (#1805)
- Lenguaje dominante
- Python
- Estrellas
- 5.3k
- Forks
- 745
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 160
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/Model-Optimizer
-
[Bug] modelopt-mcp: all launcher subprocesses hang when the server runs as a stdio MCP server — missing stdin=DEVNULLPosiblemente ocupada @ChenhanYu la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NVIDIA/Model-Optimizer#2551 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Puzzletron Progress 6/8 (calculating one block scores) takes 10 to 20 times more than in tutorialQuizá libre de nuevo @tejasng053 la tomó hace 19 días y no hay ningún pull request abierto. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
NVIDIA/Model-Optimizer#1667 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 Medio día Aptitud para principiantes 72/100
NVIDIA/Model-Optimizer#2810 ·
Los mantenedores suelen responder en 2 días
-
test_cast_fp4_impl_gpu_mem is flaky on Jetson Thor: mem_get_info reports system-wide memory on integrated GPUsPosiblemente ocupada @LinCanNerd la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
NVIDIA/Model-Optimizer#2706 ·
Los mantenedores suelen responder en 2 días
-
test_cuda_pack_reconstruction_matches_pytorch_at_scale[iq1_m] fails on Jetson Thor: exact ties exceed the blocks // 1000 boundPosiblemente ocupada @LinCanNerd la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
NVIDIA/Model-Optimizer#2705 ·
Los mantenedores suelen responder en 2 días
Todos los issues de NVIDIA/Model-Optimizer
Issues similares
-
approved Good First Issue scope: docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
hiero-ledger/hiero-sdk-python#2730 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
wemake-services/wemake-django-template#3178 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops itAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
docling-project/docling#4846 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
neurostuff/NiMARE#1181 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pytest-dev/pytest#15180 ·
Los mantenedores suelen responder en 1 día