style: cargo fmt --workspace (whitespace/wrapping only, no semantic change)
Whole-workspace rustfmt pass picked up while iterating on Mamba GPU backward work. Verified formatting-only via diff sampling; no logic changed. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -450,7 +450,10 @@ mod tests {
|
||||
// After 500 steps with momentum 0.999, EMA decays substantially.
|
||||
// 100 * 0.999^500 ≈ 60.6, but then we add 0.001 * 1 each step,
|
||||
// converging toward 1.0. The resulting scale should be << 100/127.
|
||||
assert!(s < 100.0 / 127.0, "EMA scale {s} should be < spike/quant_max");
|
||||
assert!(
|
||||
s < 100.0 / 127.0,
|
||||
"EMA scale {s} should be < spike/quant_max"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -490,7 +493,10 @@ mod tests {
|
||||
let large: Vec<f32> = (-200i32..=200).map(|i| i as f32 * 0.1).collect();
|
||||
let q = c.quantize_int8(&large).unwrap();
|
||||
for &v in &q {
|
||||
assert!(v >= i8::MIN && v <= i8::MAX, "quantized value {v} out of i8 range");
|
||||
assert!(
|
||||
v >= i8::MIN && v <= i8::MAX,
|
||||
"quantized value {v} out of i8 range"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,6 +612,9 @@ mod tests {
|
||||
c.observe(&batch);
|
||||
let s = c.scale().unwrap();
|
||||
// Effective amax should be close to 1.0 (upper end of the batch).
|
||||
assert!(s > 0.0 && s <= 2.0 / 127.0, "scale {s} out of expected range");
|
||||
assert!(
|
||||
s > 0.0 && s <= 2.0 / 127.0,
|
||||
"scale {s} out of expected range"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user