Skip to content

Vernier Micro-benchmark improvements - #6715

Closed
damien-lejeune wants to merge 7 commits into
mainfrom
users/siloai/aiter-benchmarking
Closed

damien-lejeune wants to merge 7 commits into
mainfrom
users/siloai/aiter-benchmarking

Conversation

@damien-lejeune

Copy link
Copy Markdown
Contributor

TODO

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6715 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@vedenev-amd

Copy link
Copy Markdown
Contributor

Claude generated review (AI review by Claude, posted from Maksim's account; not Maksim's own review).

Advisory review of the new aiter/bench package at e8c6d77. Checked on gfx950 (MI355X), torch 2.10.0+rocm7.2.4: python3 -m pytest -q tests/test_bench.py gives 21 passed, 6 failed. I also compared the new timers against run_perftest on test_moe_2stage.py and the FlyDSL mqa_logits op tests (one box, 1-2 runs).

1. Device mode fails on torch 2.10+rocm. aiter/bench/timers/device.py:34 calls event.activity_type(). torch._C._autograd._KinetoEvent doesn't have it on torch 2.10.0+rocm7.2.4 (it has device_type, correlation_id, linked_correlation_id). Device mode, the default, raises AttributeError on every call, and 6 of the 27 tests in tests/test_bench.py fail with it. The CPU tests pass only because the fake event at tests/test_bench.py:111 defines activity_type itself. CI runs tests/test_*.py (.github/scripts/aiter_test.sh:33), so this will fail wherever the runner has this torch. Could the activity be derived from what this torch exposes, or guarded with hasattr and a fallback?

2. Device mode fails on closure-style tests. Device mode defaults to cache="rotate", and aiter/bench/api.py raises ValueError when the callable takes no arguments. Most FlyDSL op tests time closures (launch_fp8, run_fp4, ...). On test_flydsl_fp8_paged_mqa_logits.py, test_flydsl_pa_mqa_logits_fp4.py and test_flydsl_pa_mqa_logits_fp4_prefill.py, time_fn(closure, MeasureConfig(mode="device")) failed on 91 of 92 calls. run_perftest times the same closures (warm). Suggestion: fall back to warm with a note for argument-less callables, as auto already does.

3. Default eager hides most host launch overhead. The README says eager is "per-call time including host launch overhead", and time_all says eager - graph is the host overhead per call. With the default cache="flush", the flush kernel runs before each call and the host can enqueue the next launch meanwhile. Measured on gfx950, test_flydsl_pa_mqa_logits_fp4, launch_flydsl (~3 us kernel):

mode us
eager, default (flush) 6.5
eager, cache="warm" 77.0
graph (warm) 2.4
device (warm) 3.1

So eager - graph gives ~4 us where ~75 us of host cost exists. The cause is my inference. Either default eager to warm/sync_each for host-overhead questions, or note in the README and the time_all docstring that the default hides most launch cost.

4. Stray FlyKAT files. The four files under op_tests/op_benchmarks/flydsl/flykat/ have download-style names (SKILL (2).md, bench_graph (2).py, reference (1).md, timing_modes (1).md). bench_graph (2).py imports flykat.tools.bench.models, which is not in aiter or a dependency, and SKILL (2).md links reference.md, which doesn't exist under that name. Nothing in aiter/bench uses them. Drop them from this PR, or rename them and say where FlyKAT comes from?

5. PR description. It's still the empty template ("TODO"). A short motivation, the relation to run_perftest and the tuners, and a test result would help before this leaves draft.

Other observations, for context (not defects):

  • On test_moe_2stage.py (bf16, hidden 7168, 257 experts, top-9), new device and graph agree with run_perftest within 1% at 16-1024 tokens. At 1 token, run_perftest reports 83.8 us vs 58.7 us (device) and 56.5 us (graph). The new tool counts 3 kernels per call there, so the old number looks off; not root-caused.
  • Graph capture fails for 37 of 50 FlyDSL calls in test_flydsl_fp8_paged_mqa_logits.py ("operation not permitted when stream is capturing"); the Gluon variant captures. That's a useful catch by the new tool (the launcher or the test closure is not capturable).
  • The "GPU was already busy" note fired on 15 of 20 MoE calls; the 5% activity threshold may be too sensitive, for example right after the previous call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants