Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,875 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python, pytorch

Direzione di ricerca

Leggi modelopt/torch/quantization/tensor_quant.py intorno alla riga 436, quindi segui _fake_quantize da quant_linear durante process_mtp_loss. Riproduci il percorso di training-forward QAD/MTP descritto nell’issue; il lavoro è completo quando una output_layer NVFP4 può rimanere quantizzata senza generare il NotImplementedError esclusivo di E4M3.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)

Lingua principale
Python
Stelle
5.3k
Fork
745
Merge medio
3g 17h
PR unite (30g)
177

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/Model-Optimizer

Tutte le issue di NVIDIA/Model-Optimizer

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.