Repository navigation
[None][fix] Make trtllm-gen FMHA wait for the PDL predecessor before reading sequence lengths - #22089
Conversation
|
/bot run |
|
@PerkzZheng, could you help to review this PR as trt-llm-torch-attention-devs? Thanks~ Assignment explanation
Affinity and workload are snapshots at selection, not live counters. Existing reservations on this PR are counted once. |
|
Could you please rebase this branch onto the latest upstream |
mikeiovine
left a comment
There was a problem hiding this comment.
Stamp on behalf of runtime devs, delegating proper review to @NVIDIA/trt-llm-torch-attention-devs
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
The FMHA kernels now execute griddepcontrol.wait before reading the sequence lengths or any other output of the preceding kernel. Before, under PDL they could read stale lengths, which could hang the persistent context kernel or corrupt its output. Signed-off-by: zhixinl <[email protected]>
This reverts commit 8f973fb (NVIDIA#19873). The override was added as a workaround for a context FMHA hang, but it did not fix the hang; the previous commit fixes it in the kernels. The override is off by default, so removing it does not change behavior. Signed-off-by: Zhixin Lin <[email protected]>
84f5fd9 to
ce8b200
Compare
Rebased onto the latest branch (includes #22101 ). Re-triggering CI. |
|
/bot run |
|
PR_Github #85065 [ run ] triggered by Bot. Commit: |
|
PR_Github #85065 [ run ] completed with state
|
|
After including the CI hang fix in #22101, CI didn't hang but it still failed. CI Agent Failure Analysis says:
|
|
I have reported the issue to @NVIDIA/trt-llm-torch-visual-gen-devs . This might be an occasional issue — I’ll try rerunning CI first. /bot run |
|
/bot run |
|
PR_Github #85329 [ run ] triggered by Bot. Commit: |
|
PR_Github #85329 [ run ] completed with state |
|
✅ LFS objects already in storage (8802 files) — no sync needed. These LFS-tracked files are already present in this repository's LFS storage:
|
…FMHA libraries - Register beam_shared_prefix ahead of the native libraries - Keep the paged-prefill error inside the locality-domain partition loop - Port NVIDIA#22089 (persistent context tile scheduler), NVIDIA#22216 (XQA multi-block for INT8 KV) and NVIDIA#20229 (locality-domain SM count for MLA trtllm-gen generation) into phasedFmha.cpp - Point the DSV4 split-KV test at TrtllmGenFmha Signed-off-by: Yihan Wang <[email protected]>
Description
When launched with PDL, the trtllm-gen context FMHA kernels read the cumulative sequence lengths before
griddepcontrol.wait, so they can see stale lengths written by the preceding kernel. This can hang the persistent context kernel or corrupt its output. It is most likely when the length-writing kernel runs directly before the FMHA, as in the BF16-KV MLA context path.griddepcontrol.waitbefore reading the sequence lengths or any other predecessor output. The update also brings in new FP8-Q / NVFP4-KV grouped kernels for sm100a, sm103a and sm107a.TRTLLM_GEN_FMHA_CONTEXT_STATIC_TILE_SCHEDULER). It was added as a workaround for this hang but did not fix it. The switch is off by default, so removing it does not change behavior.Test Coverage
Validated manually:
griddepcontrol.wait. Before this change, the sm107a MLA context kernels read the sequence lengths before the wait.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.Dev Engineer Review
fmhaDispatcher.cppnow usesTileScheduler::Persistentfor both support probing and execution.envUtilsAPI are removed. The old environment variable no longer changes scheduler selection.kernelMetaInfo.hupdates the generated version and exports many new kernel symbols.CudaArchDecl.hpinsSm107ato value5to match prebuilt archives.QA Engineer Review
No test changes.
Per-File QA Perspective
cpp/tensorrt_llm/common/envUtils.cpp: Verify builds after removing the static scheduler environment helper.cpp/tensorrt_llm/common/envUtils.h: Verify downstream code does not use the removed declaration.cpp/tensorrt_llm/kernels/fmhaDispatcher.cpp: Verify support probing and execution select the persistent scheduler consistently.cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/cubin/kernelMetaInfo.h: Verify the generated version and exported symbols match the packaged cubins.cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/trtllmGen_fmha_export/KernelParams.h: Verify the documented packed MLA stride fallback matches caller layouts.cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/trtllmGen_fmha_export/trtllm/gen/CudaArchDecl.h: Verify the pinnedSm107aenum value matches archive metadata and host selection.cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/lib/aarch64-linux-gnu/libTrtLlmGen.aandlibTrtLlmGenFmhaLib.a: Verify the regenerated ARM libraries link and load correctly.cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/lib/x86_64-linux-gnu/libTrtLlmGen.aandlibTrtLlmGenFmhaLib.a: Verify the regenerated x86-64 libraries link and load correctly..cubin.tar.zstarchives: Verify every exported cubin waits before its first global or TMA load, including the new grouped FP8-Q/NVFP4-KV variants.