You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/x/work/kneron_mlir/torch_example/attention/attention.py", line 37, in <module>
module = torch_mlir.compile(model, (query, key, value), output_type=torch_mlir.OutputType.STABLEHLO)
File "/home/x/work/kneron_mlir/torch-build/python_packages/torch_mlir/torch_mlir/__init__.py", line 451, in compile
run_pipeline_with_repro_report(
File "/home/x/work/kneron_mlir/torch-build/python_packages/torch_mlir/torch_mlir/compiler_utils.py", line 69, in run_pipeline_with_repro_report
raise TorchMlirCompilerError(trimmed_message) from None
torch_mlir.compiler_utils.TorchMlirCompilerError: Lowering TorchScript IR -> Torch Backend IR failed with the following diagnostics:
python exception: Failure while executing pass pipeline:
error: unknown: unsupported by backend contract: module initializers
note: unknown: see current operation: "torch.initialize.global_slots"(%6, %7, %8, %9) <{slotSymNames = [@attention.in_proj_weight, @attention.in_proj_bias, @attention.out_proj.weight, @attention.out_proj.bias]}> : (!torch.tensor<[192,64],f32>, !torch.tensor<[192],f32>, !torch.tensor<[64,64],f32>, !torch.tensor<[64],f32>) -> ()
note: unknown: this is likely due to InlineGlobalSlots being unable to inline a global slot
If use_tracing=True, It can convert model to stable IR. module = torch_mlir.compile(model, (query, key, value), output_type=torch_mlir.OutputType.STABLEHLO,use_tracing=True)
The text was updated successfully, but these errors were encountered:
heshuju
changed the title
error: unknown: unsupported by backend contract: module initializers
attention model failed to convert, "error: unknown: unsupported by backend contract: module initializers"
Dec 11, 2024
attention model can't convert to stablehlo IR.
Qustion:
How can I solve this problem.
python script:
If use_tracing=True, It can convert model to stable IR.
module = torch_mlir.compile(model, (query, key, value), output_type=torch_mlir.OutputType.STABLEHLO,use_tracing=True)
The text was updated successfully, but these errors were encountered: