Hi~ I want to lower the generated linalg dialect mlir from torch-mlir frontend to affine loop representation. However, after running the input command mlir-opt --convert-linalg-to-affine compiled_torch2.2.mlir the output file remains unchanged. I suspect that I might be missing some options.
given that unfamiliar with linalg to affine pipeline, I would appreciate that If someone could point out critical transformation path Preformatted text ![]()
Below code snippet illustrate the input matrix multiplication
import torch
import torch_mlir
class MatMulModule(torch.nn.Module):
def forward(self, a, b):
return torch.matmul(a, b)
input_a = torch.ones(3, 3)
input_b = torch.ones(3, 3) * 2
compiled = torch_mlir.compile(MatMulModule(), (input_a, input_b), output_type=torch_mlir.OutputType.LINALG_ON_TENSORS)
with open("compiled_torch_test", "w") as f:
f.write(str(compiled))
print(compiled)