pub struct DenseWeight {
pub weight: DevicePtr,
}Expand description
2026-09-25: Device pointer to an unquantized weight: BF16 unless the loader
that built it says otherwise (for example dense_keep_f32).
Fields§
§weight: DevicePtrImplementations§
Source§impl DenseWeight
impl DenseWeight
Sourcepub fn quantize_to_fp8(
&self,
gpu: &dyn GpuBackend,
quantize_kernel: KernelHandle,
n: usize,
k: usize,
stream: u64,
) -> Result<Fp8DenseWeight>
pub fn quantize_to_fp8( &self, gpu: &dyn GpuBackend, quantize_kernel: KernelHandle, n: usize, k: usize, stream: u64, ) -> Result<Fp8DenseWeight>
2026-09-25: Quantize a BF16 weight [N, K] to FP8 E4M3 [N, K] with one
f32 scale per row, in new buffers, with the quantize_bf16_to_fp8
kernel. It synchronizes stream before returning.
Trait Implementations§
Source§impl Clone for DenseWeight
impl Clone for DenseWeight
Source§fn clone(&self) -> DenseWeight
fn clone(&self) -> DenseWeight
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 moreSource§impl Debug for DenseWeight
impl Debug for DenseWeight
Source§impl From<DenseWeight> for QuantWeight
impl From<DenseWeight> for QuantWeight
Source§fn from(w: DenseWeight) -> Self
fn from(w: DenseWeight) -> Self
Converts to this type from the input type.
impl Copy for DenseWeight
Auto Trait Implementations§
impl Freeze for DenseWeight
impl RefUnwindSafe for DenseWeight
impl Send for DenseWeight
impl Sync for DenseWeight
impl Unpin for DenseWeight
impl UnwindSafe for DenseWeight
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