pub struct CublasLtWrapper {}Implementations§
Source§impl CublasLtWrapper
impl CublasLtWrapper
Sourcepub fn batch_matmul_f8(
&self,
a: &Tensor,
b: &Tensor,
dequant_a_scale: &Tensor,
dequant_b_scale: &Tensor,
quantize_scale: &Tensor,
out: Option<&Tensor>,
alpha: Option<f32>,
beta: Option<f32>,
bias: Option<&Tensor>,
act: Option<CandleActivation>,
) -> Result<Tensor>
pub fn batch_matmul_f8( &self, a: &Tensor, b: &Tensor, dequant_a_scale: &Tensor, dequant_b_scale: &Tensor, quantize_scale: &Tensor, out: Option<&Tensor>, alpha: Option<f32>, beta: Option<f32>, bias: Option<&Tensor>, act: Option<CandleActivation>, ) -> Result<Tensor>
Fused batch matmul + add + Relu/Gelu activation using CublasLt for F8 dtypes.
§Arguments
a- Input tensor of size BxMxKb- Input tensor of size BxNxKdequant_a_scale- F32 scalar tensor, used toathe out tensor.dequant_b_scale- F32 scalar tensor, used tobthe out tensor.quantize_scale- F32 scalar tensor, used to requantize.out- Optional Output tensor of size BxNxK. If set and beta != 0, will be added to the end result of A*B beforeactalpha- Optional scaling factor for A*Bbeta- Optional scaling factor for Cbias- Optional bias tensor of size Mact- Optional Gelu or Relu activation. If set, will be added to the end result
The resulting tensor is of shape NxM
Sourcepub fn batch_matmul(
&self,
a: &Tensor,
b: &Tensor,
out: Option<&Tensor>,
alpha: Option<f32>,
beta: Option<f32>,
bias: Option<&Tensor>,
act: Option<CandleActivation>,
) -> Result<Tensor>
pub fn batch_matmul( &self, a: &Tensor, b: &Tensor, out: Option<&Tensor>, alpha: Option<f32>, beta: Option<f32>, bias: Option<&Tensor>, act: Option<CandleActivation>, ) -> Result<Tensor>
Fused batch matmul + add + Relu/Gelu activation using CublasLt.
§Arguments
a- Input tensor of size BxMxKb- Input tensor of size BxNxKout- Optional Output tensor of size BxNxK. If set and beta != 0, will be added to the end result of A*B beforeactalpha- Optional scaling factor for A*Bbeta- Optional scaling factor for Cbias- Optional bias tensor of size Mact- Optional Gelu or Relu activation. If set, will be added to the end result
The resulting tensor is of shape NxM
Trait Implementations§
Source§impl Clone for CublasLtWrapper
impl Clone for CublasLtWrapper
Source§fn clone(&self) -> CublasLtWrapper
fn clone(&self) -> CublasLtWrapper
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CublasLtWrapper
impl RefUnwindSafe for CublasLtWrapper
impl Send for CublasLtWrapper
impl Sync for CublasLtWrapper
impl Unpin for CublasLtWrapper
impl UnwindSafe for CublasLtWrapper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more