Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

NVFP4 quantized (shared) lm_head fails fake-quant in training forward: ScaledE4M3Function 'Only support E=4 & M=3'

Abierto
#1,875 4 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Stack tecnológico
python, pytorch

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

bug investigating torch.quantization
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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA/Model-Optimizer

Todos los issues de NVIDIA/Model-Optimizer

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.