Repository navigation
Conversation
The disk and CPU offload flags reach the n-gram embedding through ple_policy(), which resolves VLLM_PLE_DISK_OFFLOAD and VLLM_PLE_CPU_OFFLOAD from the environment; setting the envs module attribute no longer reaches it. Set the environment instead. The two hand-built CPU-offload modules also need the layer_name that forward_impl uses for its diagnostic labels since 19cbb40. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ly7LM3m9fa6DRJPYQjnt95 Signed-off-by: Peuqui <43776522+Peuqui@users.noreply.github.com>
- test_sm70_decode_graph: CudaGraphManager now captures through a shared capture_context and passes stream= to torch.cuda.graph (629063e); the hand-built manager sets the context and the graph fake accepts keywords. - test_host_result, test_gguf_pinned_policy: the hybrid PLE flag is read through ple_policy, not a module-level envs import; the fakes provide the policy (or clear the environment) instead of patching module.envs. - test_ple_offload_worker: set VLLM_PLE_CPU_OFFLOAD in the environment that ple_policy reads, give the runner fake a kernel_config for the fast-lane check, and the connector fake its fast_lane attribute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ly7LM3m9fa6DRJPYQjnt95 Signed-off-by: Peuqui <43776522+Peuqui@users.noreply.github.com>
With kernel_config.ple_prefill_early_request (default off), prompt-only batches send their PLE request at scheduling time from host copies of the prompt tokens instead of a D2H copy queued behind the previous forward, and eager forwards release each mapped PLE result right after its consumer H2D copy instead of after the whole forward. The CPU worker can then gather the next chunk while stage 0 still computes the current one. The worker publishes each finished request's seq so an early request never overwrites inputs it still reads; graph replays keep the existing release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ly7LM3m9fa6DRJPYQjnt95 Signed-off-by: Peuqui <43776522+Peuqui@users.noreply.github.com>
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.
Purpose
With CPU-offloaded PLE in a pipeline, stage 0 waits before every prefill chunk until the PLE worker has gathered that chunk's rows. Two things serialize the gather behind the previous forward:
PleOffloadConnector._launchqueues the D2H copy of the token ids on the model stream, so the request for chunk N+1 reaches the worker only after forward N has finished (ple_offload.wait_d2h).release_outputs(), i.e. after the whole forward, although the consumer copies the result to the device right atple_offload_wait.This PR adds
kernel_config.ple_prefill_early_request(default off; outside the compile hash):Qwen4ExpModelState.ple_cpu_inputs, same rules asprepare_prefill_inputsand_prepare_ngram_context).all_token_idsis not read on the host because its prompt rows are written by a GPU kernel. All other batches keep the existing D2H path.ple_offload_waitreleases a mapped result in stream order right after its consumer H2D copy;release_outputs()skips exactly the results released that way, so graph replays and the CUDA transport keep the existing release.Not a duplicate: gh pr list --state all --search "ple_offload", "PLE prefill", "wait_d2h", "early request", "release_outputs", "PLE overlap", "prefill chunk PLE" finds no PR that changes when the PLE request is sent or when mapped results are released; the open #1205, #1209 and #1199 do not touch the PLE connector, worker request path or result release. The fast lane (#1203) serves CPU-owned GGUF rows from a native thread and is not used for FP8 disk-tier PLE.
This builds on #1214, which repairs the test fakes this PR also extends.
AI assistance was used for this change. I reviewed every line and ran the tests and measurements below.
Test Plan
Serving on our fork (main 6f3557c plus our open PRs and fork commits): Qwen3.8-Flash-Next-180B NVFP4 + MTP, PP4 over Quadro RTX 8000 / Quadro RTX 8000 / Tesla V100 / Tesla V100, FP8 PLE with a disk tier, 29k-token cold prompts, same code with the field off and on, alternating boots. nsys profile of one 9.7k-token prefill with the field on and off.
Path coverage
wait_previous_request/write_cpu_inputsreplacewait_d2harmed=False)Acceleration and benchmark contract (required for performance changes)
kernel_config.ple_prefill_early_request=true.--kernel-config '{"ple_prefill_early_request":true}'on an engine with CPU-offloaded PLE.Test Result
wait_d2htakes 276 ms per request; with the field, only the first chunk waits (273 ms, nothing to overlap), and the pipeline cadence drops from 639-685 ms to 614-643 ms per chunk. Stage 1 then computes without gaps, so the end of the prefill does not move until stage 1 gets less work.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ly7LM3m9fa6DRJPYQjnt95