pub enum MtpQuantization {
Nvfp4,
Fp8,
Bf16,
}Expand description
MTP head weight precision.
Variants§
Nvfp4
NVFP4 E2M1 (0.5 bytes/weight) — fastest MTP forward, lowest accuracy.
Fp8
FP8 E4M3 (1 byte/weight) — balanced.
Bf16
BF16 (2 bytes/weight) — highest accuracy, slowest MTP forward.
Implementations§
Source§impl MtpQuantization
impl MtpQuantization
Sourcepub fn supports_drafter_prefill(self) -> bool
pub fn supports_drafter_prefill(self) -> bool
Whether the batched drafter prefill can run at this precision.
NECESSARY, not sufficient — prefill::prefill_drafter remains the
authority and re-checks the actual weight variants and kernel handles.
This predicate exists so the caller can skip the max_seq_len x hidden
BF16 prompt-hidden buffer (335 MB at 32k/h=5120, 2.7 GB at 256k) for a
head that could never use it. It is exact by construction:
quantize_proj produces ProjectionWeight::Bf16 for, and only for,
MtpQuantization::Bf16.
Trait Implementations§
Source§impl Clone for MtpQuantization
impl Clone for MtpQuantization
Source§fn clone(&self) -> MtpQuantization
fn clone(&self) -> MtpQuantization
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 MtpQuantization
impl Debug for MtpQuantization
Source§impl FromStr for MtpQuantization
impl FromStr for MtpQuantization
Source§impl PartialEq for MtpQuantization
impl PartialEq for MtpQuantization
impl Copy for MtpQuantization
impl Eq for MtpQuantization
impl StructuralPartialEq for MtpQuantization
Auto Trait Implementations§
impl Freeze for MtpQuantization
impl RefUnwindSafe for MtpQuantization
impl Send for MtpQuantization
impl Sync for MtpQuantization
impl Unpin for MtpQuantization
impl UnwindSafe for MtpQuantization
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.