From 0291b8067260c086e64281c2338234693df91417 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 4 Oct 2026 19:39:16 -0400 Subject: [PATCH] Feed every input in ep_probe The denoiser takes `mosaic` and `sigma`; with only the first fed, every provider reported the same failure and the model went unmeasured. --- core/dr-inference-engine/examples/ep_probe.rs | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/core/dr-inference-engine/examples/ep_probe.rs b/core/dr-inference-engine/examples/ep_probe.rs index bdb0e62..3b60757 100644 --- a/core/dr-inference-engine/examples/ep_probe.rs +++ b/core/dr-inference-engine/examples/ep_probe.rs @@ -181,19 +181,29 @@ fn migraphx( /// Median of `runs` timed runs over zeros, in milliseconds, after warm-ups. fn time(session: &mut ort::session::Session, warmups: usize, runs: usize) -> Result { - let shape: Vec = session.inputs()[0] - .dtype() - .tensor_shape() - .ok_or("input is not a tensor")? - .iter() - .map(|&d| if d > 0 { d as usize } else { 1 }) - .collect(); - let zeros = vec![0f32; shape.iter().product()]; + // Zeros for every input, not just the first: the denoiser takes + // `mosaic` and `sigma`. A dynamic dimension is read as 1. + let mut inputs = Vec::new(); + for input in session.inputs() { + let shape: Vec = input + .dtype() + .tensor_shape() + .ok_or("input is not a tensor")? + .iter() + .map(|&d| if d > 0 { d as usize } else { 1 }) + .collect(); + let zeros = vec![0f32; shape.iter().product()]; + inputs.push((input.name().to_string(), shape, zeros)); + } let once = |s: &mut ort::session::Session| -> Result { - let input = ort::value::Tensor::from_array((shape.clone(), zeros.clone())) - .map_err(|e| e.to_string())?; + let mut values = Vec::with_capacity(inputs.len()); + for (name, shape, zeros) in &inputs { + let value = ort::value::Tensor::from_array((shape.clone(), zeros.clone())) + .map_err(|e| e.to_string())?; + values.push((name.clone(), ort::session::SessionInputValue::from(value))); + } let t = Instant::now(); - let out = s.run(ort::inputs![input]).map_err(|e| e.to_string())?; + let out = s.run(values).map_err(|e| e.to_string())?; let _ = out[0] .try_extract_tensor::() .map_err(|e| e.to_string())?;