Skip to content

bench: fix 4-bit byte accounting in benchmark metrics - #15

Open
Pritiks23 wants to merge 1 commit into
amd:devfrom
Pritiks23:bench-fix-u4s4-byte-accounting
Open

bench: fix 4-bit byte accounting in benchmark metrics#15
Pritiks23 wants to merge 1 commit into
amd:devfrom
Pritiks23:bench-fix-u4s4-byte-accounting

Conversation

@Pritiks23

Copy link
Copy Markdown
Contributor

u4/s4 benchmark metrics are now accounted as 0.5 bytes per element, and related benchmark utility tests were updated accordingly.

Signed-off-by: Pritika Vipin <65793273+Pritiks23@users.noreply.github.com>

@Pritiks23 Pritiks23 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the benchmark metric logic so 4-bit matrix types are counted correctly in memory calculations.

What changed:

  1. In the benchmark metrics code, u4 and s4 are now treated as 0.5 bytes per element instead of 1 byte per element.
  2. The type-size helper now returns a floating-point value so it can represent half-byte element sizes.
  3. Benchmark utility tests were updated to match the new behavior (u4/s4 expected value changed from 1.0 to 0.5).

Why this change was needed:

  1. The previous logic overestimated memory traffic for 4-bit data by 2x.
  2. That made bandwidth and matrix-size metrics inaccurate for low-bit GEMM benchmarks.
  3. With this fix, reported benchmark metrics better reflect actual packed 4-bit storage, so performance analysis is more trustworthy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant