onnx-mlir: Error in loading ConstantOp

Here is the error I mentioned at the meeting. I run onnx-mlir --EmitONNXBasic my_model.onnx' and then onnx-mlir --EmitONNXIR my_model.onnx.mlir`. I got error message

error: unknown attribute `dense_disposable` in dialect `ONNX`

This error occurs only on one model, which can not be shared publicly. The constant in my_model.onnx.mlir looks like this

%0 = "onnx.Constant"() {value = #onnx.dense_disposable<#1:"0x000000000000000000000000000000000000000000000000"> : tensor<3xi64>} : () -> tensor<3xi64>

The constant is not printed as dense format, while the constant of other model (output of --EmitONNXBasic) is in dense format and can be loaded back to onnx-mlir. Can you figure out the reason without the model?

By the way, I’d like to explain the question I asked at meeting. We can import a model from .onnx file and the constant is represented with the disposable attribute for performance. The disposable attribute is converted to dense attribute before onnx to KRNL conversion. However, we may print out the IR, and then run onnx-mlir again. To my understanding, the constant will be print as dense, not the disposable. Right? Can we print out the disposible attribute? When onnx-mlir load the print out of dense attribute again, do we need add a pass to convert the dense Attribute to disposable? Or has it been done automatically?

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

this issue should be fixed with PR #2020

please reopen if you see more problems