pub struct GdnFlags {
pub h_f16: bool,
pub h_f16_pool: bool,
pub fused_norm: bool,
pub batched_recurrent: bool,
pub exact_verify: bool,
}Fields§
§h_f16: bool--ssm-h-dtype f16: store the GDN decode h-state as FP16.
h_f16_pool: boolStage 3 of the f16 h-state: additionally SIZE the h pools at 2 bytes
per element. Must imply h_f16 (a narrow pool holding FP32 would be
an OOB write, not a mode). NOT serveable yet and therefore has NO
CLI surface — the CLI mapping always publishes false, and
ssm_h_fp16_preconditions refuses it besides (defense in depth) —
but the sizing plumbing keys off THIS field so the pool, preflight
and every byte-copier already agree on the storage width when
prefill narrowing lands.
fused_norm: bool--gdn-fused-norm: fused GDN output-norm decode kernel.
batched_recurrent: bool--ssm-batched-recurrent: one strided recurrent launch per batch.
exact_verify: bool--exact-verify: run the sequential-decode-EXACT per-token MTP-verify
chain (issue #435 route (a)) instead of the default WY-chunkwise /
fused BF16-conv arms. OPT-IN, default OFF; the measured decode-step
cost (~+22-36% at the n=8/16/32 verify rungs) is why.
SCOPE: this makes the GDN/SSM verify chain exact. It does NOT deliver
end-to-end spec-on == spec-off, because every FFN and attention
projection dispatches on ROW COUNT (verify K=4 takes
w4a16_gemv_batch4, decode takes w4a16_gemv) and those separate
implementations round differently — ~5e-5 of lanes by 1 ULP, on every
shape measured (#459). Closing that needs single-row routing for the
whole verify forward, which is future work.
★ Attribution warning, learned the hard way: a 2026-08-21 measurement
showed gross output degeneration (video-fidelity 0/2, 0/4 at C=2/C=4)
that this flag appeared to fix. The real cause was the K=4 verdict
rewind bug (#699); this flag only changed dispatch so the bug stopped
firing. The 1-ULP divergence this flag actually closes has never been
shown to cause more than an occasional flipped token at temperature 0.
If flipping this flag changes gross behavior, suspect a dispatch-
sensitive scheduler bug first. Details on ServeArgs::exact_verify.
Implementations§
Source§impl GdnFlags
impl GdnFlags
Sourcepub fn verify_exact_active(self) -> bool
pub fn verify_exact_active(self) -> bool
Whether the MTP-verify pass must run the sequential-decode-exact
conv+GDN chain (issue #435 route (a)). Default FALSE: exact verify is
opt-in via --exact-verify, so with default settings spec-on output
is NOT bitwise-equal to spec-off (the #435 divergence ships).
Pure so it is testable without touching the process-global flags cell.
h_f16 forces non-exact even when requested, because an FP16 h-state
is a whole-chain numerics change that is not bit-comparable to the
FP32 reference in the first place, and the exact arm’s kernels are
FP32 readers (reading the FP16 pool through them would be silent
garbage, not an error). CLI validation additionally REJECTS the
explicit pair, so this clause is defense in depth, not the interface.
Trait Implementations§
impl Copy for GdnFlags
impl Eq for GdnFlags
impl StructuralPartialEq for GdnFlags
Auto Trait Implementations§
impl Freeze for GdnFlags
impl RefUnwindSafe for GdnFlags
impl Send for GdnFlags
impl Sync for GdnFlags
impl Unpin for GdnFlags
impl UnwindSafe for GdnFlags
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<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.