Skip to content

feat(rocke): register D256 bf16 decode dispatcher candidate and tune segments - #9462

Merged
bartekxk merged 13 commits into
developfrom
users/barkocot/aick-1496
Jul 20, 2026
Merged

bartekxk merged 13 commits into
developfrom
users/barkocot/aick-1496

Conversation

@bartekxk

Copy link
Copy Markdown
Contributor

D256 bf16 decode dispatcher candidate enablement.

Motivation

Technical Details

  • register D256 bf16 decode dispatcher candidate
  • tune num_segments

Test Plan

run_test.py, wire test

Test Result

Passed.

Submission Checklist

JIRA ID: AICK-1496

@bartekxk bartekxk self-assigned this Jul 15, 2026
@bartekxk
bartekxk requested review from a team as code owners July 15, 2026 16:15
@therock-pr-bot

therock-pr-bot Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
🌿 Branch Name ✅ Pass —
📝 PR Title/Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot

therock-pr-bot Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@bartekxk
bartekxk requested a review from Copilot July 15, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables a new specialized D256 bf16 decode attention dispatcher candidate (targeting gfx950/gfx942) and adjusts unified-attention tuning to improve/validate decode performance, along with accompanying wiring tests and updated benchmark/shape inputs.

Changes:

  • Register a new d256_decode attention candidate in the dispatcher and add a shared cohort predicate for gating eligible decode problems.
  • Tune _num_segments for gfx942 decode so D256 can use the formula-derived segment count (avoiding an overly-low cap).
  • Expand/update parity scenarios and benchmark shape sets/results to include D256 bf16 decode coverage.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
dnn-providers/hip-kernel-provider/rocke/library/tests/dispatch/attention/test_d256_decode_wiring.py Adds unit tests verifying candidate registration, gating, and routing to the new d256_decode path.
dnn-providers/hip-kernel-provider/rocke/library/kernels/common/attention_unified.py Tunes _num_segments for gfx942 decode and introduces _d256_decode_cohort predicate.
dnn-providers/hip-kernel-provider/rocke/library/dispatch/attention.py Registers the new attention_d256_decode candidate and wires selection/spec naming.
dnn-providers/hip-kernel-provider/rocke/library/builders/gfx950/attention/prefill/parity_unified_attention.py Expands gfx950 parity scenarios to include more D256 bf16 decode seq_len pairs.
dnn-providers/hip-kernel-provider/rocke/library/builders/gfx942/attention/prefill/parity_unified_attention.py Reworks gfx942 parity scenario selection to inline scenario generation and adds bf16 D256 decode shapes.
dnn-providers/hip-kernel-provider/rocke/library/benchmarks/gfx950/attention/decode/decode_shapes.json Adds Qwen3-Next-80B-A3B bf16 D256 decode benchmark shapes.
dnn-providers/hip-kernel-provider/rocke/library/benchmarks/gfx942/attention/decode/decode_shapes.json Adds Qwen3-Next-80B-A3B bf16 D256 decode benchmark shapes.
dnn-providers/hip-kernel-provider/rocke/library/benchmarks/gfx942/attention/decode/decode_shapes_perf.csv Updates recorded perf sweep results (including new D256 bf16 entries).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bartekxk bartekxk changed the title feat(rocke): register D256 bf16 decode dispatcher candidate and tune num_segments feat(rocke): register D256 bf16 decode dispatcher candidate and tune segments Jul 15, 2026
bartekxk and others added 6 commits July 16, 2026 00:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bartekxk
bartekxk enabled auto-merge (squash) July 16, 2026 08:14

@AnaghaRaoAMD AnaghaRaoAMD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run parity_unified_attention.py --scenario on the bf16 D256 decode shapes on a real gfx942/gfx950 GPU and post the max_abs numbers — ideally with a larger input magnitude than uniform(-0.1, 0.1) so the absolute tolerance doesn't mask a relative error

@AnaghaRaoAMD AnaghaRaoAMD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow-up: when PR#9496 lands the problem-driven prove_parity, the D256 decode cohort and the num_segments D256 branch should be added to that matrix — and if/when the C++ attention engine goes live, the d256_decode routing + segment logic will need a C++ mirror to stay in lockstep.

@AnaghaRaoAMD AnaghaRaoAMD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nit comments. Overall, LGTM.

@AnaghaRaoAMD
AnaghaRaoAMD disabled auto-merge July 17, 2026 21:16
bartekxk and others added 4 commits July 20, 2026 00:27
…2/attention/prefill/parity_unified_attention.py

Co-authored-by: Anagha Rao <127366241+AnaghaRaoAMD@users.noreply.github.com>
@bartekxk
bartekxk enabled auto-merge (squash) July 20, 2026 09:30
@bartekxk
bartekxk merged commit aebaba8 into develop Jul 20, 2026
33 of 35 checks passed
@bartekxk
bartekxk deleted the users/barkocot/aick-1496 branch July 20, 2026 11:11
AviralGoelAMD added a commit that referenced this pull request Jul 21, 2026
Resolve dispatch/attention.py: keep BOTH D256 candidates — ours
_make_gfx950_d256_candidate (prefill/2D) and develop's #9462
_make_d256_decode_candidate (decode/3D). Disjoint cohorts (2D vs 3D
select_path), so both register and never collide at selection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants