Skip to content

Conversation

Sameeranjoshi
Copy link
Contributor

Patch adds tests to make sure all the tests with vector.multi_reduction generate successfully pass Peano legalizer and generate efficient vectorized code. This patch checks only the IREE side to keep the dependency minimun on Peano. (Depends on Peano:

  1. Legalizer support for vectors in G_FPEXT Xilinx/llvm-aie#548

  2. Handle Vector types in G_FADD using G_FPEXT Xilinx/llvm-aie#557 )

  3. reassociateFpReductions=true is must else code is scalarized. This flag could be added into the IREE vectorization pipeline to trigger automatically.

  4. bf16/i32/f32 all types with different sizes work now.

Patch adds tests to make sure all the tests with `vector.multi_reduction`
generate successfully pass Peano legalizer and generate efficient vectorized code.
This patch checks only the IREE side to keep the dependency minimun on Peano.
(Depends on Peano:
1. Xilinx/llvm-aie#548
2. Xilinx/llvm-aie#557
)

1. `reassociateFpReductions=true` is must else code is scalarized. This flag
could be added into the IREE vectorization pipeline to trigger automatically.
2. bf16/i32/f32 all types with different sizes work now.
@Sameeranjoshi
Copy link
Contributor Author

Summary:

1D/2D – Powers of 2

types/shapes (powers of 2) 16 32 64 Notes
← Powers of 2 Columns
i32
bf16 (reassoc=true) 2× reduction in # lines in assembly ( ~1500 to ~750)
f32 (reassoc=true) Approx 25% shorter assembly

Sameeranjoshi added a commit to Sameeranjoshi/llvm-aie that referenced this pull request Jul 22, 2025
…d code.

This patch is dependent on Xilinx#548 and Xilinx#557. Previously bf16 and f32 failed to
generate fully vectorized code and used to scalarize, this test makes sures
different types and vector sizes work and are fully vectorized.

This is a supplementary patch for verifying below pipeline:
Part 1: `vector.multi_reduction` to `vector.reduction` to `llvm.vector.reduce.fadd.*`
nod-ai/iree-amd-aie#1336
Part 2: Further lowers to AIE2P instructions.(This patch)
Copy link
Contributor

@newling newling left a comment

Choose a reason for hiding this comment

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

These tests are nice, but I think we should see what our compiler flow is once we've done the unrolling of transfer_reads.

Ideally we'd be able to have FileCheck commands for the generated assembly, to verify that the legalization changes are working as expected too. But that'd presumably add a dependency on peano which we don't want in our lit testing

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.

2 participants