pub struct Fp8ActQuant {
pub shared: KernelHandle,
pub hopper: KernelHandle,
}Expand description
The FP8 activation quantizer a layer will launch: the shared kernel, plus the Hopper twin when this target has one.
Fields§
per_token_group_quant_fp8, present on every target.
hopper: KernelHandleper_token_group_quant_fp8_hopper, or KernelHandle(0) off Hopper.
Implementations§
Source§impl Fp8ActQuant
impl Fp8ActQuant
Sourcepub fn resolve(gpu: &dyn GpuBackend) -> Self
pub fn resolve(gpu: &dyn GpuBackend) -> Self
Probe both. try_kernel for each: the shared one is optional on targets
with no FP8 path at all (the callers already gate on
Self::available), and the twin is optional everywhere but Hopper.
A quantizer with only the shared kernel — the state every non-Hopper target resolves to, and the one unit tests construct.
Sourcepub fn available(&self) -> bool
pub fn available(&self) -> bool
Is there a quantizer to launch at all? The replacement for the
handle.0 != 0 test every W8A8 selector used to spell inline.
EITHER handle, not Self::pick’s: the pick is width-dependent, and a
caller asking “is there an FP8 path on this target” is not asking about
one launch’s M.
Sourcepub fn twin_present(&self) -> bool
pub fn twin_present(&self) -> bool
Is the twin in this image? PRESENCE, which is a property of the build —
not “will the next launch use it”, which is Fp8QuantPick::twin.
Sourcepub fn pick(&self, m: u32, k: u32) -> Fp8QuantPick
pub fn pick(&self, m: u32, k: u32) -> Fp8QuantPick
Which kernel this (m, k) launches, on which grid, and why not the
other one — the process’s resolved lever and the compiled target’s SM
count. See Self::pick_with for the pure form.
Sourcepub fn pick_with(
&self,
requested: bool,
m: u32,
k: u32,
sm_count: u32,
) -> Fp8QuantPick
pub fn pick_with( &self, requested: bool, m: u32, k: u32, sm_count: u32, ) -> Fp8QuantPick
Self::pick over an explicit lever and SM count — pure, so every
(M, K) the attribution prices is gradeable from a CPU test.
Sourcepub fn kernel(&self, m: u32, k: u32) -> KernelHandle
pub fn kernel(&self, m: u32, k: u32) -> KernelHandle
The handle this (m, k) launches.
Trait Implementations§
Source§impl Clone for Fp8ActQuant
impl Clone for Fp8ActQuant
Source§fn clone(&self) -> Fp8ActQuant
fn clone(&self) -> Fp8ActQuant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more