jiangqucheng / torch-mlir-hwacc

Torch-MLIR to HWACC
Other
0 stars 0 forks source link

`linalg` to `hwacc` pass for torch-mlir backend #3

Open jiangqucheng opened 10 months ago

jiangqucheng commented 10 months ago
  1. generate the pass structure.
  2. register structure to Dialect/Linalg/Passes.td
  3. recognize in torch-mlir python backend (linalg_on_tensors_backends/refbackend.py).
jiangqucheng commented 10 months ago

Design changes

I created another ref backend called RefBackendHwaccLinalgOnTensorsBackend which integrated the Hwacc lib call into the original LinalgOnTensors backend. Therefore, end users won't need to add other steps other than changing the imported package.

Check detail in commit a0542a2 .

Original solution

from torch_mlir_e2e_test.linalg_on_tensors_backends import refbackend

Now

from torch_mlir_e2e_test.hwacc_linalg_on_tensors_backends import refbackend