pub struct CpuQStorage(pub Box<dyn QuantizedType>);Tuple Fields§
§0: Box<dyn QuantizedType>Trait Implementations§
Source§impl Debug for CpuQStorage
impl Debug for CpuQStorage
Source§impl DynQuantizedStorage for CpuQStorage
impl DynQuantizedStorage for CpuQStorage
fn dtype(&self) -> GgmlDType
fn block_size(&self) -> usize
fn storage_size_in_bytes(&self) -> usize
Source§fn quantize(&mut self, src: &dyn DynBackendStorage) -> Result<()>
fn quantize(&mut self, src: &dyn DynBackendStorage) -> Result<()>
Quantize an in-device source storage onto self.
Source§fn quantize_imatrix(
&mut self,
src: &dyn DynBackendStorage,
imatrix_weights: &[f32],
n_per_row: usize,
) -> Result<()>
fn quantize_imatrix( &mut self, src: &dyn DynBackendStorage, imatrix_weights: &[f32], n_per_row: usize, ) -> Result<()>
Quantize with importance-matrix weighting.
Source§fn quantize_onto(&mut self, src: &dyn DynBackendStorage) -> Result<()>
fn quantize_onto(&mut self, src: &dyn DynBackendStorage) -> Result<()>
Quantize a CPU source onto self (cross-device).
Source§fn quantize_imatrix_onto(
&mut self,
src: &dyn DynBackendStorage,
imatrix_weights: &[f32],
n_per_row: usize,
) -> Result<()>
fn quantize_imatrix_onto( &mut self, src: &dyn DynBackendStorage, imatrix_weights: &[f32], n_per_row: usize, ) -> Result<()>
Quantize with importance matrix from a CPU source.
Source§fn dequantize(&self, elem_count: usize) -> Result<Box<dyn DynBackendStorage>>
fn dequantize(&self, elem_count: usize) -> Result<Box<dyn DynBackendStorage>>
Dequantize to backend-native f32 storage.
Source§fn fwd(
&self,
self_shape: &Shape,
input: &dyn DynBackendStorage,
layout: &Layout,
) -> Result<(Box<dyn DynBackendStorage>, Shape)>
fn fwd( &self, self_shape: &Shape, input: &dyn DynBackendStorage, layout: &Layout, ) -> Result<(Box<dyn DynBackendStorage>, Shape)>
QMatMul forward against an in-device input storage. Returns a fresh
device storage and its output shape.
self_shape is the weight shape
(the QTensor’s own shape).Source§fn device_arc_dyn(&self) -> Arc<dyn DynBackendDevice> ⓘ
fn device_arc_dyn(&self) -> Arc<dyn DynBackendDevice> ⓘ
Owning device handle. Lets fuel-core recover a
Device from a
QTensor without keeping a parallel device field on QTensor.Source§fn dequantize_f16(
&self,
_elem_count: usize,
) -> Result<Box<dyn DynBackendStorage>, Error>
fn dequantize_f16( &self, _elem_count: usize, ) -> Result<Box<dyn DynBackendStorage>, Error>
Dequantize to f16 (CUDA fast path; default impl rejects).
Source§fn device_ptr(&self) -> Result<*const u8, Error>
fn device_ptr(&self) -> Result<*const u8, Error>
Device pointer for callers that need raw addressing (CUDA only today).
Source§fn indexed_moe_forward(
&self,
_self_shape: &Shape,
_input: &dyn DynBackendStorage,
_input_layout: &Layout,
_ids: &dyn DynBackendStorage,
_ids_layout: &Layout,
) -> Result<(Box<dyn DynBackendStorage>, Shape), Error>
fn indexed_moe_forward( &self, _self_shape: &Shape, _input: &dyn DynBackendStorage, _input_layout: &Layout, _ids: &dyn DynBackendStorage, _ids_layout: &Layout, ) -> Result<(Box<dyn DynBackendStorage>, Shape), Error>
Indexed MoE forward (CUDA-only today; default rejects).
Auto Trait Implementations§
impl !RefUnwindSafe for CpuQStorage
impl !UnwindSafe for CpuQStorage
impl Freeze for CpuQStorage
impl Send for CpuQStorage
impl Sync for CpuQStorage
impl Unpin for CpuQStorage
impl UnsafeUnpin for CpuQStorage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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