tpp-mlir icon indicating copy to clipboard operation
tpp-mlir copied to clipboard

Next steps on target descriptor

Open rengolin opened this issue 8 months ago • 2 comments

We have recently merged the target descriptor support in MLIR, and a number of comments were made that were left for follow up PRs.

Below is a list (feel free to add more if I missed anything), in order of what should be done first:

  • [x] use strings everywhere and not have to hard-code integer/float types (signed, etc). llvm/llvm-project/pull/96706
  • [x] Move from specific attributes (ex. L1_cache_size) to string representations like datalayout. Example: cache_hierarchy = 120kb:2mb:30mb; which would just give the whole hierarchy and may be different depending on the target. llvm/llvm-project/pull/101561
  • [x] design the hierarchy of the attributes: module/function/op, multiple/single+lookup, use symbol table/attributes llvm/llvm-project/pull/104595
  • [ ] design a reasonable optional infrastructure where getting a property that is empty or doesn't exist need to fail gracefully.
  • [ ] Design a generic target that is just a pImpl, then passes/transforms use optional + default values (user defined?).
  • [ ] design a hook into LLVM's TTI object, via some target-triple + device + extension strings.
  • [ ] design a hook into reading configuration files (ex. LLVM's Json reader) for custom targets by name.
  • [ ] define the API for adding DLTI information from source (command line options, front-end driver, etc).
  • [ ] design a multi-target hierarchy (ex. CPU+GPU) of descriptors and how to annotate them from other ops.
  • [ ] design a composition of multiple sources for the same target (ex. TLI + Json + cmd-line) that overrides options.

These would make cost models easier and easier, but don't need to finish before we start looking into cost-models.

@rolfmorel

rengolin avatar Jun 21 '24 16:06 rengolin