Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/mlas-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1450,8 +1450,10 @@ impl QgemmPackedB {

impl Drop for QgemmPackedB {
fn drop(&mut self) {
QGEMM_PACKED_LIVE_BYTES
.fetch_sub(self.owned_heap_bytes(), std::sync::atomic::Ordering::Relaxed);
QGEMM_PACKED_LIVE_BYTES.fetch_sub(
self.owned_heap_bytes(),
std::sync::atomic::Ordering::Relaxed,
);
// SAFETY: `ptr`/`layout` are the pair returned by `alloc_zeroed` in
// `new` and this runs at most once.
unsafe { std::alloc::dealloc(self.ptr, self.layout) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ mod tests {
// Four buffers fit; the fifth would exceed the process cap.
let budget = GovernedAccumulatorBudget::new(1000, 4000);
for expected in 1..=4 {
assert!(budget.try_park(1000), "buffer {expected} fits under the sum");
assert!(
budget.try_park(1000),
"buffer {expected} fits under the sum"
);
assert_eq!(budget.live_bytes(), expected * 1000);
}
assert!(
Expand Down
9 changes: 4 additions & 5 deletions crates/onnx-runtime-ep-cpu/src/kernels/qlinear_matmul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,9 @@ mod tests {
// buffers so the reset below opens a clean window; the *upper*-bound
// assertion holds regardless, being enforced inside `try_park`.
static SERIALISE: Mutex<()> = Mutex::new(());
let _guard = SERIALISE.lock().unwrap_or_else(|poison| poison.into_inner());
let _guard = SERIALISE
.lock()
.unwrap_or_else(|poison| poison.into_inner());

// `m * n` just under the 32 MiB per-thread cap so a full buffer is
// admitted (a buffer *over* the cap is released -- tested separately),
Expand Down Expand Up @@ -1761,10 +1763,7 @@ mod tests {
pool.broadcast(|_| {
let mut output = Owned::zeros(DataType::Uint8, &[m, n]);
kernel
.execute(
&inputs.map(|input| input.view()),
&mut [output.view_mut()],
)
.execute(&inputs.map(|input| input.view()), &mut [output.view_mut()])
.expect("kernel runs");
});

Expand Down
1 change: 0 additions & 1 deletion crates/onnx-runtime-ep-cpu/src/kernels/simd_activations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4915,4 +4915,3 @@ mod three_arm_bench {
}
}
}

Loading