Skip to content

[hipblaslt] Fix Float4/Float6/BFloat6 elementBytes assertion and totalAllocatedBytes (AIHPBLAS-3570) - #7672

Merged
bnemanich merged 3 commits into
developfrom
users/bnemanich/fix-fp4-elementbytes-assertion
May 23, 2026
Merged

[hipblaslt] Fix Float4/Float6/BFloat6 elementBytes assertion and totalAllocatedBytes (AIHPBLAS-3570)#7672
bnemanich merged 3 commits into
developfrom
users/bnemanich/fix-fp4-elementbytes-assertion

Conversation

@bnemanich

@bnemanich bnemanich commented May 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

PR #6499 (gfx950 mxfp4) changed BaseTypeInfo::ElementSize from sizeof(T)
to sizeof(T) / Packing, so info.elementSize is now the per-element
segment size in bytes (0.5 for Float4, 0.75 for Float6/BFloat6). Two
sites in TensorDescriptor.hpp were not updated to match: elementBytes()
still hard-asserted m_dataType was none of {Float4,Float6,BFloat6} and
carried a stale comment claiming elementSize was the unsegmented
container size, and totalAllocatedBytes() divided by info.packing a
second time on top of multiplyElementSize, returning N/4 bytes for N
Float4 elements instead of the correct N/2.

Drop the obsolete assertion and the obsolete /packing, replace the
misleading comment with one that reflects post-PR-6499 semantics, and
keep totalAllocatedBytes safe by asserting the element count is a whole
number of packed containers. Add a TensorDescriptor_test.cpp covering
Float (control), Half, Float8, Float4, Float6, and BFloat6 in
tensilelite-tests, including an explicit Debug-mode regression check
that elementBytes() does not abort on the packed MX types and that
totalAllocatedBytes() is not double-divided. Non-packed types are

Addresses AIHPBLAS-3570.

Test Plan

Tested on debug build to make sure everything passed.

Submission Checklist

bnemanich and others added 2 commits May 20, 2026 21:26
…lAllocatedBytes

PR #6499 (gfx950 mxfp4) changed BaseTypeInfo::ElementSize from sizeof(T)
to sizeof(T) / Packing, so info.elementSize is now the per-element
segment size in bytes (0.5 for Float4, 0.75 for Float6/BFloat6). Two
sites in TensorDescriptor.hpp were not updated to match: elementBytes()
still hard-asserted m_dataType was none of {Float4,Float6,BFloat6} and
carried a stale comment claiming elementSize was the unsegmented
container size, and totalAllocatedBytes() divided by info.packing a
second time on top of multiplyElementSize, returning N/4 bytes for N
Float4 elements instead of the correct N/2.

Drop the obsolete assertion and the obsolete /packing, replace the
misleading comment with one that reflects post-PR-6499 semantics, and
keep totalAllocatedBytes safe by asserting the element count is a whole
number of packed containers. Add a TensorDescriptor_test.cpp covering
Float (control), Half, Float8, Float4, Float6, and BFloat6 in
tensilelite-tests, including an explicit Debug-mode regression check
that elementBytes() does not abort on the packed MX types and that
totalAllocatedBytes() is not double-divided. Non-packed types are
unchanged because their packing == 1.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match the style used by MXScalePadding_test.cpp and MXDataGen_test.cpp.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bnemanich
bnemanich requested a review from talumbau May 21, 2026 13:23
@bnemanich bnemanich changed the title [hipblaslt] Fix Float4/Float6/BFloat6 elementBytes assertion and totalAllocatedBytes [hipblaslt] Fix Float4/Float6/BFloat6 elementBytes assertion and totalAllocatedBytes (AIHPBLAS-3570) May 21, 2026

@talumbau talumbau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks for the quick fix!

@codecov-commenter

codecov-commenter commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (77.83%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7672      +/-   ##
===========================================
- Coverage    61.76%   61.73%   -0.03%     
===========================================
  Files         2082     2083       +1     
  Lines       356042   356515     +473     
  Branches     53628    53752     +124     
===========================================
+ Hits        219883   220067     +184     
- Misses      117417   117697     +280     
- Partials     18742    18751       +9     
Flag Coverage Δ *Carryforward flag
TensileLite 26.23% <ø> (+0.11%) ⬆️
hipBLAS 90.65% <ø> (ø) Carriedforward from d5bf18f
hipBLASLt 41.24% <ø> (ø)
hipCUB 82.21% <ø> (ø) Carriedforward from d5bf18f
hipDNN 85.61% <ø> (ø) Carriedforward from d5bf18f
hipFFT 51.12% <ø> (ø) Carriedforward from d5bf18f
hipRAND 76.12% <ø> (ø) Carriedforward from d5bf18f
hipSOLVER 69.24% <ø> (ø) Carriedforward from d5bf18f
hipSPARSE 85.09% <ø> (ø) Carriedforward from d5bf18f
rocBLAS 48.11% <ø> (ø) Carriedforward from d5bf18f
rocFFT 51.26% <ø> (ø) Carriedforward from d5bf18f
rocRAND 57.04% <ø> (ø) Carriedforward from d5bf18f
rocSOLVER 77.83% <ø> (ø) Carriedforward from d5bf18f
rocSPARSE 72.68% <ø> (ø) Carriedforward from d5bf18f

*This pull request uses carry forward flags. Click here to find out more.
see 6 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.

@bnemanich
bnemanich enabled auto-merge (squash) May 22, 2026 12:13
@bnemanich
bnemanich disabled auto-merge May 23, 2026 14:43
@bnemanich
bnemanich merged commit 3426216 into develop May 23, 2026
76 of 79 checks passed
@bnemanich
bnemanich deleted the users/bnemanich/fix-fp4-elementbytes-assertion branch May 23, 2026 14:43
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