[Mlir-commits] [mlir] Reimplementing target description concept using DLTI attribute (PR #92138)

Renato Golin llvmlistbot at llvm.org
Wed May 29 02:23:33 PDT 2024


rengolin wrote:

> Do you have a follow-up prototype working that would demonstrate how to use this logic in practice?

We had a commit that was using it in the packing pass but removed upon request to keep this PR short.

We have the original [RFC](https://discourse.llvm.org/t/rfc-target-description-and-cost-model-in-mlir/76990), where we discuss the prototypes and ideas. However, after numerous discussions at EuroLLVM and later, we quickly realised that the "cost model" part is really diverse and pre-existing.

Therefore, the focus here is just to describe targets in a reasonable way that any pass can just grab the data and use it internally (as exposed by examples here and the commit that we moved into the next stage). By getting the infrastructure here simple enough, we can start using elsewhere into existing cost models.

So for now this should be used directly, as is, by passes and transforms and third-party cost models. We'll likely change some of the design, this is why we don't have a full pipeline of PRs in the works. It would be a waste of time for all of us. Once we consolidate this implementation, we'll reopen the _upstream_ cost model discussion once again.

> And how it integrates with Linalg's logic?

This has **nothing** to do with Linalg directly. 

Linalg is a dialect that implements linear algebra interfaces, which expose tensor logic to the compiler. Target descriptions just carry information about the hardware and the system. Cost models use that information (plus the state of the IR, and with it, Linalg) to derive answers to common questions. Transforms, rewrites, passes are the ones asking questions, and they are the ones doing anything to Linalg.

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


More information about the Mlir-commits mailing list