Repository navigation
feat(scheduler): persist learned graph costs across serving restarts - #301
Draft
shadownetX wants to merge 1 commit into
Draft
shadownetX wants to merge 1 commit into
shadownetX wants to merge 1 commit into
Conversation
Concurrent streaming can stall while the scheduler discovers graph execution costs after a restart. Previously measured costs are discarded even when the model, hardware and execution configuration are unchanged. Persist physical graph duration estimates after clean drain and restore compatible estimates as known but stale before admission. Retain live timing feedback and refresh rules without carrying request-local acceptance state across sessions. Scope the bounded atomic cache to the authenticated core, GPU, runtime executable, driver and graph catalog. Missing or incompatible records leave the scheduler unmeasured. No model export or user configuration changes are required. The expected benefit is more predictable startup scheduling with fewer discovery-related streaming stalls. On v0.1.0, restoring the cache reduced the initial maximum streaming gap from 4,365 ms to 559 ms. On main, restoring 28 estimates reduced it from 4,530 ms to 1,372 ms; ordinary scheduling interruptions remain, so the v0.1.0 improvement is not reproduced in full. Both measurements used a single GB10 DGX Spark, Qwen3.8 Flash Next FP4 with DFlash2 MXFP8, and overlapping 8K, 32K and 64K streaming requests without prefix reuse. The ARM64 release build, targeted scheduler and persistence tests, Helios lifecycle checks and workload validation passed. An existing signed core loaded without re-export. The broader native suite was not fully green. Multi-device and Windows persistence are not implemented. Co-authored-by: ChatGPT <support@openai.com> Design-Signed-Off-By: ChatGPT (GPT-6); design-review=ed22 Signed-off-by: vonP <thomas@picollin.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Following the investigation in #288, I noticed that some of the longest interruptions during concurrent streaming occurred while the scheduler was discovering graph execution costs.
These costs are learned during serving but discarded on every restart, even when the model, hardware, and execution configuration remain unchanged.
Persisting compatible estimates should improve startup streaming stability and make scheduling more predictable across serving restarts.
Changes
The cache is scoped to the model core, GPU, runtime executable, driver, and execution configuration. No request state or token histories are persisted.
No additional configuration, environment variable, or model export is required.
Results
Tests were performed on a single NVIDIA DGX Spark (GB10), using Qwen3.8 Flash Next FP4 with DFlash2 MXFP8.
The workload consists of three overlapping streaming requests with 8K, 32K, and 64K input contexts, repeated three times per cache condition, without prefix-cache reuse.
Number of streaming gaps exceeding 500 ms:
Across all three configurations, scheduler counters recorded approximately 3.35 seconds of discovery execution during the largest initial interruption with an empty cache. No discovery execution was recorded during the corresponding maximum gaps after restoration.
The native implementation successfully persisted and restored 28 graph duration estimates.
Interaction with #285
The v0.1.0 prototype demonstrates a substantial and consistent reduction in long streaming interruptions.
On main, graph cost persistence works, but the streaming stability improvements observed on v0.1.0 are not fully reproduced.
To investigate this difference, I experimentally reverted the checkpoint scheduling changes introduced by #285 in
helios/src/scheduler/checkpoints.rs, while keeping the rest of main unchanged.This restored startup behavior comparable to v0.1.0, with a maximum initial interruption of 465 ms and no streaming gaps exceeding 500 ms during the first restored-cache workload.
However, interruptions returned during subsequent repetitions. These observations suggest an interaction with checkpoint scheduling, but further investigation is needed to establish its precise cause.
This PR preserves #285 and does not include the experimental revert.
Regardless of these differences, the motivation remains unchanged: avoid repeating graph cost discovery after every restart and improve startup scheduling stability.
Validation
Limitations
Hardware validation is limited to single-device GB10 serving under Linux. Multi-GPU and Windows persistence are not implemented.
The broader native test suite was not fully green during validation on main, although the targeted tests passed.
This contribution addresses repeated startup cost discovery rather than general scheduling latency or decode throughput. Further investigation of the remaining streaming interruptions is outside the scope of this PR.