Skip to content

Update ndarray optional dependency to most recent version - #484

Merged
decahedron1 merged 1 commit into
pykeio:mainfrom
michael-p:main
Nov 5, 2025
Merged

decahedron1 merged 1 commit into
pykeio:mainfrom
michael-p:main

Conversation

@michael-p

Copy link
Copy Markdown
Contributor

No description provided.

@michael-p michael-p changed the title Update ndarray optional dependency to most recent version [WIP] Update ndarray optional dependency to most recent version Nov 5, 2025
@michael-p michael-p changed the title [WIP] Update ndarray optional dependency to most recent version Update ndarray optional dependency to most recent version Nov 5, 2025
@michael-p

Copy link
Copy Markdown
Contributor Author

Tests on Mac OS still fail on this PR but I'm not sure that is even related to the changes made here, as it seems to be some sort of linker issue, and for me locally (I'm on mac as well) the tests fail even on the main branch, so not sure...

@decahedron1
decahedron1 merged commit 716f34f into pykeio:main Nov 5, 2025
@decahedron1

Copy link
Copy Markdown
Member

Re-ran the macOS job and it was successful, so it seems to have been a (very weird!) fluke. @michael-p would you be able to test locally again to confirm?

@michael-p

michael-p commented Nov 5, 2025 •

Copy link
Copy Markdown
Contributor Author

Re-ran the macOS job and it was successful, so it seems to have been a (very weird!) fluke. @michael-p would you be able to test locally again to confirm?

I'm still getting the same failures on main but I guess this is an issue on my side. I didn't do any kind of setup, just clone the repo and ran cargo t --all-features, 4 tests pass, 27 failed with messages similar to this:

---- value::tests::test_sequence_map stdout ----

thread 'value::tests::test_sequence_map' (273435) panicked at src/lib.rs:154:10:
attempted to use `ort` APIs before initializing a backend
when the `alternative-backend` feature is enabled, `ort::set_api` must be called to configure the `OrtApi` used by the library
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library/std/src/panicking.rs:698:5
   1: core::panicking::panic_fmt
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library/core/src/panicking.rs:75:14
   2: core::panicking::panic_display
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library/core/src/panicking.rs:259:5
   3: core::option::expect_failed
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library/core/src/option.rs:2178:5
   4: core::option::Option<T>::expect
             at /Users/michaelp/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:965:21
   5: ort::api
             at ./src/lib.rs:154:4
   6: ort::value::impl_tensor::create::<impl ort::value::Value<ort::value::impl_tensor::TensorValueType<alloc::string::String>>>::from_string_array
             at ./src/lib.rs:270:45
   7: ort::value::impl_map::<impl ort::value::Value<ort::value::impl_map::MapValueType<alloc::string::String,V>>>::new
             at ./src/value/impl_map.rs:241:16
   8: ort::value::tests::test_sequence_map
             at ./src/value/mod.rs:508:30
   9: ort::value::tests::test_sequence_map::{{closure}}
             at ./src/value/mod.rs:506:28
  10: core::ops::function::FnOnce::call_once
             at /Users/michaelp/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  11: core::ops::function::FnOnce::call_once
             at /rustc/f8297e351a40c1439a467bbbb6879088047f50b3/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

EDIT I also tried just cargo test (maybe there are some conflicting features?) but then the crate does not compile:

error[E0599]: no method named `commit_from_url` found for struct `SessionBuilder` in the current scope
  --> tests/mnist.rs:20:4
   |
17 |       let mut session = Session::builder()?
   |  _______________________-
18 | |         .with_optimization_level(GraphOptimizationLevel::Level1)?
19 | |         .with_intra_threads(1)?
20 | |         .commit_from_url("https://cdn.pyke.io/0/pyke:ort-rs/[email protected]/mnist.onnx")
   | |_________-^^^^^^^^^^^^^^^
   |
help: there is a method `commit_from_file` with a similar name
   |
20 -         .commit_from_url("https://cdn.pyke.io/0/pyke:ort-rs/[email protected]/mnist.onnx")
20 +         .commit_from_file("https://cdn.pyke.io/0/pyke:ort-rs/[email protected]/mnist.onnx")
   |

error[E0599]: no method named `commit_from_url` found for struct `SessionBuilder` in the current scope
  --> tests/squeezenet.rs:25:4
   |
22 |       let mut session = Session::builder()?
   |  _______________________-
23 | |         .with_optimization_level(GraphOptimizationLevel::Level1)?
24 | |         .with_intra_threads(1)?
25 | |         .commit_from_url("https://cdn.pyke.io/0/pyke:ort-rs/[email protected]/squeezenet.onnx")
   | |_________-^^^^^^^^^^^^^^^
   |
help: there is a method `commit_from_file` with a similar name
   |
25 -         .commit_from_url("https://cdn.pyke.io/0/pyke:ort-rs/[email protected]/squeezenet.onnx")
25 +         .commit_from_file("https://cdn.pyke.io/0/pyke:ort-rs/[email protected]/squeezenet.onnx")
   |

Again, I assume it's me doing something wrong, so probably not worth spending more of your time on this:) I can however confirm that the current main branch (with ndarray 0.17) works fine in our larger application.

@decahedron1

Copy link
Copy Markdown
Member

Ah yeah - --all-features enables alternative-backend which disables linking to ONNX Runtime. You should only run tests with --features fetch-models.

@michael-p

Copy link
Copy Markdown
Contributor Author

Ah yeah - --all-features enables alternative-backend which disables linking to ONNX Runtime. You should only run tests with --features fetch-models.

Ok that's it, I was able to get all-green with cargo t --features "fetch-models,tls-rustls" :)
Thanks again for your help, and your work on this crate!

@LockedThread LockedThread mentioned this pull request Nov 14, 2025
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.

2 participants