We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproduction instructions:
Save this reproducer to repro.mlir:
repro.mlir
module { func.func @intfail() -> !torch.int { %0 = torch.vtensor.literal(dense<-9223372036854775807> : tensor<1xsi64>) : !torch.vtensor<[1],si64> %1 = torch.aten.item %0 : !torch.vtensor<[1],si64> -> !torch.int return %1 : !torch.int } }
run
torch-mlir-opt repro.mlir --canonicalize -o repro2.mlir
repro2.mlir should contain
repro2.mlir
module { func.func @intfail() -> !torch.int { %int-9223372036854775807 = torch.constant.int -9223372036854775807 return %int-9223372036854775807 : !torch.int } }
If you try
torch-mlir-opt repro2.mlir --convert-torch-to-arith
It returns
repro2.mlir:3:51: error: custom op 'torch.constant.int' integer value too large %int-9223372036854775807 = torch.constant.int -9223372036854775807
However, running from the original repro.mlir:
torch-mlir-opt repro.mlir --canonicalize --convert-torch-to-arith
generates valid IR:
module { func.func @intfail() -> !torch.int { %c-9223372036854775807_i64 = arith.constant -9223372036854775807 : i64 %0 = torch_c.from_i64 %c-9223372036854775807_i64 return %0 : !torch.int } }
It seems like an error with parsing the constant int op? I'm not sure what is going on here.
The text was updated successfully, but these errors were encountered:
if you --print-ir-after-all do you get repro2 as an intermediate?
repro2
Sorry, something went wrong.
Yeah:
// -----// IR Dump Before Canonicalizer (canonicalize) //----- // module { func.func @intfail() -> !torch.int { %0 = torch.vtensor.literal(dense<-9223372036854775807> : tensor<1xsi64>) : !torch.vtensor<[1],si64> %1 = torch.aten.item %0 : !torch.vtensor<[1],si64> -> !torch.int return %1 : !torch.int } } // -----// IR Dump Before ConvertTorchToArith (convert-torch-to-arith) //----- // func.func @intfail() -> !torch.int { %int-9223372036854775807 = torch.constant.int -9223372036854775807 return %int-9223372036854775807 : !torch.int } module { func.func @intfail() -> !torch.int { %c-9223372036854775807_i64 = arith.constant -9223372036854775807 : i64 %0 = torch_c.from_i64 %c-9223372036854775807_i64 return %0 : !torch.int } }
No branches or pull requests
Reproduction instructions:
Save this reproducer to
repro.mlir
:run
repro2.mlir
should containIf you try
It returns
repro2.mlir:3:51: error: custom op 'torch.constant.int' integer value too large %int-9223372036854775807 = torch.constant.int -9223372036854775807
However, running from the original
repro.mlir
:generates valid IR:
It seems like an error with parsing the constant int op? I'm not sure what is going on here.
The text was updated successfully, but these errors were encountered: