[GH-ISSUE #5379] [Engine] Session-file identity gaps on multi-GPU hosts: device set / compute capability, STRATA_HC_Q8, STRATA_ROUTE_TAIL_SKIP #3208

Open
opened 2026-11-07 14:38:53 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @nazerim on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5379

Static analysis, read at v0.2.10 ffa80d73 and re-verified against current main 9f7d977d (no commit in between touches conversation_file.* — the seam is unchanged). Not yet an empirical repro — happy to produce one, see "test" below. Three inputs that change computed state are outside the session-file identity, so a file can pass every check and restore state that was computed by different arithmetic than this runtime would now produce.

1. The fingerprint binds neither the GPU device set nor compute capability per stage

SessionConfig (include/strata/core/conversation_file.hpp:71–84) carries engine version, backend, kv, max_context, kv_resident, mtp_window, kv_rot, rope, cvec + 24 arithmetic switches (identity-hash block: generate.cpp:11835–11837, "the config fingerprint covers the RESOLVED settings … the K/V format and the arithmetic switches") — but not which GPUs exist, their order, or their architecture. --layer-split itself is likewise outside SessionConfig (the PRs adding v2 stage tables bind geometry, which is adjacent but different: the geometry check proves the K/V shape, not whose kernel produced it).

Why that matters: CUDA kernel selection is per-device from compute capability — src/core/verify.cpp:262–280 picks the side-mixer arithmetic via sm120_default(maj, min) cached in per_dev[64]. Two unlike cards (e.g. sm_86 + sm_120) genuinely compute different bit patterns for the same layer. A saved session whose stage-0 K/V was produced by the sm_86 path restores cleanly onto a runtime where that layer range now sits on the sm_120 device (swap the physical cards, change the split, or use the server's per-boot GPU ordering — ordered_gpus deliberately does not bind ordinals, serve/server.py:4092), and every geometry/identity check passes. (The SHAPE half of that check is real — verified on our rig: files written with --layer-split 13 pinned are refused by a K=12 boot with "saved with another layer range than this runtime's", fail-closed. It is the per-stage ARCH dimension that has nothing to compare — see "Proposed fix".)

2. STRATA_HC_Q8 and STRATA_ROUTE_TAIL_SKIP are not among the 24 hashed switches

Neither is among the hashed switches (the set covers STRATA_KV_ROT, rope, and 22 others; both names appear nowhere in the identity block). They bite in different placements: STRATA_ROUTE_TAIL_SKIP is live on a split — it changes which experts a window's missed routing skips (expert_source.cpp:4849–4856 reads it per window) — so a session saved with one rank and restored with another silently continues from differently-routed cells, on exactly the single-GPU-plus-split configurations where sessions exist. STRATA_HC_Q8 is a state-changing weight representation (native_dense.cpp:51) but is gated to one GPU (!multi_gpu at generate.cpp:4952); it matters for the off-split case, which today's session files already support. (Watch naming: STRATA_HC_REQ8 — the int8-requant path at generate.cpp:5101–5104 — is a different switch; don't let the catalog confuse the reader.)

Proposed fix

Extend SessionConfig: (a) per-stage (device_count, compute-capability-of-each-device-with-layers, layer-range) — or simply a sorted list of (arch, layer_lo, layer_hi) triples once #4310-style stage tables exist; (b) add the two switches to the hashed 24 (they're already read from env at startup; hashing them is one line each). The lane already agrees on the principle in spirit: #3957's park manifest refuses to load across "another engine file or STRATA_* switch set" — the session-file fingerprint is the same seam, left open. Cost: every existing session file on the box invalidates once at next version bump — acceptable for a feature whose split-support is still pre-release, but worth a note in the docs ("files from before 0.1.xx are refused; save again").

Test (if maintainers want it empirical, not just static): a 2-GPU unlike-arch host (sm_86 + sm_120): save at --layer-split K under one card order, shut down, physically swap the cards (or boot with the server's reorder giving the opposite order), start, RESTORE → today it should be accepted (no device fields to compare); answers at the first turn should be checked greedy-vs-cold to see whether the silent arch-mismatch is benign in practice or drifts. On a P2P-less mixed pair with --kv-resident the bulk K/V is host-pinned, which may hide the difference in some configs — which is exactly why a cheap identity field is the safer answer than an investigation.

Related to: #4310 (stage-table geometry binding — this is the identity seam it doesn't close), #4551 (append inherits the same identity), #4226 (its disk tier binds SessionConfig as-is and would inherit both gaps). Filed separately per "one problem per issue".

Originally created by @nazerim on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5379 Static analysis, read at v0.2.10 `ffa80d73` and re-verified against current `main` `9f7d977d` (no commit in between touches `conversation_file.*` — the seam is unchanged). Not yet an empirical repro — happy to produce one, see "test" below. Three inputs that change *computed state* are outside the session-file identity, so a file can pass every check and restore state that was computed by different arithmetic than this runtime would now produce. ### 1. The fingerprint binds neither the GPU device set nor compute capability per stage `SessionConfig` (`include/strata/core/conversation_file.hpp:71–84`) carries engine version, backend, kv, max_context, kv_resident, mtp_window, kv_rot, rope, cvec + 24 arithmetic switches (identity-hash block: `generate.cpp:11835–11837`, "the config fingerprint covers the RESOLVED settings … the K/V format and the arithmetic switches") — but **not** which GPUs exist, their order, or their architecture. `--layer-split` itself is likewise outside `SessionConfig` (the PRs adding v2 stage tables bind *geometry*, which is adjacent but different: the geometry check proves the K/V *shape*, not *whose kernel* produced it). Why that matters: CUDA kernel selection is **per-device from compute capability** — `src/core/verify.cpp:262–280` picks the side-mixer arithmetic via `sm120_default(maj, min)` cached in `per_dev[64]`. Two unlike cards (e.g. sm_86 + sm_120) genuinely compute different bit patterns for the same layer. A saved session whose stage-0 K/V was produced by the sm_86 path restores cleanly onto a runtime where that layer range now sits on the sm_120 device (swap the physical cards, change the split, or use the server's per-boot GPU ordering — `ordered_gpus` deliberately does **not** bind ordinals, `serve/server.py:4092`), and every geometry/identity check passes. (The SHAPE half of that check is real — verified on our rig: files written with `--layer-split 13` pinned are refused by a K=12 boot with "saved with another layer range than this runtime's", fail-closed. It is the per-stage ARCH dimension that has nothing to compare — see "Proposed fix".) ### 2. `STRATA_HC_Q8` and `STRATA_ROUTE_TAIL_SKIP` are not among the 24 hashed switches Neither is among the hashed switches (the set covers `STRATA_KV_ROT`, rope, and 22 others; both names appear nowhere in the identity block). They bite in different placements: **`STRATA_ROUTE_TAIL_SKIP` is live on a split** — it changes which experts a window's missed routing skips (`expert_source.cpp:4849–4856` reads it per window) — so a session saved with one rank and restored with another silently continues from differently-routed cells, on exactly the single-GPU-plus-split configurations where sessions exist. **`STRATA_HC_Q8`** is a state-changing weight representation (`native_dense.cpp:51`) but is gated to one GPU (`!multi_gpu` at `generate.cpp:4952`); it matters for the off-split case, which today's session files already support. (Watch naming: `STRATA_HC_REQ8` — the int8-requant path at `generate.cpp:5101–5104` — is a *different* switch; don't let the catalog confuse the reader.) ### Proposed fix Extend `SessionConfig`: (a) per-stage `(device_count, compute-capability-of-each-device-with-layers, layer-range)` — or simply a sorted list of (arch, layer_lo, layer_hi) triples once #4310-style stage tables exist; (b) add the two switches to the hashed 24 (they're already read from env at startup; hashing them is one line each). The lane already agrees on the principle in spirit: #3957's park manifest refuses to load across "another engine file or STRATA_* switch set" — the session-file fingerprint is the same seam, left open. Cost: every existing session file on the box invalidates once at next version bump — acceptable for a feature whose split-support is still pre-release, but worth a note in the docs ("files from before 0.1.xx are refused; save again"). **Test (if maintainers want it empirical, not just static):** a 2-GPU unlike-arch host (sm_86 + sm_120): save at `--layer-split K` under one card order, shut down, physically swap the cards (or boot with the server's reorder giving the opposite order), start, RESTORE → today it should be *accepted* (no device fields to compare); answers at the first turn should be checked greedy-vs-cold to see whether the silent arch-mismatch is benign in practice or drifts. On a P2P-less mixed pair with `--kv-resident` the *bulk* K/V is host-pinned, which may hide the difference in some configs — which is exactly why a cheap identity field is the safer answer than an investigation. **Related to:** #4310 (stage-table geometry binding — this is the *identity* seam it doesn't close), #4551 (append inherits the same identity), #4226 (its disk tier binds `SessionConfig` as-is and would inherit both gaps). Filed separately per "one problem per issue".
Author
Owner

@github-actions[bot] commented on GitHub (Nov 6, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6678131263 --> @github-actions[bot] commented on GitHub (Nov 6, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 6, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6678498510 --> @github-actions[bot] commented on GitHub (Nov 6, 2026): Thanks, this follows the format now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3208
No description provided.