[Mlir-commits] [mlir] [MLIR][Linalg] Introduce linalg.contract (PR #123618)
Renato Golin
llvmlistbot at llvm.org
Mon Jan 27 15:12:38 PST 2025
rengolin wrote:
> Thanks for this round of comments, @banach-space ! I hope I have addressed all of the them now.
>
> > What about the scaling factor that is sometimes used for the accumulator matrix in GEMM implementations? Sorry if this was mentioned somewhere!
>
> I don't think anybody brought it up before! If I am not mistaken though it suffers from the same issue as truncation (though in reverse): because we are dealing with a contraction, the op's associated body will run multiple times. How should we denote - in terms of the perfect loop nests correspondence for "structured ops" - that only on the first run of the body we should apply the scaling to C's elements? Phrased alternatively: what `linalg.generic`-form did you have in mind?
If by "scaling factor" you mean Micro-Scaling (https://arxiv.org/pdf/2310.10537), then this will be added later across all linalg ops, or possibly as a separate type dialect (https://github.com/libxsmm/tpp-mlir/wiki/Microscaling-Data-Formats-in-MLIR). I'm not sure yet how this will work.
Currently, IIUC, MXFP implementations just separate the scaling from the matmul ops and tile them with a custom algorithm.
https://github.com/llvm/llvm-project/pull/123618
More information about the Mlir-commits
mailing list