mlp_ws_shared

Function mlp_ws_shared 

Source
pub fn mlp_ws_shared() -> bool
Expand description

ONE MLP scratch for the whole layer stack; AVAROK_GLM_MLP_WS_SHARED=0 restores one per layer.

🔴 Default ON. The scratch is per-call — every buffer is fully written before it is read inside a single mlp_forward, and the whole stack runs on ONE stream (there is no side stream on this path), so a later layer can never observe an earlier layer’s bytes. What 45 private copies DID buy was ≈2.1 GB of unified memory at AVAROK_GLM_PREFILL_ROWS=256 and ≈9.5 GB at 1024, allocated during weight LOAD — the measured cause of the host-memory-guard kills in ANOMALIES A124/A127. The =0 arm exists so the saving can be measured in ONE image.