Torch-mlir fails with the following error when running the test case below:
error: failed to legalize operation 'torch.operator' that was explicitly marked illegal: %5 = "torch.operator"(%3, %4, %0, %2, %2, %2) <{name = "torch.aten.empty_permuted"}> : (!torch.list, !torch.list, !torch.int, !torch.none, !torch.none, !torch.none) -> !torch.vtensor<[4],si64>
Context: Appears in MoE routing / argsort paths. Allocates an uninitialized tensor with a logical size but stored in a chosen physical_layout dimension order.
Command to reproduce:
torch-mlir-opt -pass-pipeline='builtin.module(func.func(torch-match-quantized-custom-ops), torchdynamo-export-to-torch-backend-pipeline{extra-library=})' test_empty_permuted.mlir
test_empty_permuted.mlir:
module {
func.func @forward() -> !torch.vtensor<[4],si64> {
%int4 = torch.constant.int 4
%int0 = torch.constant.int 0
%none = torch.constant.none
%0 = torch.prim.ListConstruct %int4 : (!torch.int) -> !torch.list<int>
%1 = torch.prim.ListConstruct %int0 : (!torch.int) -> !torch.list<int>
%2 = torch.constant.int 4
%3 = "torch.operator"(%0, %1, %2, %none, %none, %none) <{name = "torch.aten.empty_permuted"}> : (!torch.list<int>, !torch.list<int>, !torch.int, !torch.none, !torch.none, !torch.none) -> !torch.vtensor<[4],si64>
return %3 : !torch.vtensor<[4],si64>
}
Torch-mlir fails with the following error when running the test case below:
error: failed to legalize operation 'torch.operator' that was explicitly marked illegal: %5 = "torch.operator"(%3, %4, %0, %2, %2, %2) <{name = "torch.aten.empty_permuted"}> : (!torch.list, !torch.list, !torch.int, !torch.none, !torch.none, !torch.none) -> !torch.vtensor<[4],si64>
Context: Appears in MoE routing / argsort paths. Allocates an uninitialized tensor with a logical size but stored in a chosen physical_layout dimension order.
Command to reproduce:
torch-mlir-opt -pass-pipeline='builtin.module(func.func(torch-match-quantized-custom-ops), torchdynamo-export-to-torch-backend-pipeline{extra-library=})' test_empty_permuted.mlir
test_empty_permuted.mlir: