llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[mlir][linalg][promotion] Allow promoting dynamic buffer with dynamic alloc size

Open BZZiv opened this issue 1 year ago • 5 comments

Currently linalg promotion transform attempts to allocate the promoted buffer with the smallest size. It is achieved by computing a constant upper bound for the promoted subviews, and only when the computation fails it fallbacks to dynamic allocation size. It would be nice to have the option to prefer the exact allocation size, even at the price of dynamic allocation.

I'd be happy to add the support myself if there's interest.

BZZiv avatar Jun 15 '25 15:06 BZZiv

@llvm/issue-subscribers-mlir

Author: None (BZZiv)

Currently linalg promotion transform attempts to allocate the promoted buffer with the smallest size. It is achieved by computing a constant upper bound for the promoted subviews, and only when the computation fails it fallbacks to dynamic allocation size. It would be nice to have the option to prefer the exact allocation size, even at the price of dynamic allocation.

I'd be happy to add the support myself if there's interest.

llvmbot avatar Jun 15 '25 15:06 llvmbot

Hi, I am interested in solving this. Can I be assigned?

Ameya674 avatar Jun 19 '25 05:06 Ameya674

Hi, I've already opened https://github.com/llvm/llvm-project/pull/144334 . Apologies for forgetting to comment.

zbenzion avatar Jun 19 '25 06:06 zbenzion

Hey, no Problem!

Ameya674 avatar Jun 19 '25 06:06 Ameya674

@llvm/issue-subscribers-mlir-linalg

Author: None (BZZiv)

Currently linalg promotion transform attempts to allocate the promoted buffer with the smallest size. It is achieved by computing a constant upper bound for the promoted subviews, and only when the computation fails it fallbacks to dynamic allocation size. It would be nice to have the option to prefer the exact allocation size, even at the price of dynamic allocation.

I'd be happy to add the support myself if there's interest.

llvmbot avatar Jul 02 '25 13:07 llvmbot