[https://nvbugs/6215690][fix] AutoDeploy: FlashInfer 128-byte alignment for Mamba inputs (also addresses nvbugs/6162114) - #14535
Conversation
📝 WalkthroughWalkthroughThis PR adds 128-byte memory alignment enforcement for tensors passed to FlashInfer kernels in the Mamba SSM backend. A new ChangesFlashInfer Mamba Memory Alignment
Possibly related PRs
Suggested reviewers
🎯 2 (Simple) | ⏱️ ~12 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 |
|
/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1,DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" |
|
PR_Github #50229 [ run ] triggered by Bot. Commit: |
|
PR_Github #50229 [ run ] completed with state
|
04df655 to
9356eeb
Compare
|
/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1,DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" |
|
PR_Github #50304 [ run ] triggered by Bot. Commit: |
|
PR_Github #50304 [ run ] completed with state
|
9356eeb to
e1f06dd
Compare
The decode path requires contiguous aligned to 128 bytes. Add _fi_align() before passing x/B/C to FlashInfer SSM kernel in the decode path. data.contiguous() is the real fix: with TP >= 8, the hidden-state tensor is a strided view (non-contiguous), which FlashInfer rejects. This regression was invisible at world_size=4 where the same sharding happened to produce a contiguous layout. clone() is purely defensive: for the current Mamba2 configs, row sizes (num_heads * head_dim * dtype_size and n_groups * ssm_state_size * dtype_size) are always multiples of 128 bytes, so a contiguous slice can never be misaligned. The clone() path guards against future configs where that assumption breaks. The extend path does not require contiguous memory and remains as-is. Signed-off-by: Gal Hubara Agam <96368689+galagam@users.noreply.github.com>
Signed-off-by: Gal Hubara Agam <96368689+galagam@users.noreply.github.com>
aff7b86 to
1e79f76
Compare
Signed-off-by: Gal Hubara Agam <96368689+galagam@users.noreply.github.com>
|
/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1,DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" |
|
PR_Github #50382 [ run ] triggered by Bot. Commit: |
|
PR_Github #50382 [ run ] completed with state
|
Signed-off-by: Gal Hubara-Agam <96368689+galagam@users.noreply.github.com>
|
/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1,DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" |
|
PR_Github #50475 [ run ] triggered by Bot. Commit: |
|
PR_Github #50475 [ run ] completed with state
|
|
/bot run |
|
PR_Github #50537 [ run ] triggered by Bot. Commit: |
|
PR_Github #50537 [ run ] completed with state |
|
/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1,DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1" |
|
PR_Github #50573 [ run ] triggered by Bot. Commit: |
|
PR_Github #50573 [ run ] completed with state
|
|
/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-Post-Merge-1" |
|
/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. |
|
PR_Github #50586 [ run ] triggered by Bot. Commit: |
|
PR_Github #50586 [ run ] completed with state |
|
/bot run reuse-pipeline |
|
PR_Github #50594 Bot args parsing error: usage: /bot [-h] |
|
/bot reuse-pipeline |
|
PR_Github #50595 [ reuse-pipeline ] triggered by Bot. Commit: |
|
PR_Github #50595 [ reuse-pipeline ] completed with state |
|
Full bot run succeeded: #14535 (comment) This failure is from a known regression in a post merge test #14535 (comment) |
…nt for Mamba inputs (also addresses nvbugs/6162114) (NVIDIA#14535) Signed-off-by: Gal Hubara Agam <96368689+galagam@users.noreply.github.com> Signed-off-by: Gal Hubara-Agam <96368689+galagam@users.noreply.github.com>
Description
The decode path requires contiguous aligned to 128 bytes. Add _fi_align() before passing x/B/C to FlashInfer SSM kernel in the decode path.
data.contiguous() is the real fix: with TP >= 8, the hidden-state tensor is a strided view (non-contiguous), which FlashInfer rejects.
This regression was invisible at world_size=4 where the same sharding happened to produce a contiguous layout.
clone() is purely defensive: for the current Mamba2 configs, row sizes
(num_heads * head_dim * dtype_size and n_groups * ssm_state_size * dtype_size)
are always multiples of 128 bytes, so a contiguous slice can never be misaligned.
The clone() path guards against future configs where that assumption breaks.
The extend path does not require contiguous memory and remains as-is.
Test Coverage
The unwaived Ultra test:
-accuracy/test_llm_api_autodeploy.py::TestNemotronUltraV3::test_accuracy[nvfp4-8]
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.Summary by CodeRabbit
Bug Fixes
Tests