Repository navigation
perf(rocjitsu): use native SIMD width for f16 and bf16 MFMA - #10898
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. |
Contributor
Author
|
Hi @IanWood1, this is the last PR in the 'easy' matmul speed-ups that I have. It is essentially the same as the one for f32, but for bf16 and f16. Could you take a look please? |
newling
force-pushed
the
perf/rocjitsu-f16-bf16-mfma-native-width
branch
from
August 31, 2026 21:30
af74731 to
9167273
Compare
accauble
approved these changes
Sep 2, 2026
accauble
left a comment
Contributor
There was a problem hiding this comment.
Looks like this got buried by accident? LGTM
newling
force-pushed
the
perf/rocjitsu-f16-bf16-mfma-native-width
branch
from
September 2, 2026 17:19
9167273 to
e457faf
Compare
Contributor
Author
|
Thanks for the review @accauble I've done the 2 function -> 1 function suggestion you made |
newling
force-pushed
the
perf/rocjitsu-f16-bf16-mfma-native-width
branch
from
September 2, 2026 18:18
e457faf to
1f00600
Compare
Contributor
Author
|
Flake: |
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.

rocJITsu has specialized SIMD implementations for f16- and bf16-input MFMA
instructions with f32 accumulation. They snapshot register operands,
bulk-convert the packed inputs, perform the matrix multiplication in host SIMD
chunks, and publish staged results without per-element register access or
heap-backed result staging.
These implementations previously required
native_simd<float>to have exactly16 lanes. This enabled the fast paths in an AVX-512-targeted build, but portable
and AVX2-targeted builds fell back to generic implementations even when host
SIMD was available.
This change gives the f32-, f16-, and bf16-input f32-accumulating MFMA
specializations one shared, constexpr support predicate. The f16 and bf16
paths now use the SIMD width selected by the compiler, provided the MFMA column
count divides evenly into that width. Builds without usable SIMD, incompatible
shapes, non-wave64 execution, operand permutations, and executions with
RJ_FORCE_SCALAR=1continue to use the existing generic paths. Theregister-observation behavior used by execution plugins is preserved.
No rocJITsu-specific build option or environment variable is required to
enable the path.
std::experimental::native_simdselects the width at compiletime from the compiler target. A portable x86-64 build may use four f32 lanes,
an AVX2-targeted build commonly uses eight, and an AVX-512-targeted build
commonly uses sixteen. CPU capability alone does not widen an already-compiled
binary.
fp8/bf8 MFMA, integer MFMA, and low-precision WMMA are intentionally out of
scope. CDNA3 fp8/bf8 uses FNUZ variants that need additional exact-test support,
generated i8 MFMA handlers currently use a different generic execution path,
and WMMA is a separate wave32 family with packed-output semantics.
This complements the recently merged matrix-execution improvements:
Performance
Performance was measured against exact parent
79f87b823on an AMD EPYC 9575Fhost. Both revisions used AMD Clang 22,
Release,-O3 -DNDEBUG, and noexplicit
-march, AVX2, or AVX-512 flag. This portable build uses four-lanenative_simd<float>.The gfx950 workload ran one simulator thread and pinned the process tree to one
logical CPU:
Both binaries were warmed before four measured pairs, which alternated
execution order.
The complete-process median improves by 1.36x, and hipBLASLt's reported
GEMM interval improves by 1.43x.
A two-pair bf16 1024x1024x1024 check improved complete-process wall time from
18.79 to 14.49 seconds and the reported GEMM interval from 17.08 to 12.72
seconds, or 1.30x and 1.34x, respectively.
Representative CDNA4 microbenchmarks compare the generic normal-SIMD path used
by the parent with the newly enabled specialized path:
A separate throughput-plugin pair executed identical work in both revisions:
eight dispatches, 6,169,103 wave instructions, and 131,072 matrix
instructions.
The throughput plugin adds observer overhead, so these values are compared only
within the matched plugin-enabled pair.
Validation
unrelated 16-lane-only i8 case skipped.
implementation bit for bit, including destructive accumulator overlap on
the four-lane path.
hipblaslt-bench --verifyruns completedwith
norm_error=0.Issue Tracking
Related: #10852