Repository navigation
Add session-owned PreparedGraph execution and scheduler support - #1250
Merged
Merged
Conversation
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.
PreparedGraph owns session graph metadata, persistent input buffers, execution plans and backend capture cleanup. It supports independent graphs sharing a GraphWorkspace, full/body entry points sharing one allocation, and single-graph GGML scheduler execution.
Migrate Drama3, Nemotron Transcribe and Ming3 Audio to this lifecycle. Backend placement and expert-staging callbacks remain model-local. Model math, precision, options and generation settings are unchanged.
The GGML scheduler also now propagates a failed allocation reservation instead of continuing with a null buffer. This changes allocation-failure handling only; kernels and successful dispatch remain unchanged.
Validation used Debug builds on RTX 5090, eight threads, sequential warmed A→B→B→A comparisons: 20 configurations, 80 sessions and 416 requests. The baseline uses the original model implementations with the initial PreparedGraph framework API present but unused; the candidate migrates those implementations. These are pre-migration comparisons, not pristine-main benchmarks.
Resident and disk-expert offload paths were tested on CUDA and Vulkan. Drama3 covers default and
cuda_perf, streaming and offline generation, different seeds and repeated requests. ASR covers two different long recordings, short requests after long recordings, and repeats; Ming3 speech responses also cover voice switching.RTF before → after, with observed peak VRAM in MiB in parentheses. A single peak value means before and after matched.
cuda_perf, residentcuda_perf, offloadAll corresponding WAVs, streamed PCM and non-timing responses match exactly, including ASR transcripts, timestamps, speaker labels and confidence values. Repeated requests and long→short reuse showed no retained-memory increase. No peak-VRAM increase was observed.
Timing changes range from −2.61% to +1.95%. The Ming3 Vulkan offload ASR aggregate includes one slower first long request; its repeat and the second candidate block match baseline timing, so no persistent slowdown was observed.
PreparedGraph unit tests pass on CPU, CUDA and Vulkan, covering shared allocation layouts, changing inputs, workspace growth, entry points, scheduler splits, reset/release and resource ordering. Real allocation-failure and recovery tests pass on CUDA and Vulkan without leaked buffers.