[Mlir-commits] [mlir] [MLIR][Linalg] Scalable Vectorization of Reduction (PR #97788)

Andrzej Warzyński llvmlistbot at llvm.org
Thu Jul 11 07:24:23 PDT 2024


https://github.com/banach-space commented:

Thank you for working on this! 🙏🏻 Overall LG. I've made a few suggestions, but nothing major.

> 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.
  
Please don't forget about this check: https://github.com/llvm/llvm-project/blob/1ed84a862f9ce3c60251968f23a5405f06458975/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L1952-L1953

Also, note:
https://github.com/llvm/llvm-project/blob/1ed84a862f9ce3c60251968f23a5405f06458975/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L1756-L1765

So, it looks like there's at least two hooks to check the preconditions for `linalg.reduce`:
* `vectorizeScalableVectorPrecondition`
* `vectorizeDynamicLinalgOpPrecondition`
* ` vectorizeLinalgOpPrecondition`

Given that we are adding limitations specific to scalable vectors, I think that `vectorizeScalableVectorPrecondition` is the right place for now.

> I have another question: 

Let me try something and I will get back to you tomorrow!

https://github.com/llvm/llvm-project/pull/97788


More information about the Mlir-commits mailing list