Padding for vectorization - is there support in MLIR, yet?

Atm there are 3 abstractions I know of:

  1. vector.transfer_read has “on-the-fly” padding and masking semantics. Depending on your HW it may or may not be a good idea to “just use that”. In many cases you want to additionally amortize this padding.
  2. Linalg on buffers has promotion which inserts padding, vectorizes to vector.transfer ops and has some primitive dependence analysis patterns to bypass roundtrips to memory and try to amortize padding. This is not the preferred path.
  3. Linalg on tensors has tiling + padding + hoisting of padding (i.e. packing) that is in active development (see post for more general context). This mentions:

I am sure a bunch of things are also being developed on top of affine but I haven’t seen them in-tree yet.

1 Like