fix(cuda+csm): P0 rtx-backend-cuda compile fix + P2 rtx-csm clippy cleanup (#9)
Co-authored-by: Omar Sobh <[email protected]> Co-committed-by: Omar Sobh <[email protected]>
This commit is contained in:
committed by
redclawsystems
parent
8045ba79d4
commit
6a03aeba61
@@ -77,7 +77,7 @@ impl MoonshineConfig {
|
||||
pub fn padded_head_dim(&self, num_heads: usize) -> usize {
|
||||
let raw = self.hidden_size / num_heads;
|
||||
let pad = self.pad_head_dim_to_multiple_of;
|
||||
((raw + pad - 1) / pad) * pad
|
||||
raw.div_ceil(pad) * pad
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ struct RotaryCache {
|
||||
|
||||
impl RotaryCache {
|
||||
fn new(rotary_dim: usize, max_seq: usize, theta: f64, dtype: DType, dev: &Device) -> Result<Self> {
|
||||
assert!(rotary_dim % 2 == 0, "rotary_dim must be even");
|
||||
assert!(rotary_dim.is_multiple_of(2), "rotary_dim must be even");
|
||||
let inv_freq: Vec<f32> = (0..rotary_dim)
|
||||
.step_by(2)
|
||||
.map(|i| (1.0 / theta.powf(i as f64 / rotary_dim as f64)) as f32)
|
||||
|
||||
Reference in New Issue
Block a user