pub enum Q8MatKind {
Dequant,
Int8Act,
TwoPassInt8,
}Expand description
How a Q8_0 matmul lowers to CUDA. At batch-1 decode a matmul is bound on the int8 WEIGHT bytes, not the math — so these three modes trade accuracy/latency, NOT weight bandwidth.
Variants§
Dequant
f64 dequant, thread-per-output — the numeric reference (exact, but uncoalesced and slow).
Int8Act
SINGLE-PASS int8-activation MMQ (__dp4a, int32 accumulate), coalesced — THE DEFAULT fast path:
llama.cpp-matched activation precision (identical greedy token) with the shortest per-iteration
dependency chain, which wins the latency-bound batch-1 regime (the A100 head-to-head beat). A
near-tie logit can flip exactly as llama.cpp’s does.
TwoPassInt8
TWO-PASS int8 activation (hi byte + lo residual byte ⇒ ~14-bit) — the logit-exact mode: the same
short __dp4a dependency chain, ~2× the activation math (two dp4a per block), logits within ~1e-3
of the f64 reference so a near-tie token does NOT flip. The correctness mode llama.cpp lacks.
Trait Implementations§
impl Copy for Q8MatKind
impl Eq for Q8MatKind
impl StructuralPartialEq for Q8MatKind
Auto Trait Implementations§
impl Freeze for Q8MatKind
impl RefUnwindSafe for Q8MatKind
impl Send for Q8MatKind
impl Sync for Q8MatKind
impl Unpin for Q8MatKind
impl UnsafeUnpin for Q8MatKind
impl UnwindSafe for Q8MatKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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
§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
key and return true if they are equal.