Sets `s.gdn.state`/`conv_state` for `layer`, which is what makes one layer's GDN state its own. Shared by the direct and captured paths so the two cannot disagree about which slice a layer owns.
| 206 | /// Sets `s.gdn.state`/`conv_state` for `layer`, which is what makes one layer's GDN state its own. Shared by |
| 207 | /// the direct and captured paths so the two cannot disagree about which slice a layer owns. |
| 208 | void gdn_point_at(const ModelGeometry& g, int64_t layer, SessionState& s) { |
| 209 | if (is_qsa_layer(g, layer)) return; |
| 210 | int64_t gdn_index = 0; |
| 211 | for (int64_t l = 0; l < layer; ++l) if (!is_qsa_layer(g, l)) ++gdn_index; |
| 212 | s.gdn.state = s.gdn_state + (size_t) (gdn_index - s.gdn_ord0) * gdn_state_floats(g); |
| 213 | s.gdn.conv_state = s.gdn.state + (uint64_t) g.ssm_state_size * g.ssm_v_heads * g.ssm_state_size; |
| 214 | } |
| 215 | |
| 216 | /// The per-token staging every QSA layer's captured H2D reads FROM. Must run before each replay: the graphs |
| 217 | /// captured the SOURCE POINTER, not the value, and that is exactly why the buffers are pinned and fixed. |
no test coverage detected