Use bail rather than wrapping a string where possible. (#249)

* Use bail rather than wrapping a string where possible.

* Revert the cuda default bit.
This commit is contained in:
Laurent Mazare
2023-07-26 15:42:46 +01:00
committed by GitHub
parent f052ba76cb
commit 1235aa2536
3 changed files with 13 additions and 8 deletions

View File

@ -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(