Hi, friends.
Does torch-mlir support import binary TorchScript model (*.pt) and convert it to Torch Dialect MLIR directly (not python)?
I have implemented the above feature with python: import .pt file via Python’s torch.jit.load (model)
and convert it to torch dialect MLIR via torch_mlir.compile()
.
Now I want to make a tool with C++, I can use libTorch to import .pt file via torch::jit::load()
, but how to convert it to RAW MLIR? Please help me?
If I can convert the .pt file to RAW MLIR, then I can convert it to other dialect mlir via torch-mlir-opt tool.
As far as I know, torch-mlir-opt tool does not support .pt file, it only supports .mlir files, as follows:
torch-mlir-opt -pass-pipeline='builtin.module(torchscript-module-to-torch-backend-pipeline{backend-legal-ops=torch.aten.flatten.using_ints})' ./raw.mlir >torch.mlir
thanks.