pub struct DenseWeight {
pub weight: DevicePtr,
}Expand description
BF16 dense weight (no quantization).
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>
Quantize a BF16 weight [N, K] to FP8 E4M3 [N, K] with per-row
f32 scales. Allocates the FP8 buffer + row_scale buffer on the
GPU, runs the quantize_bf16_to_fp8 kernel, and returns the
resulting Fp8DenseWeight.
Called once at model load time. Caller is responsible for any
stream synchronization needed before the returned weight is
consumed by fp8_gemm_n128 or related kernels.
Phase G (DFlash drafter FP8 weights). Mirrors
QuantizedWeight::predequant_to_fp8 for the BF16 source path.
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