Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
AnubhabB committed Nov 28, 2024
1 parent 57312cd commit 3c82d21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion candle-examples/examples/mamba-minimal/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct Config {
impl Config {
fn vocab_size(&self) -> usize {
let pad = self.pad_vocab_size_multiple;
(self.vocab_size + pad - 1) / pad * pad
self.vocab_size.div_ceil(pad) * pad
}

fn dt_rank(&self) -> usize {
Expand Down
9 changes: 6 additions & 3 deletions candle-metal-kernels/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ impl<'a> AsRef<metal::ComputeCommandEncoderRef> for WrappedEncoder<'a> {
}

impl EncoderProvider for &metal::CommandBuffer {
type Encoder<'a> = WrappedEncoder<'a>
type Encoder<'a>
= WrappedEncoder<'a>
where
Self: 'a;
fn encoder(&self) -> Self::Encoder<'_> {
Expand All @@ -196,7 +197,8 @@ impl EncoderProvider for &metal::CommandBuffer {
}

impl EncoderProvider for &metal::CommandBufferRef {
type Encoder<'a> = WrappedEncoder<'a>
type Encoder<'a>
= WrappedEncoder<'a>
where
Self: 'a;
fn encoder(&self) -> Self::Encoder<'_> {
Expand All @@ -208,7 +210,8 @@ impl EncoderProvider for &metal::CommandBufferRef {
}

impl EncoderProvider for &ComputeCommandEncoderRef {
type Encoder<'a> = WrappedEncoder<'a>
type Encoder<'a>
= WrappedEncoder<'a>
where
Self: 'a;
fn encoder(&self) -> Self::Encoder<'_> {
Expand Down
2 changes: 1 addition & 1 deletion candle-nn/tests/sdpa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ mod metal_sdpa_tests {
let error: f32 = ((&ground_truth - &sdpa_output)?.abs()? / &ground_truth.abs()?)?
.sum_all()?
.to_scalar()?;

assert!(error <= 0.0004, "{}", error);

Ok(())
Expand Down

0 comments on commit 3c82d21

Please sign in to comment.