#1492 [Engine] save and restore sessions without an MTP drafter
closed · @Momoyeyu · 0 コメント · GitHub で見る
Server & APIAMD / HIPNVIDIA / CUDASecurityWindowsLinux
本文
## Problem and result `--serve` can run without `--mtp`, but SAVE always passed `mtp.kv_state()` to the session writer. An unloaded drafter has `max_cells == 0`, so saving any nonempty conversation failed with: ``` conversation snapshot: invalid K/V extent ``` and RESTORE never got a file to read. The in-memory snapshot path already accepts an absent drafter, so the disk path now uses the same distinction: the draft K/V source, its read bounds, `sl.kv_layers` and the validate/restore calls include the drafter only when it exists. The file format and the K/V extent checks are unchanged; passing an uninitialized drafter explicitly still fails instead of bypassing validation. Related to #1444, not closing it: the failure is reproduced with the same error, but not in the reporter's Q6_K configuration, and the launch arguments are still missing there. ## Related discussion #1444. ## Approach `conversation_snapshot_sources` and `conversation_session_read_limits` take `const QsaState*`; the reference overloads stay for callers that always have a drafter, so nothing else in the tree changes. SAVE/RESTORE, the memory preflight and the saved layer count follow the actual drafter presence. ## Validation Current head: `b8cd7b3b` on base `146df3c4` (engine 0.1.58). The follow-up commit fixes two test-only async waits identified by Cryonic7; it uses the existing `snap_save` wrapper to join background checkpoint copies before comparing captured bytes. **Passed — my Linux CUDA runs, 2026-11-14:** - RTX 4090 D 24 GB, sm_89, driver 595.84, CUDA 12.8.61, GCC 13.3, pinned ggml `3cf03257f219afbe7334045ff7c6a06ac68c627d`. - Configure: `cmake -S . -B build -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF -DSTRATA_BUILD_CONVERSATION_TESTS=ON -DCMAKE_CUDA_ARCHITECTURES=89 -DSTRATA_GGML_DIR=<pinned-llama-dir> -DCMAKE_BUILD_TYPE=Release`. - Full engine build: `cmake --build build --target strata -j 12` passed (compiler warnings present, no build errors). - Build targets: `conversation_snapshot_test conversation_transfer_test conversation_validation_test conversation_file_test conversation_memory_test conversation_cache_test conversation_split_failure_test session_save_reclaim_test`, with `cmake --build build --target <targets> -j 12`. - `ctest --test-dir build -R '^(conversation_snapshot_test($|_ckpt_)|conversation_transfer_test$|conversation_validation_test$|conversation_file_test$|conversation_memory_test$|conversation_cache_test$|conversation_split_failure_test$|session_save_reclaim_test$)' --output-on-failure`: **10/10 passed**, including the Linux-only transfer test and all three snapshot modes. - `ctest --test-dir build -R '^conversation_snapshot_test_ckpt_' --repeat until-fail:5 --output-on-failure`: both variants passed **five consecutive runs each**, 4349 checks per run. - `git diff --check` clean. The five PR source files in the remote tested tree were SHA-256 compared with the local committed source and match. **Observed regression before the test fix:** - On `933e17b4`, default `conversation_snapshot_test` passed; both `_ckpt_async` and `_ckpt_vram_slots` failed at `no-MTP disk round trip exact`. The two-call wrapper fix makes those same cases pass as recorded above. **Independent reports — attributed to the authors and tested revisions:** - [router0mail, Linux HIP on current head](https://github.com/Niko1221/Strata/pull/1492#issuecomment-6883304233): clean `b8cd7b3b`, Radeon R9700 32 GB (gfx1201), ROCm 7.2 / HIP 7.2.53210, Linux 7.0, GCC 15. Built `conversation_snapshot_test`; default, `_ckpt_async`, and `_ckpt_vram_slots` each passed five consecutive runs with `ctest -R conversation_snapshot_test --repeat until-fail:5 --output-on-failure`, 4349 checks per run. Other conversation/session targets and live model sessions were not re-run in that report. - [Cryonic7, Windows CUDA](https://github.com/Niko1221/Strata/pull/1492#issuecomment-6756253732): built clean `933e17b4`, reported test results and the async test race, supplied the two-line test fix, and reported stock-path DFlash2-only live SAVE/RESTORE including a fresh engine process. - [router0mail, Linux CUDA/HIP](https://github.com/Niko1221/Strata/pull/1492#issuecomment-6878395835): built clean `933e17b4` on each backend; live SAVE, full server/engine restart, RESTORE and follow-up at 8K/130K/250K succeeded. Their note distinguishes an existing HIP large-prompt stall before saving, reproduced without this PR. They did not build/run the conversation test targets in that report. - [sanasol](https://github.com/Niko1221/Strata/pull/1492#issuecomment-6839205149): independent Linux CUDA confirmation of the same fix in a private branch with other patches; this is not current-head validation. **Not run / remaining:** - No live model SAVE/RESTORE was run by me in this session. The clean-head live results above are third-party measurements on `933e17b4`; `b8cd7b3b` changes only test code. - HIP and Windows builds/tests of `b8cd7b3b` were not run by me. The current-head HIP snapshot build/tests are independently confirmed above; other HIP conversation/session targets and current-head Windows tests remain unverified. - SYCL, the reporter's Q6_K configuration, and a full unfiltered test-suite run remain unverified. ## Limits Current-head HIP snapshot confirmation is recorded above; the PR is ready for maintainer review. The SYCL copy of the session code (`sycl/src/program/generate.cpp`) remains unchanged. The session file format and K/V extent checks are unchanged.
関連リンク
インストール・モデル・リリースへのサイト内リンク。