MCPcopy Create free account
hub / github.com/Niko1221/Strata / gdn_point_at

Function gdn_point_at

engine/src/core/session.cpp:208–214  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
208void 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.

Callers 2

session_captureFunction · 0.70
session_capture_tokenFunction · 0.70

Calls 2

is_qsa_layerFunction · 0.85
gdn_state_floatsFunction · 0.70

Tested by

no test coverage detected