pub struct RouteEnv {
pub keep_nvfp4: bool,
pub dispatch: GemmDispatch,
pub attn_w4a4: bool,
pub attn_prefill_q_t: bool,
}Expand description
2026-09-25: The environment half of DenseFp8Inputs. load_layers
resolves it once, so every layer of one load is planned from the same
values.
Fields§
§keep_nvfp4: bool§dispatch: GemmDispatch§attn_w4a4: bool2026-09-25: The METRALE_ATTN_W4A4 check of prefill/paged_oproj.rs
and prefill/paged_qkv.rs, which read the variable on every call.
attn_prefill_q_t: bool2026-09-25: The METRALE_ATTN_PREFILL_Q_T check of
prefill/cache_skip_qkv.rs, also read on every call.
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
2026-09-25: One layer’s plan. w8a8_kernels comes from the layer’s
resolved kernel handles, so it is an argument, not a field.
Sourcepub fn attn_nvfp4(&self, attn_fp8: bool) -> bool
pub fn attn_nvfp4(&self, attn_fp8: bool) -> bool
2026-09-25: The attention NVFP4 decision. The loader asks it before the
layer exists and passes w8a8_kernels = true, which is sound because
attn_nvfp4 does not depend on it
(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
2026-09-25: Which FP8 prefill twins this layer needs. The loader passes
the constructed layer’s has_w8a8_prefill_kernels().