Repository navigation
[Codegen][CPU] Add x86 AVX-512 VNNI vpdpbusd MMA intrinsic. - #24494
Merged
Merged
Conversation
25 of 28 tasks
bjacob
force-pushed
the
users/bjacob/e2e-matmul-distinct-lhs-rhs-types
branch
from
May 15, 2026 14:04
87920d9 to
04c4b79
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-vpdpbusd
branch
from
May 15, 2026 14:04
d877a4b to
41d1eb5
Compare
bjacob
force-pushed
the
users/bjacob/e2e-matmul-distinct-lhs-rhs-types
branch
from
May 15, 2026 15:54
04c4b79 to
4c6b5a9
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-vpdpbusd
branch
from
May 15, 2026 15:54
41d1eb5 to
75c3ec0
Compare
bjacob
force-pushed
the
users/bjacob/e2e-matmul-distinct-lhs-rhs-types
branch
from
May 15, 2026 16:02
4c6b5a9 to
d17ea2f
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-vpdpbusd
branch
from
May 15, 2026 16:02
75c3ec0 to
e850560
Compare
bjacob
force-pushed
the
users/bjacob/e2e-matmul-distinct-lhs-rhs-types
branch
from
May 15, 2026 17:06
d17ea2f to
ba02c9a
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-vpdpbusd
branch
from
May 15, 2026 17:06
e850560 to
ac57449
Compare
…ework. The framework so far only generated symmetric-type matmuls (LHS and RHS of the same type via `--lhs_rhs_type`). This generalizes it to support `--lhs` and `--rhs` separately so we can test asymmetric-type intrinsics like the upcoming x86 AVX-512 VNNI vpdpbusd (LHS=ui8, RHS=i8 → ACC=i32). - `generate_e2e_matmul_tests.py`: replace `--lhs_rhs_type` with the per-operand `--lhs` / `--rhs` pair (legacy form still accepted; the CLI requires exactly one form). Adds a `ui8` choice. Plumbing for separate `lhs_type`/`rhs_type` is threaded through `generate()` / `generate_function()` / `generate_call()`. - `generate_code.py`: emit a `linalg.generic` (with `arith.extui` / `arith.extsi` widening) when LHS != RHS or an operand is unsigned; buffer-view printing uses the `ui8` HAL element type for unsigned operands. - `iree-e2e-matmul-test.cc`: new `REFERENCE_MATMUL(uint8_t, int8_t, int32_t, int32_t)` reference and matching dispatch arm for `IREE_HAL_ELEMENT_TYPE_UINT_8` LHS / signed-i8 RHS. New test `e2e_matmul_cpu_dt_inner_tiled_ui8_i8_i32` exercises the generated ui8/i8 matmul through the data-tiling + inner-tiled pipeline. No matching hardware MMA intrinsic exists yet (this commit is purely framework), so it only runs on the `generic` CPU variant and falls through to the type-polymorphic generic-scalar MMA. A follow-up PR adds the vpdpbusd MMA and an `avx512vnni` variant. Progress towards #24323. Signed-off-by: Benoit Jacob <[email protected]>
Adds `vpdpbusd` — the AVX-512-VNNI byte dot-product — as a data-tiled MMA intrinsic. It is the first asymmetric MMA: the first byte source is unsigned, the second is signed, so the natural and swapped orientations need different arg-routing at the call site (unlike the LHS/RHS-symmetric FMA / dpbf16ps / vpdpwssd / pmaddw already supported). Two new enum values, `MMA_X86_AVX512VNNI_1x16x4_I32_UI8_I8` and its M↔N-swapped sibling `MMA_X86_AVX512VNNI_16x1x4_I32_I8_UI8`, both lower to `llvm.x86.avx512.vpdpbusd.512`. The swapped lowering flips its (lhs, rhs) call args so the unsigned operand still lands in the first slot. Signedness handling — per IREE convention, vector tile types in IR are signless, with the signed/unsigned distinction carried on the encoding's `element_types`. `getABCElementTypes(intrinsic)` now returns `ui8` where applicable, used by the cost model and validator for matching against an encoding's `element_types`; `getUndistributedTileTypes` strips the signedness when constructing tile types. The validator and cost-model `getIntrinsicInfo` bypass `getUndistributedTileTypes` and read shape + types straight from the intrinsic via `getRowMajorTilesMNKShape` and `getABCElementTypes`, which become public for that reason. The prerequisite "distinct LHS/RHS types" PR added the `e2e_matmul_cpu_dt_inner_tiled_ui8_i8_i32` test on the `generic` variant only; this commit adds the `avx512vnni` variant that actually selects the new intrinsic. Progress towards #24323. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Benoit Jacob <[email protected]>
bjacob
force-pushed
the
users/bjacob/e2e-matmul-distinct-lhs-rhs-types
branch
from
May 15, 2026 19:41
ba02c9a to
0f31820
Compare
bjacob
force-pushed
the
users/bjacob/cpu-inner-tiled-vpdpbusd
branch
from
May 15, 2026 19:41
ac57449 to
5773d5c
Compare
bjacob
marked this pull request as ready for review
May 15, 2026 20:02
hanhanW
approved these changes
May 18, 2026
bjacob
changed the base branch from
users/bjacob/e2e-matmul-distinct-lhs-rhs-types
to
main
May 19, 2026 15:38
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
…#24494) Adds `vpdpbusd` — the AVX-512-VNNI byte dot-product — as a data-tiled MMA intrinsic. It is the first asymmetric MMA: the first byte source is unsigned, the second is signed, so the natural and swapped orientations need different arg-routing at the call site (unlike the LHS/RHS-symmetric FMA / dpbf16ps / vpdpwssd / pmaddw already supported). Two new enum values, `MMA_X86_AVX512VNNI_1x16x4_I32_UI8_I8` and its M↔N-swapped sibling `MMA_X86_AVX512VNNI_16x1x4_I32_I8_UI8`, both lower to `llvm.x86.avx512.vpdpbusd.512`. The swapped lowering flips its (lhs, rhs) call args so the unsigned operand still lands in the first slot. Signedness handling — per IREE convention, vector tile types in IR are signless, with the signed/unsigned distinction carried on the encoding's `element_types`. `getABCElementTypes(intrinsic)` now returns `ui8` where applicable, used by the cost model and validator for matching against an encoding's `element_types`; `getUndistributedTileTypes` strips the signedness when constructing tile types. The validator and cost-model `getIntrinsicInfo` bypass `getUndistributedTileTypes` and read shape + types straight from the intrinsic via `getRowMajorTilesMNKShape` and `getABCElementTypes`, which become public for that reason. The prerequisite "distinct LHS/RHS types" PR added the `e2e_matmul_cpu_dt_inner_tiled_ui8_i8_i32` test on the `generic` variant only; this commit adds the `avx512vnni` variant that actually selects the new intrinsic. Progress towards iree-org#24323. --------- Signed-off-by: Benoit Jacob <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
2 tasks
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.
Adds
vpdpbusd— the AVX-512-VNNI byte dot-product — as a data-tiled MMA intrinsic. It is the first asymmetric MMA: the first byte source is unsigned, the second is signed, so the natural and swapped orientations need different arg-routing at the call site (unlike the LHS/RHS-symmetric FMA / dpbf16ps / vpdpwssd / pmaddw already supported).Two new enum values,
MMA_X86_AVX512VNNI_1x16x4_I32_UI8_I8and its M↔N-swapped siblingMMA_X86_AVX512VNNI_16x1x4_I32_I8_UI8, both lower tollvm.x86.avx512.vpdpbusd.512. The swapped lowering flips its (lhs, rhs) call args so the unsigned operand still lands in the first slot.Signedness handling — per IREE convention, vector tile types in IR are signless, with the signed/unsigned distinction carried on the encoding's
element_types.getABCElementTypes(intrinsic)now returnsui8where applicable, used by the cost model and validator for matching against an encoding'selement_types;getUndistributedTileTypesstrips the signedness when constructing tile types. The validator and cost-modelgetIntrinsicInfobypassgetUndistributedTileTypesand read shape + types straight from the intrinsic viagetRowMajorTilesMNKShapeandgetABCElementTypes, which become public for that reason.The prerequisite "distinct LHS/RHS types" PR added the
e2e_matmul_cpu_dt_inner_tiled_ui8_i8_i32test on thegenericvariant only; this commit adds theavx512vnnivariant that actually selects the new intrinsic.Progress towards #24323.