Repository navigation
fix(pd): a P/D producer reports its first token from the forward that samples it - #3203
Draft
PerryZhang01 wants to merge 1 commit into
Draft
PerryZhang01 wants to merge 1 commit into
PerryZhang01 wants to merge 1 commit into
Conversation
… samples it A paged P/D producer (DeepSeek-V4, MLA, MHA) kept deferred output, so a request's first token reached the host only at the rank's next forward that samples, and the producer held the request until then. Forwards of middle chunks sample nothing, so the request waited while the rank prefilled others. defers_output now answers False for every producer, as it already did for recurrent-state ones. Consumers and servers without P/D still defer, and PP still does not. The family argument and its config lookup go with the old rule. Port of jgong5#3165 (task-2655 at 4ced162), without its simulator parts. The 14 s median hold was measured on Compass records in the fork; the served measurement is pending (jgong5#3173). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
This branch has not been deployed
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.
Ready for review. No blocking issues.
A P/D producer with paged state (DeepSeek-V4, MLA, MHA) kept deferred output, so it held each request until its rank's next forward that samples, and forwards of middle chunks sample nothing. Every P/D producer now reports its first token from the forward that samples it, as recurrent-state producers already did. Port of jgong5#3165 (fork branch
task-2655at 4ced162) for jgong5#2655, without its simulator parts.Dev record
tokenIDProcessorboth take the rule fromscheduler.defers_output, and recurrent-state producers and PP already take the non-deferred path, so only the producer branch changes.defers_outputis False for every producer and drops itsfamilyargument, with the config lookup and imports only that branch used. Consumers and servers without P/D still defer; PP still does not. A producer schedules no drafts, soScheduledBatchstages the same ids either way.prepare_sampled_idsreads them with.tolist()), as recurrent-state producers' already do. Its throughput cost belongs to the served measurement.tests/test_spec_deferred_status_queue.py, sincemodel_runnerimports only with aiter and a device arch. Red and green ran with Triton's target declared gfx950.Named result
The 14 s median hold was measured on Compass records in the fork; the served measurement is pending (jgong5#3173).
Gates
tests/test_spec_deferred_status_queue.py33 passed with gfx950 declared; 5 fail on main's source.tests/without plugins, 13802 passed; its 125 failed and 99 errors are main's, test for test.Evidence
Revert-red:
atom/model_engine/{scheduler,model_runner}.pyandatom/kv_transfer/disaggregation/types.pyfrom main (0189b35), this branch's test file, gfx950 declared:test_every_producer_gives_up_deferred_output[v4],[mla],[mha]:assert True is False;test_a_producer_reports_t0_from_the_forward_that_samples_it: the deferred branch'ssend_to_cpu_asyncwaits onsync_event=None;test_the_scheduler_resolves_the_runners_deferral[1]: main looks up the model's family (no attribute 'hf_config')Declared target: A fake
rocminfoonPATHand a Triton driver whose only answer isGPUTarget("hip", "gfx950", 64), as the fork's capture tooling does. It is a scratch wrapper aroundpytest.main, not part of this change.Regression set, gfx950 declared:
test_scheduler.py,test_scheduler_mtp_max_tokens.py,test_scheduler_spec_preempt.py,test_pp.py,test_pp_draft_input_ids.py,test_pd_{chunked_transfer,mla_landing,mla_staging,pp,producer_config,source_claim}.py,test_kv_connector_scheduler.py,test_kv_change.py,test_pause_generation.py,test_postprocess_width.py,test_output_transfer_runner.py,test_h2d_runner_publication.py,test_model_runner_staging_fence.py,test_mtp_draft_kv_allocation.py,test_dsv4_state_replay.py,test_deepseek_v4_transfer_regions.py,test_attn_family.py,test_spec_deferred_status_queue.py. The 30 failures are identical on main and here: 22 intest_postprocess_width.pyand 8 intest_output_transfer_runner.py,Current atom config is not setor no_servedon a stub runner. The CPU gate skips both files. Without the declared target the set gives 1163 passed, 39 skipped.Full suite: in a container with aiter and no GPU, unlike the CPU gate's runner, main's tree gives 13801 passed and the same 224 failing or erroring tests.
Overlap: No open ROCm/ATOM PR changes
defers_output: of 363 open PRs, the 94 touchingscheduler.py,model_runner.pyordisaggregation/types.pywere read for it.Fork measurement, jgong5#2655: in two DeepSeek-V4-Pro DPA-TP8 1P1D runs at c=256, output prefill to release p50 14.7 s and 14.4 s, and no first token reached the client before its release.
🤖 Generated with Claude Code