[Bugs] Second batch of verified findings from the unit-coverage initiative (fold_weight crash on Llama-4/GPT-OSS MoE, KD-loss default footgun, and smaller items)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- machine-learning, testing-qa
Direzione di ricerca
Tratta i risultati numerati come attività di lavoro separate: inizia dal percorso pubblico mtq.fold_weight(), quindi esamina QuantModule.fold_weight in quant_module.py:141 e le definizioni degli esperti Llama-4/GPT-OSS in huggingface.py:751 e :1451. Esamina losses.py, loss_balancers.py, conversion.py:485, calib/bias.py, config.py:505-514 e test_affine_quant.py per gli altri risultati; il lavoro è completo quando ogni difetto confermato ha una correzione mirata e una copertura di regressione oppure un contratto documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #1902: writing direct unit suites for more modules (PRs #1913-#1916, #1922-#1925) surfaced another batch of verified defects. Everything below was confirmed by at least two independent passes (suite writer + adversarial reviewer, who re-derived math from source and reproduced the crashes). Ordered by priority; happy to send fix PRs for any of these.
1. fold_weight crashes on custom per-weight quantizers — reachable from public mtq.fold_weight() on Llama-4 / GPT-OSS (CRASH)
QuantModule.fold_weight (quant_module.py:141) derives the weight attribute as name[:-10], stripping "_quantizer" — while the adjacent comment claims it strips "_weight_quantizer". It works for the standard weight/weight_quantizer layout only by accident. For custom per-weight quantizers (quantizer_attr_names("gate_up_proj") → gate_up_proj_weight_quantizer, weight attr gate_up_proj) it derives gate_up_proj_weight and trips the assertion. Reproduced: AssertionError: gate_up_proj_weight_quantizer doesn't have a corresponding gate_up_proj_weight. Neither _QuantLlama4TextExperts (huggingface.py:751) nor _QuantGptOssExperts (:1451) overrides fold_weight, and mtq.fold_weight() walks every QuantModule — so folding a quantized Llama-4 or GPT-OSS model crashes. Fix caveat: these experts quantize transposed (_transposed_quantize), so a correct fold needs more than name surgery. Documented in #1925.
2. LogitsDistillationLoss rides F.kl_div's deprecated "mean" default (SILENT FUTURE RESCALE)
losses.py:34/60 use the default reduction that PyTorch deprecates in favor of batchmean semantics; when torch flips it in a future major, the default KD loss silently rescales by the class-dim size. Pin reduction explicitly (or default to "batchmean" deliberately). Documented in #1924.
3. modelopt_state() returns aliases of the manager's live state
conversion.py:485 filters into a new list but keeps the same tuple/dict objects — caller mutation silently corrupts the model's recorded modelopt state. A deepcopy may be costly for large quantizer metadata, so this may be better fixed as a documented contract ("treat as read-only") or a shallow-copy of the per-mode dicts. Documented in #1915.
4. Loss-balancer validation gaps (small PR-sized pair)
StaticLossBalancer(1) crashes with TypeError (isinstance accepts only float, loss_balancers.py:95), and individually NEGATIVE weights pass the sum-only range check (:98-103), silently subtracting a loss term. Documented in #1924.
5. Bias-calibrator doc/API quartet (docs-only fix)
calib/bias.py: the axis docstring (and collect()'s comment block incl. its example shapes) says listed dims are KEPT, but the implementation REDUCES them (shipped behavior, locked in by test_affine_quant.py); axis: int | ... annotation contradicts the iterable-only implementation; compute_bias silently falls through to max_min on unknown methods while collect/compute_dynamic_bias raise; the mean/max_min comments in compute_dynamic_bias are swapped. Worst part: the bias field docstring examples in config.py (:505-514, e.g. {"enable": True, "axis": -1}) are all REJECTED by its own validate_bias validator — the documented schema is unusable as written. Documented in #1922.
6. Smaller items
DistillationModel.export()removes hooks but leaves stale_intermediate_outputattributes pinning the last captured activations (incl. an autograd graph) on student and teacher layers (#1923).MGDLossdoes not detach teacher features, unlike its sibling losses — only standalone (non-DistillationModel) use is affected (#1924)._ModeRegistryCls.__del__is unreachable (the class-level_all_registriesholds a strong reference) and unsafe if ever reached (unconditionallist.removeraises after manual removal) — surfaced while fixing the vacuous assertion in #1921.logging._disable_tqdmpositional-args branch has a double off-by-one (dropsargs[index-1], inserts True one slot early); unreachable in practice (needs ≥10 positional tqdm args).DistillationLossBalancerdeclaresabstractmethodwithout ABCMeta, so it instantiates and only fails at call time (#1924).
- Lingua principale
- Python
- Stelle
- 5.3k
- Fork
- 745
- Merge medio
- 3g 17h
- PR unite (30g)
- 177
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/Model-Optimizer
-
[Bug] modelopt-mcp: all launcher subprocesses hang when the server runs as a stdio MCP server — missing stdin=DEVNULLForse già presa @ChenhanYu l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NVIDIA/Model-Optimizer#2551 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Puzzletron Progress 6/8 (calculating one block scores) takes 10 to 20 times more than in tutorialForse di nuovo libera @tejasng053 l’ha presa 22 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NVIDIA/Model-Optimizer#1667 ·
I maintainer di solito rispondono entro 2 giorni
-
feature request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
NVIDIA/Model-Optimizer#2865 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
NVIDIA/Model-Optimizer#2857 ·
I maintainer di solito rispondono entro 2 giorni
-
fp4_kernel_hopper.py uses tl.make_block_ptr, which is removed in Triton main (breaks NVFP4 fake quant)Forse già presa @kinjalpatel27 l’ha presa 3 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 72/100
NVIDIA/Model-Optimizer#2810 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di NVIDIA/Model-Optimizer
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
521xueweihan/HelloGitHub#4025 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
aws-samples/sample-per-model-bedrock#321 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
FavioVazquez/showtime#101 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
koush/ha_scrypted#81 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
google/osv-scanner-action#147 ·