Skip to content

perf(cuda): attribute the gemma-4-26b-a4b and glm4-flash decode drops from the 2026-07-12 GB10 sweep (re-measure after reboot first) #755

Description

@inureyes

Summary

The 2026-07-12 GB10 full sweep (mlxcel 0.4.0-rc.1, MLX pin 57c66cac / 0.32.1) recorded moderate decode drops versus the 2026-06-17 (0.3.1) sweep for gemma-4-26b-a4b-it-4bit, gemma-4-26b-a4b-it-qat-4bit, and glm4-flash-4bit. PR #751 hypothesized these were the same L=1 depthwise-conv dispatch cost that hit lfm2; issue #752 / PR #753 (06a8f38) refuted that on the record: neither architecture calls conv1d at all (gemma4 MoE and glm4_moe_lite). The drops are therefore unattributed.

Because the same sweep carried an unattributed environmental anomaly (the SSM/hybrid cluster read 2-3x HIGHER than every earlier record) and the host had ~5.5 days of uptime with the known post-benchmark-day driver signature, sweep deltas from that day are not trustworthy attribution evidence on their own. The first discriminating step is a clean re-measurement after a host reboot.

Measurements (2026-06-17 / 0.3.1 -> 2026-07-12 / 0.4.0-rc.1)

Model Prefill tok/s Decode tok/s
gemma-4-26b-a4b-it-4bit 130.81 -> 114.81 (-12.2%) 58.59 -> 50.19 (-14.3%)
gemma-4-26b-a4b-it-qat-4bit 136.06 -> 114.43 (-15.9%) 50.33 -> 45.29 (-10.0%)
glm4-flash-4bit 106.65 -> 99.04 (-7.1%) 53.33 -> 45.72 (-14.3%)

Related SSM data point, same status: mamba2-130m (bf16) decode 181.05 -> 162.23 (-10.4%). The #752 nsys audit showed its conv runs on the fast engine (slow engine 0 launches, conv only 1.6% of decode), so its drop is equally unattributed.

Source CSVs: benchmarks/cuda_gb10_2026-06-17.csv, benchmarks/cuda_gb10_2026-07-12.csv.

Already ruled out

Environmental context

  • Same-sweep anomaly: the SSM/hybrid cluster (granite-4.0-h, falcon-h1, nemotron-h/nas/omni, plamo-2) read 2-3x higher than both the 2026-06-17 sweep and the 2026-07-09 subset with no relevant code change in between; still unattributed.
  • Host state: ~5.5 days uptime at sweep time; the known GB10 post-benchmark-day driver signature was active (nondeterministic CUDA graph-capture aborts in broad test suites on 2026-07-12, recorded on PR fix: bind gemma-4 NVFP4 vision tower so image input works #750).

Plan (ordered; step 1 gates everything else)

  1. Re-measure after a fresh host reboot. Run single-model benchmarks for the three subjects plus mamba2-130m and two stable controls, ideally in the same post-reboot session as the planned SSM-cluster re-verification so one reboot settles both anomalies:

    ./scripts/bench_decode.sh models/gemma-4-26b-a4b-it-4bit --cooldown 30
    ./scripts/bench_decode.sh models/gemma-4-26b-a4b-it-qat-4bit --cooldown 30
    ./scripts/bench_decode.sh models/glm4-flash-4bit --cooldown 30
    ./scripts/bench_decode.sh models/mamba2-130m --cooldown 30
    ./scripts/bench_decode.sh models/qwen3-30b-a3b-4bit --cooldown 30
    ./scripts/bench_decode.sh models/lfm2-8b-a1b-4bit --cooldown 30

    (qwen3-30b-a3b-4bit is the MoE control that was stable on 2026-07-12 at +1%; lfm2-8b-a1b-4bit is the hybrid control at +3%.) If the subjects return to the 2026-06-17 envelope while controls stay put, the verdict is environmental: update the doc rows and notes with the post-reboot values and close with the evidence.

  2. Only if the drops persist post-reboot: profile a warm decode of gemma-4-26b-a4b-it-4bit against the healthy MoE control with the perf(cuda): audit L=1 depthwise conv1d dispatch across SSM/hybrid decode paths and apply the #751 elementwise step where confirmed #752 method (nsys kernel histogram, MLX_USE_CUDA_GRAPHS=0) and diff the kernel mix; then review MoE-path changes in the 0.3.1 -> 0.4.0-rc.1 window for the suspects (the perf(cuda/quant): amortize small-M quantized matmul with a multirow qmv path #740 multirow qmv path on expert matmuls, perf(cuda): single-dtype decode graph to eliminate per-token AsType #732 single-dtype decode-graph eligibility for these architectures, fused-MoE dispatch changes).

  3. Root-cause and fix, or document as an accepted change, and refresh the affected rows in docs/benchmark_results/model_tests_gb10.md with committed singles CSVs.

Acceptance Criteria

  • Post-reboot single-model measurements recorded for the three subjects, mamba2-130m, and both controls (singles CSVs committed; numbers in the issue or PR)
  • Verdict recorded: environmental (numbers recover post-reboot) or real regression (drops persist)
  • If environmental: doc rows and the unattributed-drop notes updated to the post-reboot values and this issue closed with the evidence
  • If real: root cause identified with profiling evidence, then fixed or documented as accepted, with doc rows refreshed
  • The unattributed-drop mentions in docs/benchmark_results/model_tests_gb10.md reference this issue number

References

Metadata

Metadata

Assignees

Labels

area:benchmarkBenchmark harness and performance measurement (bench_*.sh, /update-benchmarks)area:inferenceGeneration, sampling, decoding (incl. speculative, DRY)priority:mediumMedium prioritystatus:doneCompletedtype:bugBug fixes, error corrections, or issue resolutions

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions