tenstorrent / tt-mlir

Tenstorrent MLIR compiler
https://tenstorrent.github.io/tt-mlir/
Apache License 2.0
46 stars 7 forks source link

Load system desc pass #132

Closed nsmithtt closed 1 month ago

nsmithtt commented 1 month ago

Create a load system desc pass for loading system descs from disk into the compiler:

include/ttmlir/Dialect/TTIR/Passes.td:

 def TTIRLoadSystemDesc: Pass<"ttir-load-system-desc", "::mlir::ModuleOp"> {
...
    list<Option> options = [
        Option<"path", "path", "std::string", "", "System desc path">,
    ];
}

The pass itself can be something like:

    if (not path.empty()) {
      // Load the system desc from path
    } else if (not module->hasAttr(tt::SystemDescAttr::name)) {
      module->setAttr(tt::SystemDescAttr::name,
                      tt::SystemDescAttr::getDefault(&getContext()));
    }

This way tests can just run --ttir-load-system-desc with no path argument and get the default system desc, which is just an 8x8 WH system.

tapspatel commented 1 month ago

Part of this issue will be to include default pass for all variables in the Flatbuffer