Repository navigation
[LLVMCPU] vlen attribute for DataTiledMMAAttr for RISCV + FP16 port - #24858
Merged
Merged
Conversation
egebeysel
force-pushed
the
rvv-vlen-dt-mma-attr
branch
2 times, most recently
from
August 27, 2026 14:10
193d26c to
58467f8
Compare
For RISC-V, the vector length per SIMD register is not fixed and is configurable. Therefore, the tile shape of an intrinsic and the total SIMD register bit budget is also parameterized by the vector length. In order for all of these vector length configurations to share a single intrinsic and not duplicate it per-configurable-vlen, we add a `vlen` parameter to the `DataTiledMMAAttr`, which in combination with the intrinsic itself gives the exact shape information, as well as the register budget. These are derived from the `+zvl*b` flags. Signed-off-by: Ege Beysel <[email protected]>
egebeysel
force-pushed
the
rvv-vlen-dt-mma-attr
branch
from
August 31, 2026 13:54
58467f8 to
76846ad
Compare
Materializes data-tiled f16 matmul encodings to `iree_codegen.inner_tiled` on RISC-V V targets with Zvfh, as the first consumer of the `vlen` attribute parameter. One enum pair covers every vector length. `MMA_RISCV_V_VFMACC_1x8VLsx1_F16_F16` and its M<->N-swapped sibling describe a 1x8VLsx1 tile where `8VLs` describes 8 * vscale, and `s` stands for static. This results in one vfmacc.vf instruction with LMUL=2 register group at 16-bit elements, matching mmt4d. Lowering to LLVM intrinsics is not included. Signed-off-by: Ege Beysel <[email protected]>
egebeysel
force-pushed
the
rvv-vlen-dt-mma-attr
branch
from
August 31, 2026 14:06
76846ad to
f1c2d6c
Compare
egebeysel
marked this pull request as ready for review
August 31, 2026 14:06
egebeysel
requested review from
MaheshRavishankar,
Max191,
hanhanW,
jtuyls and
qedawkins
as code owners
August 31, 2026 14:06
Contributor
Author
|
cc @TMahlatini |
AlexDenisov
approved these changes
Sep 11, 2026
devtbi
pushed a commit
that referenced
this pull request
Oct 21, 2026
…tiled MMA. (#25000) Lowers the RISC-V V f16 `inner_tiled` MMA paths. Native f16 enums are already on main from #24858. This adds lowering, the widening `vfwmacc.vf` pair, and the `+zvfhmin`-only fallbacks. All of them reuse `lowerRiscvVFmaccLike` and the hoisted accumulator legalization from #24933. Tile N is `vlen/8`. | Encoding | `+zvfh` | `+zvfhmin` only | | --- | --- | --- | | f16×f16→f16 | `llvm.riscv.vfmacc` (`MMA_RISCV_V_VFMACC_*_F16_F16`) | `extf` the accumulator to f32, f32 `vfmacc`, `truncf` back (`*_F16_F16_WIDENF32`) | | f16×f16→f32 | `llvm.riscv.vfwmacc` (`MMA_RISCV_V_VFWMACC_*_F32_F16`) | `extf` both panels, then f32 `vfmacc` (`*_F32_F16_CASTF32`) | `+zvfh` implies `+zvfhmin`. When both are legal, the earlier enum wins: native `vfmacc` for an f16 accumulator, `vfwmacc` for an f32 accumulator. At VLEN=256 the cost model picks `intrinsics_m` 14 (native), 7 (`vfwmacc`), and 6 (both `+zvfhmin` paths). CASTF32 and WIDENF32 bill the widened f32 vector operand as f32. Performance is tracked on #24932. On the X60 (VLEN=256), 1-thread inner_tiled is faster than the mmt4d ukernel for native f16 and `vfwmacc`. The 4-thread and 8-thread large shapes are still slower. Native f16 is non-widening `vfmacc`; the f16 ukernel widens with `vfwmacc`, so that ratio is not the same instruction sequence. `vfwmacc` is the closer comparison. Assisted-by: Cursor Towards #24311 --------- Signed-off-by: Terence <[email protected]> Co-authored-by: Cursor <[email protected]>
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.
For RISC-V, the vector length per SIMD register is not fixed and is configurable. Therefore, the tile shape of an intrinsic and the total SIMD register bit budget is also parameterized by the vector length. In order for all of these vector length configurations to share a single intrinsic and not duplicate it per-configurable-vlen, we add a
vlenparameter to theDataTiledMMAAttr, which in combination with the intrinsic itself gives the exact shape information, as well as the register budget. These are derived from the+zvl*bflags.Furthermore, add materialization for data-tiled f16 matmul encodings to
iree_codegen.inner_tiledon RISC-V V targets with Zvfh, as the first consumer of thevlenattribute parameter. Lowering to LLVM intrinsics is not included.Towards #24311
Assisted-by: Claude Code