Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[midend] Support scalable vector for matmul-transpos-b vectorization #471

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JuniMay
Copy link
Contributor

@JuniMay JuniMay commented Mar 3, 2025

This PR adds scalable vector support to matmul-transpose-b vectorization. vec-size is renamed to vf (as vectorization factor), and scalable option is added to enable scalable vector.

The step is now computed with vscale * vf and a symbol is added into the affine maps.

The performances are just the same compared to static vector method on musepi:

----------------------------------------------------------------------------
Benchmark                                  Time             CPU   Iterations
----------------------------------------------------------------------------
benchMatmulTransposeB/matmul             333 ms          333 ms            2
benchMatmulTransposeB/matmul_opt0        108 ms          108 ms            6
benchMatmulTransposeB/matmul_opt1        109 ms          109 ms            6
------------------------------------------------
MatmulTransposeB-opt0 PASS
MatmulTransposeB-opt1 PASS
------------------------------------------------

where opt0 is static vector with vf=32 and -mllvm --riscv-v-vector-bits-min=256 appended to clang args, and opt1 is scalable with vf=8 (without explicit vlen arguments).

The tail processing is kept the same for now. I will resolve conflicts when it is modified (if there are any).

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