Skip to content

atom(pd): every P/D producer reports its first token from the forward that samples it - #3165

Open
PerryZhang01 wants to merge 7 commits into
feature/atomcompass_newfrom
task-2655
Open

PerryZhang01 wants to merge 7 commits into
feature/atomcompass_newfrom
task-2655

Conversation

@PerryZhang01

Copy link
Copy Markdown
Collaborator

Closes #2655. Ready for review. The named result waits on #975's 1P1D cell on crsuse2-m2m-v3-005 and -013.

A DeepSeek-V4 P/D producer kept deferred output, so a request's first token reached the host at its rank's next sampling forward, a median 14.4 s after its output prefill in #2493's pd3. Every producer now reports it from the forward that samples it, as recurrent-state ones did.

Dev record

  • Found: the scheduler, the runner's non-deferred staging and Compass's hooks already serve a non-deferred producer, as PP stages and recurrent-state producers take that path; only the predicate moves.
  • Decided: is_deferred_out is off on every producer, whatever its attention family. The test pinning the recurrent-only rule now holds every family off; a new one holds that the output prefill's forward returns its ids. test_capture_real_model.py's pinned model_runner.py lines move up two with the shorter predicate.
  • Decided: outside the file set, every checked-in law is re-keyed to the new atom digest without a refit; their host laws were fitted on lone servers, which ran no producer. Design 09, step_output.py's module doc, a scheduler.py comment and a test_runner_step_semantics.py docstring now say every producer reports its own step. atom(pd): a DeepSeek-V4 P/D prefill server holds each request until its rank next samples, a median 14 s after its output prefill #2655 carries atom-issue; the owner asked on 2026-11-10 that it be developed here.
  • Surprised: the CPU gate skips tests/test_spec_deferred_status_queue.py, as importing model_runner probes the device arch, and the simulated P/D runs need a driver. Red and green ran with Triton's target declared.
  • Left undone: the named result.

Named result

Not measured: pd3's one-token decodes (15) and output-prefill-to-first-token p50 (16.5 s) need #975's DeepSeek-V4-Pro 1P1D cell on both MI355X nodes, after this change. On the CPU, a V4 producer's is_deferred_out reads True at the base and False here.

Gates

2db8d968d: GATE_CPU_RC=0; ATOM 10301 passed, tests/compass 5974 passed. ruff, black clean.

Evidence

Revert-red at 59e9ff5, whose test and model_runner.py 2db8d96 keeps, atom/model_engine/model_runner.py reinstated whole from f18b821, tests/test_spec_deferred_status_queue.py run in perzhang_gate (no driver) with Triton's target declared gfx950 through atom.compass.capture.driverless._declare_arch:

tree result failing
head 32 passed
base model_runner.py 4 failed, 28 passed test_every_producer_gives_up_deferred_output[v4], [mla], [mha]: assert True is False on is_deferred_out; test_a_producer_reports_t0_from_the_forward_that_samples_it: the deferred branch's send_to_cpu_async raises AttributeError on sync_event=None

Cost against the brief's few lines, git diff --numstat from f18b821: model_runner.py 20 (one statement replaces two, the rest its comment), scheduler.py 5, step_output.py 2, design 09 5, the re-keyed laws 24; tests 74.

The re-key's digest is host_key_of's at 2db8d96, 68ad8fc6, which every law's host key now names.

Generated with Claude Code

PerryZhang01 and others added 5 commits November 10, 2026 11:25
A DeepSeek-V4 producer kept deferred output, so a request's first token
reached the host only at its rank's next sampling forward, and the request
was released to decode a median 14 s after its output prefill (#2655).
Only recurrent-state producers gave deferred output up; now every
producer does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without a refit. The crs005 DPA8 and EP8 prefill laws say their 1P1D
prefill-side records ran a producer that deferred its output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r host laws were fitted on

Their host laws were fitted on lone prefill cells, which ran no producer;
only their prefill rows were also fitted on 1P1D prefill sides. Design 09
says a 1P1D prefill side ran its held-request decodes until #2655.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…D producer reports its own step

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wo up after #2655's predicate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PerryZhang01 PerryZhang01 self-assigned this Nov 10, 2026
@PerryZhang01 PerryZhang01 added adoption: upstream Adoption: PRs to ROCm/ATOM and hand-off of ATOM issues e2e-stage3 End-to-end cc-traces stage 3: DeepSeek-V4-Pro on MI355X M3 M3: v1 + one month, adoption and scale, focused on MI455 module: compass-design atom/compass/design/ and its tests module: compass-runner atom/compass/runner/ and its tests module: compass-script scripts/compass/ and its tests module: compass-capture atom/compass/capture/ and its tests labels Nov 10, 2026
@PerryZhang01

Copy link
Copy Markdown
Collaborator Author

Round 1 pushed 2db8d96.

First round: every P/D producer gives up deferred output, the laws are re-keyed, and the docs that described the old rule are corrected. No findings to answer yet.

# so the request waits while the rank prefills others (#2655: a median
# 14 s). That extra decode also makes a recurrent state apply T0 twice.
# So every producer reports T0 from the forward that samples it.
self.is_deferred_out = not self.is_pipeline_parallel and not self.is_pd_producer

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every producer now reads its own sampled ids, but HostDeviceRecurrence._exit still releases a single-stage output forward at the previous output forward's target end, so a simulated producer, #975's prefill side included, reports its first token one forward early (probe in the verdict). File an issue for the recurrence's wait rules, name it under Left undone, and correct the Found line.

@PerryZhang01

Copy link
Copy Markdown
Collaborator Author

REQUEST CHANGES @ 2db8d96: 1 blocking.

  1. Blocking: atom(pd): a DeepSeek-V4 P/D prefill server holds each request until its rank next samples, a median 14 s after its output prefill #2655's named result is not shown. Measure it on compass: stage 3 registered, run and graded (the #627 stage-3 exit) #975's 1P1D cell at this head, or land on the Ruling requested below.
  2. Not blocking: ModelRunner._verifies_drafts's docstring says a producer decodes to surface a deferred first token, which no producer now does. Drop that parenthetical.
  3. Not blocking, needs an issue: the host recurrence still prices a producer's output forward as deferred (inline on model_runner.py; probe below).

Escalated: 56 non-test lines against "a few lines", in the ruling request below; need human applied.

Checked: 2db8d96: GATE_CPU_RC=0, ATOM 10301 passed, tests/compass 5974 passed. Revert-red reproduces the Dev record's 4 failed, 28 passed. The laws differ from f18b821 only in host.key.atom and a provenance clause; 68ad8fc6 is the digest of this head and of its clean merge with the tip a80a223. The predicate runs at every engine start. The re-pinned capture lines hold the same source. ruff, black clean.
Accepted with reservation: the crs005 prefill laws, re-keyed without a refit, price a P/D prefill side, whose forwards now wait for their own ids, with host laws fitted on lone cells that deferred theirs.
Watch next: none.

Evidence

Revert-red, tests/test_spec_deferred_status_queue.py in perzhang_gate (no driver), Triton's target declared gfx950 through atom.compass.capture.driverless._declare_arch:

tree result failing
head 32 passed
model_runner.py from f18b821 4 failed, 28 passed 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: AttributeError: 'NoneType' object has no attribute 'wait'
head, the old predicate on one line 4 failed, 28 passed the same

Recurrence probe at this head: a HostDeviceRecurrence built as atom.compass.run builds one for a single-stage runner (no PP stage, no sync), zero host laws, three output forwards of 2.0 s device time each:

forward 0: called 0.0 s, device ends 2.0 s, exits 0.0 s
forward 1: called 0.0 s, device ends 4.0 s, exits 2.0 s
forward 2: called 2.0 s, device ends 6.0 s, exits 4.0 s

A non-deferred producer's reply carries the forward's own ids, so the simulated scheduler releases each request at an exit before its own device end. The real prepare_sampled_ids blocks in .tolist() until it.

@PerryZhang01

Copy link
Copy Markdown
Collaborator Author

Needs owner ruling: accept 56 non-test lines against #2655's "a few lines", and say whether its named result must be measured before landing.

The predicate is 20 lines with its comment. The rest are 24 law re-key lines, which any hashed atom/ change forces, and 12 lines of docs and comments that described the old rule. The named result needs #975's DeepSeek-V4-Pro 1P1D cell on crsuse2-m2m-v3-005 and -013, which this node cannot run.

Recommendation: (a), since no test runs a V4 producer on a device.

#3165 at 2db8d96: REQUEST CHANGES, 1 blocking (the named result); need human applied.

@PerryZhang01 PerryZhang01 added the need human Automation stopped; needs owner judgement. Agents apply when escalating, only the owner removes. label Nov 10, 2026
@PerryZhang01

Copy link
Copy Markdown
Collaborator Author

Ruling: (b). No 1P1D node pair is free; #3165 lands on its CPU evidence with its 56 non-test lines accepted, and #3173 measures the named result once 005 and 013 are free. Brief updated: Exit, Named result.
Also: #3173 opened.

@PerryZhang01 PerryZhang01 removed the need human Automation stopped; needs owner judgement. Agents apply when escalating, only the owner removes. label Nov 11, 2026
PerryZhang01 and others added 2 commits November 11, 2026 02:43
…ce its first token

No producer defers its output now, so none decodes for that. The docstring
keeps its line count, so the capture test's pinned lines below it hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… after the docstring fix

The `_verifies_drafts` docstring change moves the atom digest from 68ad8fc6
to 3959e283, the digest of this head and of its clean merge with ed0628a.
Each law's re-key clause names the new digest; nothing else changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adoption: upstream Adoption: PRs to ROCm/ATOM and hand-off of ATOM issues e2e-stage3 End-to-end cc-traces stage 3: DeepSeek-V4-Pro on MI355X M3 M3: v1 + one month, adoption and scale, focused on MI455 module: compass-capture atom/compass/capture/ and its tests module: compass-design atom/compass/design/ and its tests module: compass-runner atom/compass/runner/ and its tests module: compass-script scripts/compass/ and its tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant