pub enum QuantFormat {
Nvfp4,
Fp8,
}Expand description
Runtime quantization format for weight dispatch.
Determines which GEMV/GEMM kernels are used for decode, prefill, and MTP verify. Adding a new quant format requires:
- Add variant here
- Add kernel dispatch in the layer forward paths
- Add weight loading logic in load_moe_qwen35 / attention loader
Variants§
Nvfp4
NVFP4 E2M1 — default, highest throughput. Uses w4a16 kernels.
Fp8
FP8 E4M3 block-scaled — native FP8 serving. Uses w8a16 kernels.
Implementations§
Source§impl QuantFormat
impl QuantFormat
Sourcepub fn peak_memory_multiplier(&self) -> f64
pub fn peak_memory_multiplier(&self) -> f64
Peak GPU memory multiplier for OOM pre-flight estimation.
Accounts for model-building overhead on top of raw weight bytes:
- NVFP4: 1.3x (weight pointers aliased, transposed copies + predequant)
- FP8: 1.5x (zero-copy weights, transposed attention copies, FP8 pointer tables)
Adding a new format: set the multiplier based on empirical peak/on-disk ratio.
Trait Implementations§
Source§impl Clone for QuantFormat
impl Clone for QuantFormat
Source§fn clone(&self) -> QuantFormat
fn clone(&self) -> QuantFormat
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 QuantFormat
impl Debug for QuantFormat
Source§impl PartialEq for QuantFormat
impl PartialEq for QuantFormat
impl Copy for QuantFormat
impl Eq for QuantFormat
impl StructuralPartialEq for QuantFormat
Auto Trait Implementations§
impl Freeze for QuantFormat
impl RefUnwindSafe for QuantFormat
impl Send for QuantFormat
impl Sync for QuantFormat
impl Unpin for QuantFormat
impl UnwindSafe for QuantFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.