diff --git a/core/dr-inference-engine/src/session.rs b/core/dr-inference-engine/src/session.rs index 6b70373..ff2cc54 100644 --- a/core/dr-inference-engine/src/session.rs +++ b/core/dr-inference-engine/src/session.rs @@ -1,6 +1,5 @@ //! One session builder per rung (docs/inference.md §2, §7, §9). -use ort::session::builder::GraphOptimizationLevel; use ort::session::Session; use crate::{Config, Role, Rung}; @@ -14,9 +13,12 @@ use crate::{Config, Role, Rung}; /// its clock instead (§4): a provider that hands real work to the CPU is /// slower than the CPU floor and rejected by the same measurement. pub fn build(rung: Rung, role: Role, bytes: &[u8], cfg: &Config) -> ort::Result { - let mut b = Session::builder()? - .with_optimization_level(GraphOptimizationLevel::Level3)? - .with_intra_threads(threads(cfg))?; + // No optimisation level named. ONNX Runtime's default is already its + // fullest, and on tract any level but "disabled" means `into_optimized`, + // whose optimiser divides by zero inside yolo26n-seg (tract-data + // `stack_tensors`) — a panic across the C API, which is an abort. The + // app never asked tract for that and does not start now. + let mut b = Session::builder()?.with_intra_threads(threads(cfg))?; // A Hexagon session loads the compiled context when there is one and // compiles it from the model when there is not; the engine thread is // what makes the second case rare (§6).