Repository navigation
feat(hipdnn): add ragged tensor SDPA forward sample - #13095
Merged
Merged
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
jerehartAMD
reviewed
Oct 9, 2026
jerehartAMD
reviewed
Oct 9, 2026
jerehartAMD
reviewed
Oct 9, 2026
jerehartAMD
requested changes
Oct 9, 2026
jerehartAMD
left a comment
Contributor
There was a problem hiding this comment.
The layout comment should be addressed, but feel free to take the others as nits
Demonstrate user-side ragged tensor construction for SDPA per RFC 0014 §4.6.1: size-inference and explicit-size RaggedTensor forms, aux sharing across K/V, and rawDeviceData() wiring into the variant pack. Non-ragged tensors (seq_len_q, seq_len_kv) are constructed as today. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…PA sample Address review feedback on the ragged SDPA forward sample: - Use BHSD logical dims [B, H, S_MAX, D] with BSHD physical strides [S_MAX*H*D, D, H*D, 1], and SDPA_SEQ_AXIS for the RaggedTensors. - Express ragged offsets in token units and set ragged_offset_multiplier = H*D on Q, K, V, and O. - Build the offset tables with reserve/push_back. Co-Authored-By: Claude <noreply@anthropic.com>
iq136boy
force-pushed
the
users/dfeng/ragged-sdpa-sample
branch
from
October 9, 2026 22:32
60b42ea to
eb6f04a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #13095 +/- ##
===========================================
- Coverage 75.95% 71.97% -3.99%
===========================================
Files 2880 2885 +5
Lines 479055 478111 -944
Branches 71964 70688 -1276
===========================================
- Hits 363860 344074 -19786
- Misses 90337 110054 +19717
+ Partials 24858 23983 -875
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
jerehartAMD
approved these changes
Oct 15, 2026
Contributor
TheRock Submodule Bump ActivityNewest first
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
samples/sdpa/SdpaRaggedFprop.cpp— end-to-end ragged SDPA forward sample per RFC 0014 §4.6.1hipdnn_sample_sdpa_ragged_fproptarget underHIPDNN_ENABLE_SDPAinsamples/CMakeLists.txtDescription
Demonstrates user-side ragged tensor construction for scaled dot-product attention:
seqAxis=1) — the only ragged-legal layoutRaggedTensorconstruction forms: size-inference (Q, V, O readragged_offset[B]from aux) and explicitphysicalElementCount(K)kvRaggedOffsetaux tensor andkvRaggedAttrgraph attributerawDeviceData()wiring: ragged primaries and aux tensors userawDeviceData()in the variant pack; dense seq_len tensors use.memory().deviceData()(non-ragged, as today)set_padding_mask(true),set_seq_len_q(),set_seq_len_kv()onSdpaAttributes--verify-cpu); ragged CPU reference not yet wiredDimensions:
B=3, S_MAX=5, H=4, D=128, Q seq lens{2,5,3}, KV seq lens{3,5,4},seqStride = H*D = 512.Follows the structure of the existing
SdpaFprop.cppsample closely. Test registration is commented out, matching the existing dense SDPA sample pattern.Test plan
ninja hipdnn_sample_sdpa_ragged_fpropbuilds with zero warnings under-Werror -Wall -Wextra -Wpedantichipdnn_sample_sdpa_fpropstill builds cleanlypre-commitpasses (clang-format, cmake-lint, trailing whitespace, end-of-file)./bin/hipdnn_sample_sdpa_ragged_fprop --dtype fp32on a device with an SDPA engine — expect graph build + execute + first 10 output values (or graceful skip)Tracking
JIRA ID: ALMIOPEN-2128
🤖 Generated with Claude Code