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

Missing ONNX Runtime Contrib Operators? #32

Open
probably-not opened this issue May 22, 2024 · 1 comment
Open

Missing ONNX Runtime Contrib Operators? #32

probably-not opened this issue May 22, 2024 · 1 comment

Comments

@probably-not
Copy link

I'm trying to run the pre-built Phi-3 ONNX Optimized models that are found on HuggingFace here: https://huggingface.co/microsoft/Phi-3-mini-128k-instruct-onnx.

They have pre-built ONNX models that are runnable on CPUs in their repo, but when I try to load it in Ortex, I get the following error:

iex(1)> Ortex.load("phi-3-onnx/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/phi3-mini-128k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx")
** (RuntimeError) Failed to create ONNX Runtime session: Load model from phi-3-onnx/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/phi3-mini-128k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx failed:Fatal error: com.microsoft:MatMulNBits(-1) is not a registered function/op
    (ortex 0.1.9) lib/ortex/model.ex:28: Ortex.Model.load/3
    iex:1: (file)

I do see that this specific operator is listed under the ONNX Runtime Contrib Operators: https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.MatMulNBits.

I'm by no means anywhere close to an expert on these things, so I'm not sure if this is related to building a new Execution Provider (do I need to build the runtime with all of the contrib operators?), or if this is related to the ORT bindings (maybe they need to be updated?).

@mortont
Copy link
Collaborator

mortont commented Nov 19, 2024

We recently merged an update to the ORT bindings (bumped 1.19) in main, feel free to try this again. I'm not sure if that includes the contrib operators, if not you may need to build libonnxruntime.so from source with the ops you're interested in and place it in the path for ortex

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