summaryrefslogtreecommitdiff
path: root/candle-flash-attn
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-07-26 15:42:46 +0100
committerGitHub <noreply@github.com>2023-07-26 15:42:46 +0100
commit1235aa25360081607ccb2795a934a675868ce9ba (patch)
treeb61c3530755cdcb34856ab2287bbf559213af7d3 /candle-flash-attn
parentf052ba76cbf88f8e4f9fe38e76f7a2673da6b5f2 (diff)
downloadcandle-1235aa25360081607ccb2795a934a675868ce9ba.tar.gz
candle-1235aa25360081607ccb2795a934a675868ce9ba.tar.bz2
candle-1235aa25360081607ccb2795a934a675868ce9ba.zip
Use bail rather than wrapping a string where possible. (#249)
* Use bail rather than wrapping a string where possible. * Revert the cuda default bit.
Diffstat (limited to 'candle-flash-attn')
-rw-r--r--candle-flash-attn/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/candle-flash-attn/src/lib.rs b/candle-flash-attn/src/lib.rs
index c2dec7d7..0123543b 100644
--- a/candle-flash-attn/src/lib.rs
+++ b/candle-flash-attn/src/lib.rs
@@ -3,7 +3,7 @@ mod ffi;
use candle::backend::BackendStorage;
use candle::cuda_backend::cudarc::driver::DevicePtr;
use candle::cuda_backend::WrapErr;
-use candle::{CpuStorage, Error, Layout, Result, Shape, Tensor};
+use candle::{CpuStorage, Layout, Result, Shape, Tensor};
use half::f16;
pub struct FlashHdim32Sm80 {
@@ -29,7 +29,7 @@ impl candle::CustomOp3 for FlashHdim32Sm80 {
_: &CpuStorage,
_: &Layout,
) -> Result<(CpuStorage, Shape)> {
- Err(Error::Wrapped("no cpu support for flash-attn".into()))
+ candle::bail!("no cpu support for flash-attn")
}
fn cuda_fwd(