Conversation snapshots and checkpoints follow the session carve (#216): a session saves and restores only the layers it owns
conversation_session_sizes() gives one session's running-state sizes: the GDN bytes of its gdn_alloc rows, the indexer tail/dead/block_pos per owned QSA state; an inconsistent carve is rejected. Checkpoint save/validate/restore, the snapshot size estimate, capture, validation and restore iterate the owned QSA ordinals [qsa_ord0, qsa_ord0 + qsa_alloc) instead of every model layer (the spare pooled row is written back per owned layer only), and a parked snapshot records the carve it was taken from (layer_lo, layer_hi): a restore into another range is refused before any write. One GPU (the default full range: gdn_alloc = n_gdn_layers, qsa_ord0 = 0, qsa_alloc = n_qsa_layers) saves and restores exactly the bytes it did before, in the same order. generate.cpp's conv_state_sizes uses the same function. The tests' hand-built sessions carry the full-range carve, and the host-only validation test checks the carved sizes and the rejections.
This commit is contained in:
1 parent
abbf12caf5
commit
d263ec58f9
6 files changed
+86
-34
No files matched your search
@@ -809,9 +809,9 @@ using ConvStateSizes = strata::core::ConversationStateSizes;
|
||||
ConvStateSizes conv_state_sizes(const strata::core::ModelGeometry& g, const strata::core::SessionState& ss) {
|
||||
ConvStateSizes z;
|
||||
std::string error;
|
||||
strata::core::conversation_state_sizes(g, z, error); // geometry has already passed engine validation
|
||||
// a split stage's session owns only its layer range's state (see SessionState's carve note)
|
||||
if (g.n_gdn_layers() > 0) z.gdn = z.gdn / (size_t) g.n_gdn_layers() * (size_t) ss.gdn_alloc;
|
||||
// a split stage's session owns only its layer range's state (see SessionState's carve note); the geometry
|
||||
// and the carve have already passed engine validation
|
||||
strata::core::conversation_session_sizes(g, ss, z, error);
|
||||
return z;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user