[Mlir-commits] [mlir] Reimplementing target description concept using DLTI attribute (PR #92138)
Niranjan Hasabnis
llvmlistbot at llvm.org
Sun Jun 2 22:22:09 PDT 2024
nhasabni wrote:
Thanks @fabianmcg for your thoughts. See my answers below.
> 1. How do you suggest we model devices of devices (clusters) and so on?
> With the current setup its not entirely evident to me how to model them (maybe I got something wrong in the implementation).
This PR does not discuss the representation of devices. It is meant to get the boiler plate infra support that we envision will be enhanced further. That being said, we did briefly talk about the hierarchical representation of devices (similar to https://discourse.llvm.org/t/representing-device-data/2078/4). Also, [our RFC](https://discourse.llvm.org/t/rfc-target-description-and-cost-model-in-mlir/76990) shades some light on this point.
> 2. Why is the device ID mandatory?
> I get its usefulness, for example, describing a system down to its NUMA topology. However, not all system descriptions will care about that, and in those instances it might be highly inconvenient having it mandatory, as systems with the same devices but with different device ids are not equal. I would consider making it optional.
It is mandatory currently because the passes (or other users) can identify a particular device using a device ID in order to query its properties. This is because we envision a single instance of system description (as against a device specific description) for the duration of execution.
> 3. Do we want to have methods like `getSpecForL1CacheSizeInBytes` hardcoded in the attribute/interface?
> If we have L1, why not L2, l3? I would argue those queries belong to the entries of the spec and not in the attribute.
Yes, we would certainly need similar APIs for L2, L3, etc. The point of this PR is not to list all of the possible APIs, but to agree upon the infra to extend it further as needed. Not sure I understand fully what you mean by "queries belong to entries of spec". How would the property query API look like? We were modeling the current API similar to existing API in DLTI dialect.
> 4. Shouldn't systems have entries as well? Or let me rephrase it, how would you model the amount of shared HBM in a system, is it a device?
Yes, this is currently missing. I am working on updating the system description to contain entries as well.
https://github.com/llvm/llvm-project/pull/92138
More information about the Mlir-commits
mailing list