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

[Puzzletron] Runtime stats benchmark model computes head size as hidden_size // num_attention_heads instead of reading head_dim

Aperta
#3,016 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@grzegorz-k-karch ci sta già lavorando.

Dal 26/10/2026.

  • #3112 di @efegokdemir — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug

Follow-up to #3009, which fixed the Puzzletron memory objective to use the model's head_dim for the KV cache (#2482).

The runtime objective has the same root cause. calc_runtime_stats.create_benchmark_model builds the synthetic Llama benchmark model with:

model_config = LlamaConfig(
    hidden_size=hidden_size,  # candidate hidden size
    num_attention_heads=num_attention_heads,
    head_dim=None,  # Compute from hidden_size // num_attention_heads instead of using default 128
    ...
)

So when runtime_stats_enabled=True, the benchmarked attention uses hidden_size // num_attention_heads as its head size, which is wrong in two cases:

  • Models that set head_dim independently, e.g. Mistral-Small-24B (160 instead of 128) or gpt-oss-20b (45 instead of 64).
  • Every candidate with a pruned hidden_size. Pruning leaves head_dim unchanged, but here it shrinks with the candidate hidden size.

As a result, the latency numbers fed to the MIP are skewed the same way the memory numbers were before #3009.

Suggested fix: pass the parent's head size, get_attention_head_dim(descriptor.get_language_model_config(model_config)) from modelopt/torch/puzzletron/utils/misc.py, into create_benchmark_model as head_dim. Validate with a vLLM runtime-stats run.

Raised in the review of #3009: https://github.com/NVIDIA/Model-Optimizer/pull/3009#discussion_r4374334841

Lingua principale
Python
Stelle
5.5k
Fork
785
Merge medio
3g 22h
PR unite (30g)
277

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.