When lowering some KernelBench programs (level1: 12, 96, 99), I get this error:
error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
Reproducer:
- Clone Lighthouse
- Init
uv as in README
- Run:
$ uv run examples/end-to-end/KernelBench/test_kernel_bench.py --test level1/12_
Error message:
loc("/home/rengolin/devel/llvm/lighthouse/third_party/KernelBench/KernelBench/level1/12_Matmul_with_diagonal_matrices_.py":23:0): error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
ERROR: got an error converting /home/rengolin/devel/llvm/lighthouse/third_party/KernelBench/KernelBench/level1/12_Matmul_with_diagonal_matrices_.py to MLIR:
...
stack trace
...
torch_mlir.compiler_utils.TorchMlirCompilerError: Lowering TorchFX IR -> Torch Backend IR failed with the following diagnostics:
python exception: Failure while executing pass pipeline
For Torch-MLIR developers, the error can be reproduced with:
$ torch-mlir-opt -pass-pipeline='builtin.module(func.func(torch-match-quantized-custom-ops), torchdynamo-export-to-torch-backend-pipeline{ extra-library=})' /tmp/UnnammedModule.mlir
Add '-mlir-print-ir-after-all -mlir-disable-threading' to get the IR dump for debugging purpose.
Kernel 12, Line 23 is:
return torch.diag(A) @ B
Kernel 96, line 15 is:
return torch.nn.functional.smooth_l1_loss(predictions, targets)
Kernel 99, line 16 is:
return self.loss_fn(anchor, positive, negative)
When lowering some KernelBench programs (level1: 12, 96, 99), I get this error:
error: failed to legalize operation 'torch.operator' that was explicitly marked illegalReproducer:
uvas in README$ uv run examples/end-to-end/KernelBench/test_kernel_bench.py --test level1/12_Error message:
Kernel 12, Line 23 is:
return torch.diag(A) @ BKernel 96, line 15 is:
return torch.nn.functional.smooth_l1_loss(predictions, targets)Kernel 99, line 16 is:
return self.loss_fn(anchor, positive, negative)