Skip to content

[None][fix] Fail loudly on asymmetric warmup batch under attention-DP - #14126

Merged
lfr-0531 merged 1 commit into
NVIDIA:feat/deepseek_v4from
hyukn:fix/warmup-deadlock-attention-dp
May 14, 2026
Merged

[None][fix] Fail loudly on asymmetric warmup batch under attention-DP#14126
lfr-0531 merged 1 commit into
NVIDIA:feat/deepseek_v4from
hyukn:fix/warmup-deadlock-attention-dp

Conversation

@hyukn

@hyukn hyukn commented May 14, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai summary

Description

Under attention-DP, each TP rank's KV cache capacity can differ at runtime, causing _create_warmup_request to return None on some ranks while others proceed into forward() with collective ops — deadlocking the job.

Instead of silently skipping warmup (which hides the root cause), this PR adds _assert_all_tp_ranks_have_warmup_batch that allgathers batch validity across TP ranks and raises RuntimeError with per-rank curr_max_num_tokens diagnostics when asymmetry is detected.

  • Preserves existing skip behavior for single-rank (tp_size=1) where deadlock is impossible
  • If all ranks agree batch is None, warmup is safely skipped (no asymmetry)

Test Coverage

  • pytest tests/unittest/_torch/ passes (no asymmetry in test env)
  • The deadlock scenario now produces a clear RuntimeError instead of hanging
  • Error message tells user exactly what to do (increase --kv_cache_free_gpu_mem_fraction)

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@hyukn
hyukn requested a review from a team as a code owner May 14, 2026 07:47
@hyukn
hyukn requested a review from a team May 14, 2026 07:47
@hyukn
hyukn requested a review from a team as a code owner May 14, 2026 07:47
@hyukn
hyukn requested review from niukuo and yuanjingx87 and removed request for a team May 14, 2026 07:47
@hyukn
hyukn marked this pull request as draft May 14, 2026 07:48
@hyukn
hyukn force-pushed the fix/warmup-deadlock-attention-dp branch from 52452c8 to bfdcda7 Compare May 14, 2026 07:51
…under attention-DP

Under attention-DP, each TP rank's KV cache capacity can differ at
runtime, causing _create_warmup_request to return None on some ranks
while others proceed into forward() with collective ops — deadlocking
the job. Instead of silently skipping warmup (which hides the root
cause), allgather batch validity across TP ranks and raise a RuntimeError
with per-rank curr_max_num_tokens diagnostics when asymmetry is detected.

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
@hyukn
hyukn force-pushed the fix/warmup-deadlock-attention-dp branch from bfdcda7 to 10e3e32 Compare May 14, 2026 07:59
@hyukn
hyukn removed request for a team, niukuo and yuanjingx87 May 14, 2026 07:59
@hyukn

hyukn commented May 14, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@hyukn
hyukn marked this pull request as ready for review May 14, 2026 08:08
@hyukn
hyukn requested a review from a team as a code owner May 14, 2026 08:08
@hyukn
hyukn requested review from joyang-nv and qiaoxj07 and removed request for a team May 14, 2026 08:08
@hyukn hyukn changed the title [https://nvbugs/6095953][fix] Fail loudly on asymmetric warmup batch under attention-DP [None][fix] Fail loudly on asymmetric warmup batch under attention-DP May 14, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #48335 [ run ] triggered by Bot. Commit: 10e3e32 Link to invocation

qiaoxj07 added a commit to qiaoxj07/TensorRT-LLM that referenced this pull request May 14, 2026
…ream PR NVIDIA#14126

NVIDIA#14126 ("Fail loudly on asymmetric warmup batch under
attention-DP") addresses the same rank-divergent warmup-config failure
mode this PR previously patched in `_get_max_shape_warmup_requests`. Its
philosophy (raise RuntimeError with diagnostics, ask user to bump
`--kv_cache_free_gpu_mem_fraction`) is more conservative than the
silent fix-and-proceed we had here, and keeps the warmup contract
explicit.

To avoid duplicating the upstream effort and to reduce review surface
in this PR, drop the local synchronization. The remaining fixes
(autotuner pre/post barriers and AutoTuner.choose_one collective vote)
are independent and stay.

Note: this revert is safe only if PR NVIDIA#14126 (or an equivalent) lands
before merging this branch into mainline. If neither lands, the
rank-divergent warmup-config deadlock remains observable on DSv4-Pro
ADP runs and would need to be re-introduced.

Signed-off-by: Xianjie <5410381+qiaoxj07@users.noreply.github.com>
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #48335 [ run ] completed with state SUCCESS. Commit: 10e3e32
/LLM/main/L0_MergeRequest_PR pipeline #38145 completed with status: 'SUCCESS'

CI Report

Link to invocation

@lfr-0531
lfr-0531 merged commit a6822ed into NVIDIA:feat/deepseek_v4 May 14, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants