ml: scheduled barriers only in debug builds (NaN in Supertonic)
- Commit
a9c0659ef7463fff1f1dcda9e34f32e37462b612- Author
- vayun-mathur <[email protected]>
- When
- 2026-10-26 00:13 UTC (1 month ago)
- Parents
78e20b5
Diff
library/ml/src/main/rust/src/vulkan/run_part2.rs
diff --git a/library/ml/src/main/rust/src/vulkan/run_part2.rs b/library/ml/src/main/rust/src/vulkan/run_part2.rsindex f0f20a3c30..85109c0fd8 100644--- a/library/ml/src/main/rust/src/vulkan/run_part2.rs+++ b/library/ml/src/main/rust/src/vulkan/run_part2.rs@@ -64,9 +64,10 @@ impl Net { self.barrier(buffer); // `MODELRUNNER_BARRIER=scheduled`: only the barriers `nets::schedule` proves- // necessary, instead of one after every op. Measured behind the knob; the default- // stays a barrier per op unless this is >=5% faster with all parity green.- let scheduled = crate::knobs::get("barrier").as_deref() == Some("scheduled");+ // necessary, instead of one after every op. Debug builds only: it measured no faster+ // and produces NaN in Supertonic's sampler, so a release build must not honour it.+ let scheduled = cfg!(debug_assertions)+ && crate::knobs::get("barrier").as_deref() == Some("scheduled"); let schedule = scheduled.then(|| crate::nets::schedule::schedule(&self.plan)); if let Some(schedule) = &schedule { crate::timing!(