pub struct Fp8Weight {
pub weight: DevicePtr,
pub row_scale: DevicePtr,
pub n: u32,
pub k: u32,
pub scale_format: WeightQuantFormat,
}Expand description
2026-09-25: FP8 E4M3 weight with its scale. The layout of row_scale
depends on scale_format:
WeightQuantFormat::Fp8PerRow:[N]f32;WeightQuantFormat::Fp8BlockScaled:[N/128, K/128]f32, rounded up;WeightQuantFormat::Fp8SingleScale: no scale buffer.
Check scale_format before reading row_scale.
Fields§
§weight: DevicePtr2026-09-25: [N, K] FP8 E4M3 bytes.
row_scale: DevicePtr2026-09-25: The scale buffer, laid out as scale_format says.
n: u32§k: u32§scale_format: WeightQuantFormatImplementations§
Source§impl Fp8Weight
impl Fp8Weight
Sourcepub fn transpose_for_gemm(
&self,
gpu: &dyn GpuBackend,
transpose_k: KernelHandle,
transpose_scale_k: KernelHandle,
stream: u64,
) -> Result<Fp8WeightTransposed>
pub fn transpose_for_gemm( &self, gpu: &dyn GpuBackend, transpose_k: KernelHandle, transpose_scale_k: KernelHandle, stream: u64, ) -> Result<Fp8WeightTransposed>
2026-09-25: Transpose this weight into new buffers weight_t[K, N] and
scale_t[K/128, N/128], and synchronize stream. row_scale is read as
FP32 block scales; scale_format is not checked.
Trait Implementations§
Source§impl From<Fp8Weight> for QuantWeight
impl From<Fp8Weight> for QuantWeight
impl Copy for Fp8Weight
Auto Trait Implementations§
impl Freeze for Fp8Weight
impl RefUnwindSafe for Fp8Weight
impl Send for Fp8Weight
impl Sync for Fp8Weight
impl Unpin for Fp8Weight
impl UnwindSafe for Fp8Weight
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