Skip to content

feat(hipdnn): Add ragged offset multiplier to tensor attributes - #12190

Open
jerehartAMD wants to merge 3 commits into
developfrom
users/jerehart/ragged-offset-multiplier
Open

jerehartAMD wants to merge 3 commits into
developfrom
users/jerehart/ragged-offset-multiplier

Conversation

@jerehartAMD

Copy link
Copy Markdown
Contributor

Summary

Adds a per-tensor ragged_offset_multiplier (default 1). It rescales a stored ragged offset to element units
(element_offset = stored_offset * multiplier), so a token-unit cumulative-seqlen
tensor (AITER's native format, multiplier = H*D) can be bound directly as the ragged
offset with no conversion pass. Default 1 preserves today's element-unit behavior for
every existing graph.

JIRA ID : ALMIOPEN-2626

Risk Assessment

Level 2. Additive, API surface with a schema/version-gated default that
preserves existing behavior byte-for-byte. No provider or kernel code is touched
(dnn-providers/** untouched); the change is confined to hipDNN's frontend, backend,
data_sdk, flatbuffers_sdk, and plugin_sdk. A new engine-plugin API floor (1.4.0) is
introduced but only applies to graphs that opt in to a non-default multiplier.

ASIC Coverage

Arch-independent (no GPU kernel or provider dispatch change). Standard PR CI is
sufficient; no multi-arch sweep required.

Testing Summary

  • Frontend: setter/getter/has_ragged_offset_multiplier(), validation (>= 1, requires
    a ragged offset), gated lowering (only sent to the backend when non-default).
  • data_sdk: RaggedTensor/ShallowRaggedTensor multiplier scaling of addressing,
    sizing, and iteration; per-tensor multipliers sharing one offset aux (Q/O D mismatch
    case); rejects multiplier < 1.
  • flatbuffers_sdk: JSON round-trip of the new field, including default-on-omission.
  • Backend: C API set/get round-trip; plugin-applicability filter excludes pre-1.4.0
    plugins for a multiplier graph and includes capable ones.
  • plugin_sdk: version-constant ordering/parsing (1.4.0 dominates ragged's 1.3.0).
  • Integration: full build→serialize→deserialize round trip stamps 1.4.0 for a
    non-default multiplier and the baseline for the default; deserialize ceiling
    (K_MAX_SUPPORTED_API_VERSION) updated and re-verified.

Testing Checklist

All tests pass

Technical Changes

  • New C API attribute HIPDNN_ATTR_TENSOR_RAGGED_OFFSET_MULTIPLIER (1311), wired through
    TensorDescriptor get/set and BackendEnumStringUtils.
  • tensor_attributes.fbs: ragged_offset_multiplier: long = 1 (participates in the
    cache key); regenerated tensor_attributes_generated.h / cachekey_generated.h; JSON
    serialization updated.
  • Frontend TensorAttributes: set/get/has_ragged_offset_multiplier(), validation, and
    gated lowering in DescriptorHelpers (only sent when non-default, for pre-1.4.0
    backend compatibility).
  • RaggedOffsetMultiplier version gate: K_RAGGED_OFFSET_MULTIPLIER_MIN_VERSION = 1.4.0
    (new ceiling), GraphDescriptor::hasRaggedOffsetMultiplier(), and a new bool argument
    threaded through both computeMinimumEnginePluginApiVersion call sites.
  • utilities::RaggedTensor/ShallowRaggedTensor: new raggedOffsetMultiplier parameter
    (default 1); readElementOffset() centralizes the stored * multiplier scaling used
    by addressing, sizing, and iteration.

@jerehartAMD
jerehartAMD requested a review from a team as a code owner September 16, 2026 16:25
@therock-pr-bot

therock-pr-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR 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.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.90722% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ects/hipdnn/backend/src/BackendEnumStringUtils.hpp 0.00% 1 Missing and 1 partial ⚠️
...clude/hipdnn_frontend/detail/DescriptorHelpers.hpp 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12190      +/-   ##
===========================================
- Coverage    70.55%   70.31%   -0.24%     
===========================================
  Files         2812     2812              
  Lines       463054   462931     -123     
  Branches     68187    68147      -40     
===========================================
- Hits        326694   325499    -1195     
- Misses      112708   113879    +1171     
+ Partials     23652    23553      -99     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 46.40% <ø> (ø) Carriedforward from de6272e
TensileLite-Unit 76.10% <ø> (ø) Carriedforward from de6272e
hipBLAS 90.62% <ø> (ø) Carriedforward from de6272e
hipBLASLt 35.24% <ø> (ø) Carriedforward from de6272e
hipCUB 82.68% <ø> (ø) Carriedforward from de6272e
hipDNN 87.03% <96.91%> (+0.02%) ⬆️
hipFFT 42.70% <ø> (-0.55%) ⬇️ Carriedforward from de6272e
hipRAND 76.12% <ø> (ø) Carriedforward from de6272e
hipSOLVER 68.92% <ø> (-0.04%) ⬇️ Carriedforward from de6272e
hipSPARSE 86.99% <ø> (ø) Carriedforward from de6272e
rocBLAS 48.31% <ø> (ø) Carriedforward from de6272e
rocFFT 48.25% <ø> (-3.34%) ⬇️ Carriedforward from de6272e
rocRAND 57.42% <ø> (ø) Carriedforward from de6272e
rocSOLVER 76.83% <ø> (ø) Carriedforward from de6272e
rocSPARSE 74.61% <ø> (ø) Carriedforward from de6272e
rocThrust 91.60% <ø> (ø) Carriedforward from de6272e

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...hipdnn/backend/src/descriptors/GraphDescriptor.cpp 95.29% <100.00%> (+0.15%) ⬆️
...ipdnn/backend/src/descriptors/TensorDescriptor.cpp 88.50% <100.00%> (+0.39%) ⬆️
...backend/src/plugin/EnginePluginResourceManager.cpp 85.37% <100.00%> (+0.11%) ⬆️
...include/hipdnn_data_sdk/utilities/RaggedTensor.hpp 94.95% <100.00%> (+0.27%) ⬆️
.../hipdnn_data_sdk/utilities/ShallowRaggedTensor.hpp 100.00% <100.00%> (ø)
...latbuffers_sdk/utilities/json/TensorAttributes.hpp 57.59% <100.00%> (+1.10%) ⬆️
...de/hipdnn_frontend/attributes/TensorAttributes.hpp 95.29% <100.00%> (+0.31%) ⬆️
...clude/hipdnn_plugin_sdk/PluginVersionConstants.hpp 100.00% <100.00%> (ø)
...clude/hipdnn_frontend/detail/DescriptorHelpers.hpp 89.00% <87.50%> (-0.06%) ⬇️
...ects/hipdnn/backend/src/BackendEnumStringUtils.hpp 97.88% <0.00%> (-0.17%) ⬇️

... and 58 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant