[Mlir-commits] [mlir] [MLIR][Linalg] Scalable Vectorization of Reduction (PR #97788)
Zhaoshi Zheng
llvmlistbot at llvm.org
Wed Jul 10 09:57:14 PDT 2024
zhaoshiz wrote:
> @zhaoshiz Apologies for the delay with this - I was travelling last week and still catching up with PRs. If not today, I promise to go over this tomorrow. In the meantime, would you mind fixing the conflict?
No worries @banach-space. By "conflict" do you mean
https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L1950C1-L1952C22?
I tried to change it locally to check that all dims are not scalable:
`
if (llvm::none_of(inputScalableVecDims,
[](bool isScalable) { return isScalable; }))
return success();
`
but broke the the integration test https://github.com/llvm/llvm-project/blob/main/mlir/test/Integration/Dialect/Linalg/CPU/ArmSVE/matmul.mlir.
Essentially we are doing white-list of linalg ops in function `vectorizeScalableVectorPrecondition`, the existing check
` bool isScalable = inputScalableVecDims.back();
if (!isScalable)
return success();` allows vector sizes like [[4],4] or [1, [4], 1] to proceed regardless of the linalg op being vectorized. So to fix it we'll need to verifiy a lot of ops (e.g.: matvec) can be scalably vectorized and add them.
I have another question: a great number of mlir integration tests are written with `-shared-libs=%mlir_runner_utils,%mlir_c_runner_utils` which looks for the shared libs in <build_dir/lib> on the host machine (in my case, x86_64-linux). These tests will fail if config-ed to run in an emulator (qemu-aarch64).
I wrote the tests in this PR with `-shared-libs=%mlir_native_utils_lib_dir/libmlir_runner_utils%shlibext,%mlir_native_utils_lib_dir/libmlir_c_runner_utils%shlibext` so they run successfully in qemu. Can you help run them on a native arm64-linux host with sve support?
https://github.com/llvm/llvm-project/pull/97788
More information about the Mlir-commits
mailing list