Skip to content

[Core][Bugfix] Run the warmup dummy forward on every PP rank before the GPU sync check - #66482

Merged
AndreasKaratzas merged 2 commits into
vllm-project:mainfrom
AndreasKaratzas:akaratza_rocm_pp_warmup_before_sync_check
Nov 9, 2026
Merged

AndreasKaratzas merged 2 commits into
vllm-project:mainfrom
AndreasKaratzas:akaratza_rocm_pp_warmup_before_sync_check

Conversation

@AndreasKaratzas

@AndreasKaratzas AndreasKaratzas commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Overview

Run the post-capture warmup dummy forward on every PP rank before enable_gpu_sync_check(); keep the sampler warmup on the last rank. Follow-up requested in the review of #66397; needed before #64176 turns VLLM_GPU_SYNC_CHECK=error back on for AMD CI.

Claims

  • gpu_worker.py: _compile_or_warm_up_model runs the attention-bearing _dummy_run(max_num_reqs) on every non-pooling PP rank; only the last rank then runs _dummy_sampler_run.
  • test_gpu_worker.py: a non-last and a last PP rank both run a forward before the sync check, and only the last rank runs the sampler. The non-last case fails on main.

Validation

MI350X (gfx950), PP=2, TP=1, eager, enable_extensible_kv_cache=False, VLLM_GPU_SYNC_CHECK=error:

Check main this PR
Qwen3-0.6B with a probe worker extension whose first attention-metadata build does a blocking H2D copy (the pattern of the DSv4.1 indexer's dcp_rank_tensor) PP rank 0 had 0 metadata builds before the check, then raised GPU<->CPU sync detected in its first execute_model both ranks built before the check; 10/10 runs, no sync
New unit test non-last case fails passes
tests/v1/worker/test_gpu_worker.py + tests/utils_/test_gpu_sync_debug.py 73 passed
tests/distributed/test_pp_cudagraph.py, test_pipeline_parallel.py -k "mp and not Phi-3.5-MoE or mixed_precision" (2 GPUs) 10 passed, 6 skipped

Details

On main, the dummy forward right before enable_gpu_sync_check() runs only on the last PP rank, because it came in with the sampler warmup (#62560). With eager mode, JIT warmup off and the extensible KV cache off, nothing else gives the other ranks an attention-bearing forward before the check (the profile run skips attention), so anything built lazily on the first forward is built inside the first checked step and raises there.

No in-tree model is known to hit this today: Qwen3-0.6B, DeepSeek-V2-Lite, Nemotron-3-Nano and mamba-130m pass on plain main in this configuration, and DSv4.1 is covered already (decoder replay only runs on the last stage, and the DSv4 sparse-MLA warmup runs a forward on every rank). The reproduction above uses a probe to show the ordering gap; this change closes it before the check is enabled rather than fixing an observed model failure. Cost: one extra max_num_reqs forward on non-last ranks at startup (PP rank 0's CUDA-graph build count goes from 22 to 23); startup time stayed within noise.

It does not depend on #66397 and can land independently. Not a duplicate: the only open PR touching PP warmup, #54630, changes the seeded sampler pass in gpu/warmup.py.

AI assistance (Claude Code) was used to draft this change. Every line was reviewed by the submitter.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

…he GPU sync check

Only the last PP rank ran an attention-bearing forward before
enable_gpu_sync_check(), so lazily built attention state on other ranks
was built inside the first checked step. Keep the sampler warmup on the
last rank only.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/ci retry

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

✅ No earlier CI build exists for this PR. Use /ci run first.

@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #101011 for commit abff0d38560c.

@mawong-amd mawong-amd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the follow-up. Running the warmup forward on every PP rank is the right fix — the first attention-metadata build happens on the first forward, so it has to run before the check arms, and this is the earliest point it can.

@mawong-amd mawong-amd added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 9, 2026
@AndreasKaratzas
AndreasKaratzas merged commit bf1ada6 into vllm-project:main Nov 9, 2026
261 checks passed
@AndreasKaratzas
AndreasKaratzas deleted the akaratza_rocm_pp_warmup_before_sync_check branch November 9, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants