[NVBUG-6241842][fix] DSA DSL atom-split: guard against MTP draft next… - #14891
Conversation
…_n=1 `_pick_dsl_expand` caches `(factor, atom)` on the metadata once per `prepare()` with the invariant `factor * atom == 1 + max_draft_tokens` (the target-pass next_n). MTPEagle reuses the same `attn_metadata` for its multi-step draft loop: after iteration `i=0` it mutates `seq_lens` to 1 so subsequent iterations run 1-token incremental decode with `next_n=1`. The DSL FP4/FP8 atom-split reshape `(num_gen, next_n, H, D) -> (num_gen*factor, atom, H, D)` is only valid when the caller actually supplies `next_n == factor * atom` tokens per request. For MTP=3 + FP4 + atom-split (`factor=2, atom=2`), the `i>=1` draft iteration's `q` only has `num_gen * 1` tokens, so the reshape crashed with `shape '[48, 2, 64, 64]' is invalid for input of size 98304` (4x mismatch). Add an explicit guard `next_n == factor * atom` to both FP4 and FP8 atom-split entries. Target / draft `i=0` satisfy the invariant and continue to benefit from atom-split; MTPEagle `i>=1` falls back to the kernel-native `next_n=1` path (atom-split has no benefit for 1 token per request anyway). Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
|
/bot run |
📝 WalkthroughWalkthroughModified the atom-split reshape guard in both FP4 and FP8 paged-MQA logits decode paths to require ChangesDSL Paged-MQA Atom-Split Guard
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
PR_Github #51765 [ run ] triggered by Bot. Commit: |
|
PR_Github #51765 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51830 [ run ] triggered by Bot. Commit: |
|
PR_Github #51830 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51892 [ run ] triggered by Bot. Commit: |
|
PR_Github #51892 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51933 [ run ] triggered by Bot. Commit: |
|
PR_Github #51933 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51953 [ run ] triggered by Bot. Commit: |
|
PR_Github #51953 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
1 similar comment
|
/bot run --disable-fail-fast |
|
PR_Github #52017 [ run ] triggered by Bot. Commit: |
|
PR_Github #52018 [ run ] triggered by Bot. Commit: |
|
PR_Github #52017 [ run ] completed with state |
|
PR_Github #52018 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #52190 [ run ] triggered by Bot. Commit: |
|
PR_Github #52611 [ run ] triggered by Bot. Commit: |
|
PR_Github #52611 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #52714 [ run ] triggered by Bot. Commit: |
|
/bot run --disable-fail-fast |
…atom-split-mtp-thin Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
|
/bot run |
|
PR_Github #52746 [ run ] triggered by Bot. Commit: |
|
PR_Github #52714 [ run ] completed with state |
|
PR_Github #52746 [ run ] completed with state |
|
/bot --help |
GitHub Bot Help
Provide a user friendly way for developers to interact with a Jenkins server. Run See details below for each supported subcommand. Details
Launch build/test pipelines. All previously running jobs will be killed.
kill
Kill all running builds associated with pull request. skip
Skip testing for latest commit on pull request. reuse-pipeline
Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break. |
|
/bot --stage-list "DGX_B200-8_GPUs-PyTorch-1,DGX_B200-8_GPUs-PyTorch-2,DGX_B200-8_GPUs-PyTorch-3" |
GitHub Bot Help
Provide a user friendly way for developers to interact with a Jenkins server. Run See details below for each supported subcommand. Details
Launch build/test pipelines. All previously running jobs will be killed.
kill
Kill all running builds associated with pull request. skip
Skip testing for latest commit on pull request. reuse-pipeline
Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break. |
|
/bot run --stage-list "DGX_B200-8_GPUs-PyTorch-1,DGX_B200-8_GPUs-PyTorch-2,DGX_B200-8_GPUs-PyTorch-3" |
|
PR_Github #52896 [ run ] triggered by Bot. Commit: |
|
PR_Github #52896 [ run ] completed with state |
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #53052 [ run ] triggered by Bot. Commit: |
|
PR_Github #53052 [ run ] completed with state
|
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #53184 [ run ] triggered by Bot. Commit: |
|
PR_Github #53184 [ run ] completed with state |
fix https://nvbugspro.nvidia.com/bug/6241845
…_n=1
_pick_dsl_expandcaches(factor, atom)on the metadata once perprepare()with the invariantfactor * atom == 1 + max_draft_tokens(the target-pass next_n). MTPEagle reuses the sameattn_metadatafor its multi-step draft loop: after iterationi=0it mutatesseq_lensto 1 so subsequent iterations run 1-token incremental decode withnext_n=1.The DSL FP4/FP8 atom-split reshape
(num_gen, next_n, H, D) -> (num_gen*factor, atom, H, D)is only valid when the caller actually suppliesnext_n == factor * atomtokens per request. For MTP=3 + FP4 + atom-split (factor=2, atom=2), thei>=1draft iteration'sqonly hasnum_gen * 1tokens, so the reshape crashed withshape '[48, 2, 64, 64]' is invalid for input of size 98304(4x mismatch).Add an explicit guard
next_n == factor * atomto both FP4 and FP8 atom-split entries. Target / drafti=0satisfy the invariant and continue to benefit from atom-split; MTPEaglei>=1falls back to the kernel-nativenext_n=1path (atom-split has no benefit for 1 token per request anyway).Summary by CodeRabbit
Description
Test Coverage
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)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.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.