pub struct RouteEnv {
pub keep_nvfp4: bool,
pub dispatch: GemmDispatch,
pub attn_w4a4: bool,
pub attn_prefill_q_t: bool,
}Expand description
The environment-resolved half of DenseFp8Inputs, read ONCE per load.
Hoisted out of the per-layer decision because GemmDispatch::from_env
walks the environment block for a dozen variables and a 64-layer model
would otherwise do it 64 times — and because resolving once is what makes
“every layer of this model took the same route” a property of the type
rather than of the environment holding still.
Fields§
§keep_nvfp4: bool§dispatch: GemmDispatch§attn_w4a4: boolMirrors prefill/paged_oproj.rs:42 and prefill/paged_qkv.rs:53,
which read this per projection per prefill and are NOT memoised.
attn_prefill_q_t: boolMirrors prefill/cache_skip_qkv.rs:142, same caveat.
Implementations§
Source§impl RouteEnv
impl RouteEnv
pub fn from_env() -> Self
Sourcepub fn plan(
&self,
ffn_fp8: bool,
attn_fp8: bool,
w8a8_kernels: bool,
) -> DenseFp8Plan
pub fn plan( &self, ffn_fp8: bool, attn_fp8: bool, w8a8_kernels: bool, ) -> DenseFp8Plan
This layer’s plan. w8a8_kernels is a property of the layer (its
resolved kernel handles), which is why it is not part of RouteEnv.
Sourcepub fn attn_nvfp4(&self, attn_fp8: bool) -> bool
pub fn attn_nvfp4(&self, attn_fp8: bool) -> bool
The NVFP4 half of the plan. Asked BEFORE the layer exists, so it may
not depend on any layer-local kernel handle — pinned by
attn_nvfp4_does_not_depend_on_the_w8a8_kernels.
Sourcepub fn attn_fp8_twins(&self, attn_fp8: bool, w8a8_kernels: bool) -> Fp8TwinSet
pub fn attn_fp8_twins(&self, attn_fp8: bool, w8a8_kernels: bool) -> Fp8TwinSet
Which FP8 prefill twins this layer needs. w8a8_kernels is read off
the constructed layer (Qwen3AttentionLayer::has_w8a8_prefill_kernels).