Skip to content
New issue

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

Assertion failure when generating executable binary from ONNX model #2841

Open
Manav361 opened this issue Jun 11, 2024 · 1 comment
Open

Comments

@Manav361
Copy link

Manav361 commented Jun 11, 2024

Assertion failure in mlir::DenseIntOrFPElementsAttr::getRaw when model.onnx.mlir from ONNX model.

I am trying to produce an model.onnx.mlir from an ONNX file for a transformer model,but it returns assertion failure.

Reproduce

A. Prepare the ONNX Model

  1. Ensure you have an appropriate ONNX model ready.
    I am using the PHI3 model as available on hugging face on Model.
  2. Place your ONNX model file (e.g., model.onnx) in the automation/temp directory within the onnx-mlir repository.

B. Convert ONNX model to MLIR

While doing so following cmd gave the error.

onnx-mlir --EmitONNXIR PHI3.onnx 

Errors

The file onnx,model.llvm isn't produced as it threw the following error:-

onnx-mlir: /workdir/llvm-project/mlir/lib/IR/BuiltinAttributes.cpp:1345: static mlir::DenseElementsAttr mlir::DenseIntOrFPElementsAttr::getRaw(mlir::ShapedType, ArrayRef<char>): Assertion `isValid' failed.

I checked the official code of the BuiltinAttributes.cpp and below is the code for the above mentioned error function:-

image

@QingChuanWS
Copy link

Hi, I am also interested in this problem, but I could not reproduce the problem in the phi3-mini-4k-instruct-cpu-int4-rtn-block-32 model, which model could reproduce this problem in the Phi3 model group?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants