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

fix: warn on mismatched lib version instead of panic #47

Merged
merged 1 commit into from
Apr 30, 2023
Merged

fix: warn on mismatched lib version instead of panic #47

merged 1 commit into from
Apr 30, 2023

Conversation

jackos
Copy link
Contributor

@jackos jackos commented Apr 30, 2023

Great lib thanks, for local development on an M1 mac (aarch64) to speed things up I need to build from the master branch of libonnxruntime (1.15.0) as I get errors trying to build 1.14.1. This all works fine if I get rid of the panic below, across ~10 models I get the same results through coreml as I do on the CPU.

For your consideration below to change to a warning instead of panic, so we can package a later version of libonnxruntime if it's working.

@codecov-commenter
Copy link

Codecov Report

Merging #47 (e6b3f97) into main (40a7b85) will increase coverage by 0.57%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main      #47       /-   ##
==========================================
  Coverage   48.08%   48.66%    0.57%     
==========================================
  Files          19       19              
  Lines        1046     1046              
==========================================
  Hits          503      509        6     
  Misses        543      537       -6     
Impacted Files Coverage Δ
src/lib.rs 42.01% <100.00%> ( 3.55%) ⬆️

@decahedron1
Copy link
Member

I'm not sure about going through tracing for this, though. On Windows, It's really common for DLL loading to pick up an onnxruntime DLL in System32 that is many versions behind. If a user doesn't have tracing_subscriber set up (which is required to receive tracing messages), they wouldn't get any indication of failure other than cargo's obscure message of process didn't exit successfully: ... (exit code: 0xc000007b)

Thoughts about panicking if the minor version is lower, but tracing::warning if it's higher? Something like

    let minor_version = version_string.split('.').nth(1).map(|x| x.parse::<u32>().unwrap_or(0)).unwrap_or(0);
    if minor_version < 14 {
        panic!("ort 1.14 is not compatible...");
    } else if minor_version > 14 {
        warn!("ort 1.14 may have compatibility issues...");
    }

@jackos
Copy link
Contributor Author

jackos commented Apr 30, 2023

That would be fantastic thanks, see updated code

@decahedron1 decahedron1 merged commit 13c69ca into pykeio:main Apr 30, 2023
@mush42
Copy link

mush42 commented May 28, 2023

@sudo-carson any plans to support onnxruntime v1.15?

@decahedron1
Copy link
Member

@sudo-carson any plans to support onnxruntime v1.15?

Very soon, yes.

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

Successfully merging this pull request may close these issues.

4 participants