[PR #351] [CLOSED] serve: preserve context across engine restart #2590

Closed
opened 2026-11-04 02:01:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/351
Author: @updalla-apshir
Created: 10/1/2026
Status: ❌ Closed

Base: main ← Head: fix/344-context-across-restart


📝 Commits (10+)

  • 2575cb1 C-3: the prompt path's GDN short conv tiled over tokens
  • df6980d E-2: prefetch the i-quant expert rows ahead of the AVX-512 decode; an opt-in gather decode
  • cf68b00 D-5: the prompt path's expert stream is issued by its own host thread
  • cb91f2a serve: keep image parts in tool/assistant messages
  • 456011e Layer split limits: docs/MULTI_GPU.md and bench/results/2026-09-29-layer-split-limits
  • f0bbe97 E-4 (prompt side): the draft layer's pass over a prompt chunk without a host sync per group
  • efddd74 E-6: a verify layer whose routed experts are all in VRAM needs nothing from the host
  • 66f4341 D-2: the prompt path's GDN recurrence split over value columns, the output norm in its own kernel
  • 0abcd5b E-6: the device plan opt-in (STRATA_VERIFY_DEVICE_PLAN=1)
  • 57fa1fd serve: routing traces from the live server (--dump-routing under --serve)

📊 Changes

2 files changed (+121 additions, -13 deletions)

View changed files

📝 serve/server.py (+21 -13)
📝 serve/test_server.py (+100 -0)

📄 Description

Summary

During an engine restart, max_context and related model metadata temporarily become 0 while the replacement engine is loading.

This causes incorrect values across /v1/status, /v1/models, /props, /health, /slots, and /metrics.

This change preserves the outgoing engine's context and metadata until the replacement engine reports its own values, while keeping readiness detection independent.

Testing

  • Added a regression test covering context preservation across restart.
  • serve.test_server: 68 tests passed
  • Verified the original implementation reports 0 and the fix preserves 131072.
  • Verified a replacement engine with a different context correctly updates the value.

This change only addresses the context/metadata reporting issue during restart.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/351 **Author:** [@updalla-apshir](https://github.com/updalla-apshir) **Created:** 10/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/344-context-across-restart` --- ### 📝 Commits (10+) - [`2575cb1`](https://github.com/Niko1221/Strata/commit/2575cb1636d906d195bf56f95b9527098a1fbd99) C-3: the prompt path's GDN short conv tiled over tokens - [`df6980d`](https://github.com/Niko1221/Strata/commit/df6980d43f1c499d2929006d89249a079920b223) E-2: prefetch the i-quant expert rows ahead of the AVX-512 decode; an opt-in gather decode - [`cf68b00`](https://github.com/Niko1221/Strata/commit/cf68b004c25f3ec60997d780422ce92e0e959f23) D-5: the prompt path's expert stream is issued by its own host thread - [`cb91f2a`](https://github.com/Niko1221/Strata/commit/cb91f2ad5039a27c4bf775d9bfe6ddfdb98bd5c1) serve: keep image parts in tool/assistant messages - [`456011e`](https://github.com/Niko1221/Strata/commit/456011edebed4b2b36d51d4b76b703c4ae687e5c) Layer split limits: docs/MULTI_GPU.md and bench/results/2026-09-29-layer-split-limits - [`f0bbe97`](https://github.com/Niko1221/Strata/commit/f0bbe978ec4fab037dda7cb7288ff8fcd604025b) E-4 (prompt side): the draft layer's pass over a prompt chunk without a host sync per group - [`efddd74`](https://github.com/Niko1221/Strata/commit/efddd7488092137c64300a22509a4c23337e33da) E-6: a verify layer whose routed experts are all in VRAM needs nothing from the host - [`66f4341`](https://github.com/Niko1221/Strata/commit/66f4341e6c50c5436037e4a1bc47f5ff9fb2cd47) D-2: the prompt path's GDN recurrence split over value columns, the output norm in its own kernel - [`0abcd5b`](https://github.com/Niko1221/Strata/commit/0abcd5b3c7652c685ea9e52636751bcf6b22a6ed) E-6: the device plan opt-in (STRATA_VERIFY_DEVICE_PLAN=1) - [`57fa1fd`](https://github.com/Niko1221/Strata/commit/57fa1fde2503d1e382abb870695d4835118c883a) serve: routing traces from the live server (--dump-routing under --serve) ### 📊 Changes **2 files changed** (+121 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+21 -13) 📝 `serve/test_server.py` (+100 -0) </details> ### 📄 Description ## Summary During an engine restart, `max_context` and related model metadata temporarily become `0` while the replacement engine is loading. This causes incorrect values across `/v1/status`, `/v1/models`, `/props`, `/health`, `/slots`, and `/metrics`. This change preserves the outgoing engine's context and metadata until the replacement engine reports its own values, while keeping readiness detection independent. ## Testing * Added a regression test covering context preservation across restart. * `serve.test_server`: **68 tests passed** * Verified the original implementation reports `0` and the fix preserves `131072`. * Verified a replacement engine with a different context correctly updates the value. This change only addresses the context/metadata reporting issue during restart. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:01:36 +07:00
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#2590
No description provided.