Conversation
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: andyluo7 <andy.luo@amd.com>
Hy4-preview GPQA resultsPreviously from this PR I noticed GPQA results which seemed low (83-85%), but that seems due to a couple of factors/bad decisions on my part: 1) output limits that are too small so the model didn't have enough token budget to reason through the problems and 2) some ambiguity in extracting the answers. I don't think Tencent provided details on how they generated the numbers so the second point makes it tougher to compare to the "trusted" 92.3% provided by Tencent. If we use the gpt_oss extractor to pull the answers from the model response, we get results in the much closer to the 92.3%. TLDR, I think the accuracy looks good on this implementation (at least from these tests), but it might be helpful to try another benchmark with numbers from Tencent to be totally sure. Any suggestions? If not, I'll just pick one and run it. Run
Primary conservative extraction
The matched longer-output run recovered 15 net correct answers from 32K to 64K and reduced truncations from 23 to 4. Extending to 128K removed all remaining truncations but did not improve raw accuracy. The one-answer decline from 64K is consistent with stochastic variation: 15 samples changed from incorrect to correct and 16 changed from correct to incorrect. Paired primary-score transitions:
Extraction sensitivityRe-scoring the same generations with the installed
The installed extractor falls back to the first character when no explicit answer pattern matches, so these scores are protocol-sensitive and should not replace the conservative primary score without agreement on the benchmark contract. The 64K and 128K scores nevertheless demonstrate that output length and extraction account for most or all of the apparent gap under this protocol. |
Use AITER's fused biased sigmoid top-k for HY V4's one-group routing shape and make routing buffers contiguous before the fused MXFP8 MoE call. Add graph-safe ROCm kernels for the BF16 MLA output gate and attention sinks, including empty graph-padded row repair and construction-time validation of unsupported sink layouts. Preserve NVIDIA gate semantics through a shared subclass hook and add focused kernel, graph-replay, dispatch, and configuration coverage. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: andyluo7 <andy.luo@amd.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has merge conflicts that must be resolved before it can be |
a8f2fc4 to
8309654
Compare
|
I dont know if this PR got closed automatically after the merge of my first one. I am trying to reopen it but i seem not to be able to. @andyluo7 please feel free to reopen the pr or create a new one with the same diff if the changes here are still relevant. |
[ROCm] Optimize HY V4 graph inference on gfx942 and gfx950
Purpose
This PR remains stacked on #54405 (and therefore #54404). This update adds four
targeted changes to the HY V4 ROCm graph-mode serving path:
them;
empty graph-padded rows.
Unsupported AITER sink layouts are now rejected during construction instead of
on the first request. The shared NVIDIA attention path retains the same eager
gate expression through a small subclass hook.
Platform isolation
configuration and HY V4's measured hidden/expert/top-k shape.
BF16 CUDA tensors with the measured width; all other inputs use the existing
eager expression.
attn_out * torch.sigmoid(gate_score).branch in this update is the AITER sink compatibility check that rejects the
unsupported gfx942 BF16 64-head bucket.
Exact candidate and runtime
53abd3cac3e06993a8afae86b3246fa27d0ab1b193b4fced3bf3dfaf67cf9d5f6217240189ba67f1bf8b13d562587b6b5a4437f4822985d74e6d350091afffedaf1c1440a0638657b33a8fa5bc83e646f67dfe4c23ec3bec8395c3de4e8ecca0ff0678f409ec0a13a22a8a03367f53d095a541b79d25a469a48d77aeda75d2c99beaa43acea7430bd1875bc16df989dd514620ed24575f8e2fdc6e0a6838f391563be69c003fdc67sha256:03f385c0cdc48a0031aba05e1d3d7b6fa0b51a6744f9b69e6c8cd7cd4de4b49bsha256:40e19c756e3dc9ffc9117770904d40376c7d3bf529cc76ddc379cde7ac4dae2d6711d26262846e35aad24d1540985c3b9aceea51dbde3dfe36eba72ce4fc023b,83aaee20d27b06931a18f639ba0aadcea268e2262077ffc53dcb2b055abea9e1,and
d719add875735eefb97258888a92393a48bf0d5bcdcaf6dd89bab6bb09928214.sha256:8908b8ab5ba28c3b81f9f42bb72e2421f06a180e001c67c4f10ff7f127c5690bf8500b8543949ec5c856a9395956fb49279482110.2.4, wheel SHA-2563ba78e6c1cec37c99b83d71a34c1ed50f1058231bcab1a352a1b431082fb2c4f1f05eadfb3654b7d4adb059f069fe1d0de7d4ce24d9e8cb3e1b6f23699b925344215ec29de873a998e849cee902654490c7ff4d167e9046d913470477dfb321814d4e3240240a397cfc19c6c610af02dd2cb6456sgl-evalrevision:a231b7a439b235090ff7baa30778fa2b514309aeValidation
Static and exact-tree correctness:
221 passed, 2 skipped; source/runtime postflight,external-user, kernel-error, and clean teardown checks passed. Artifact
manifest SHA-256:
b435d4213b0a0d8baef5b34cf271271a7e9f325eca20de473855bd30ec506514.210 passed, 13 skipped; source/runtime postflight,external-user, kernel-error, and clean teardown checks passed. Artifact
manifest SHA-256:
abae83e91b3304206906c2f37dae0fb6105856728457761a5b62c5beac88f381.Authoritative MI350X TP8/C1 performance used three fresh-process repeats per
arm, exactly 128 input and 256 output tokens per request, and a maximum allowed
within-arm spread of
0.250 ms:The candidate is
1.382483 ms/6.785971%below the adjacent-controlaverage (
20.372663 ms), below both controls, and0.672820 msbelow the19.663 msacceptance target. r180 was rejected rather than averaged becauseits
56.644377 msspread exceeded the stability limit. The sealed post-hocvalidator summary has SHA-256
71398c1c1a74d19e847648cc37434c002800678225172f6effec411aeddbd19b.The post-hoc step was needed because the wrapper hit an
awknewline-formattingerror only after r183 had sealed; the validator rechecked every immutable arm
artifact rather than rerunning or altering the measurements.
The sink-only precursor experiment was neutral to slightly slower, so the sink
kernel is retained for graph-replay correctness and is not presented as an
independent latency win.
Authoritative MI350X full GSM8K and route validation (r186) passed:
zero request errors, zero empty generations, and zero missing grades;
1,232/1,319 = 93.4041%symbolic accuracy;1,203/1,227 = 98.0440%normal-stop accuracy;tokens/s; and
200before and after evaluation, all nine optimized-route checks,empty runtime/kernel-fault scans, source postflight, and the full 300-second
exclusive-idle teardown passed.
The pinned workload used TP8, native MTP with three speculative tokens,
full/piecewise graphs, AITER sparse MLA and MXFP8 MoE, explicit fused shared
experts, disabled prefix caching, all 1,319 examples, four request threads,
temperature 0.9, top-p 1.0, and seed 0. The r186 artifact manifest SHA-256 is
c3ba616f12615bc34a55d60d941f77dbe0c9133ddf7c8b53aaae2b86a2d3e284.Supplementary MI355X r173 completed 1,319/1,319 unique requests with zero
request errors, 93.9348% accuracy (
1,239/1,319), 78 length truncations, and407.3702 output tokens/s. Its artifact manifest SHA-256 is
7c75b7c2624127c12ed796229d38b541eee683b327fd0f938dec9a1ad16da284.This confirms a second gfx950 execution lane but is not used for the MI350X
performance acceptance claim.
Test plan
pre-commit run --files \ $(git diff --name-only 4be7ce114bc8fcf5a7ff8175b57f80d3db5418a4..HEAD) .venv/bin/python -m pytest -q -p no:cacheprovider \ tests/compile/passes/test_fuse_mla_dual_rms_norm.py \ tests/kernels/attention/test_rocm_aiter_mla_sink.py \ tests/kernels/attention/test_rocm_aiter_mla_sparse_metadata_sync.py \ tests/kernels/moe/test_mxfp8_aiter_backend_selection.py \ tests/kernels/moe/test_rocm_aiter_moe.py \ tests/kernels/moe/test_rocm_aiter_topk.py \ tests/kernels/test_minimax_m3_amd_ops.py \ tests/model_executor/layers/test_fused_shared_expert.py \ tests/models/test_hy_v4_rocm.py \ tests/test_config.py::test_rocm_hyv4_defaults_to_mrv2_and_breakable_cudagraph \ tests/v1/attention/test_indexer_native_next_n.pyThe hardware suites also cover the surrounding ROCm AITER MoE, sparse-MLA,
MTP, graph-replay, fused-shared-expert, and model-loading paths rather than only
the newly added unit tests.
Related work and stack
initial HY V4 ROCm enablement and is this PR's immediate base.
this stack must be coordinated before merge rather than landed twice.
graph/MTP integration and native-gfx950 behavior around that route.
adjacent rather than duplicative; this update's new kernels and routing
changes are ROCm-specific.
and [ROCm] [Perf] Optimize rocm aiter sparse mla indexer #46172 remain open changes around ROCm sparse MLA or its lower-level
kernels. Their independent fixes must be preserved through landing order or
a later rebase.
#54594 is based on #54405 at
29c7fa2027700f0bbbb26fae07868f308d26780b. #54404 has independently advancedto
1059697b5316c6de3afe3cde3c8c70613e94fbaf; this update does not rewrite theother contributor's parent branch. Any parent refresh or conflict resolution
changes the effective tree and invalidates this source-dependent validation.
AI assistance
AI assistance was used to investigate, implement, test, and prepare this
change. Before commit and publication, the human submitter reviewed every
changed line in tree
93b4fced3bf3dfaf67cf9d5f6217240189ba67f1,confirmed end-to-end understanding, and explicitly approved the DCO signoff.
Commit
53abd3cac3e06993a8afae86b3246fa27d0ab1b1records both the humanSigned-off-bytrailer and the CodexCo-authored-bytrailer.