From 46af2a0a466113e99b931a261f80ec9886fd8710 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sat, 19 Sep 2026 16:35:22 +0200 Subject: [PATCH] Stop naming an optimisation level: on tract it means into_optimized, which aborts on yolo26n-seg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ONNX Runtime's default is already its fullest level. ort-tract maps any level but disabled to tract's optimiser, whose slice pass divides by zero inside the segmenter's graph — a panic across the C API and so an abort, which is what stopped dr-ui's develop test. The app never asked tract for that and does not start now. --- core/dr-inference-engine/src/session.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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).