pub struct Nvfp4Proj {
pub packed: DevicePtr,
pub scale: DevicePtr,
pub scale_2: f32,
}Expand description
One NVFP4 projection as ModelOpt stores it: packed e2m1 pairs, per-block e4m3 scales,
and one global f32 scale.
🪤 The three travel together and are meaningless apart. weight_scale_2 is a scalar read
off the device at load and passed by value — w4a16_gemm takes it as arg_f32, not as a
pointer, so uploading it and passing the address silently reinterprets a pointer as a float.
Fields§
§packed: DevicePtr[out, in/2] U8 — two e2m1 codes per byte.
scale: DevicePtr[out, in/16] F8_E4M3 block scales.
scale_2: f32The single global F32 scale.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Nvfp4Proj
impl RefUnwindSafe for Nvfp4Proj
impl Send for Nvfp4Proj
impl Sync for Nvfp4Proj
impl Unpin for Nvfp4Proj
impl UnwindSafe for Nvfp4Proj
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