Repository navigation
[None][feat] VC-Attention-QK(16,8) recipes for PrimsTS FMHA context - #20068
harrisonzhy wants to merge 2 commits into
Conversation
|
@harrisonzhy — vendor promotion needs author action: Upstream attribution is unresolved for these source commits:
Fix: In the PR description, add missing PRs to vendors:
flashinfer-prims-ts:
upstream_prs:
- https://github.com/flashinfer-ai/flashinfer/pull/123
resolutions:
FULL_40_CHARACTER_SOURCE_SHA:
upstream_pr: https://github.com/flashinfer-ai/flashinfer/pull/123
reason: Explain the downstream adaptation or why this PR owns the change.The bot will recheck automatically on a later poll. |
Automated vendor metadata issue resolved; code review remains required.
Automated vendor metadata issue resolved; code review remains required.
|
@harrisonzhy — the PrimTS upstream refresh #20155 has merged. Please update this source-update PR before merging it. The new canonical source branch is
The publishing bot now targets the new dated canonical branch. After this source-update PR merges, its lock-only promotion will target that branch. The old |
920e6e4 to
d8bd052
Compare
58eb3de to
4b29c74
Compare
Automated vendor metadata issue resolved; code review remains required.
4b29c74 to
ee4d7d5
Compare
b3b8856 to
adb2aa8
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #81830 [ run ] triggered by Bot. Commit: |
|
PR_Github #81830 [ run ] completed with state
|
8952905 to
5cbc0d7
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #81964 [ run ] triggered by Bot. Commit: |
|
PR_Github #81964 [ run ] completed with state
|
5cbc0d7 to
0ab2727
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #82051 [ run ] triggered by Bot. Commit: |
chang-l
left a comment
There was a problem hiding this comment.
Approved w/ minor comments on doc changes
|
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. |
0ab2727 to
db30816
Compare
|
PR_Github #82051 [ run ] completed with state
|
|
/bot run |
|
PR_Github #82337 [ run ] triggered by Bot. Commit: |
|
PR_Github #82337 [ run ] completed with state
|
…S FMHA QuantAttentionConfig.vc_attention runs a recipe as VC-Attention on the TRTLLM backend: (bf16, fp8, (0, 0, 1)) keeps Q/K in BF16 with V as E4M3 residuals around 128-token tile means that the kernel restores (VC-Attention-QK16), and (fp8, fp8, (128, 128, 1)) adds Hadamard-rotated E4M3 Q/K scaled per 128 tokens (VC-Attention-QK8). vc_repair_budget replaces the tile means by that fraction of tokens as V repair rows and requires vc_attention. The VisualGen backend sends the recipe down the separate-QKV path as forward args, the cache-free adapter owns the per-layer V-Smooth preparation over the denoising steps and keys its plan on the demean phase and repair tile count, and FMHA libraries without the supports_vc_attention capability reject the request. Signed-off-by: Harrison Zhang <harrisonz@nvidia.com>
… 7087b06c2 Pins flashinfer-prims-ts to the fork lineage branch harrisonzhy/trtllm-prims-ts-dev_vc-attn-20261029: the canonical trtllm-prims-ts-dev-20261012 tip aa709061 plus the VC-Attention commits of flashinfer PRs 6296 (QK16), 6306 (QK8) and 6721 (fused preparation), cherry-picked. The vendored tree is a byte copy of the fork plus the compatibility patch, regenerated at the new revision with unchanged content. Signed-off-by: Harrison Zhang <harrisonz@nvidia.com>
db30816 to
5b5c3a2
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #82418 [ run ] triggered by Bot. Commit: |
@coderabbitai summary
Description
Adds the VC-Attention-QK16 and VC-Attention-QK8 recipes to the PrimTS FMHA in the VisualGen TRTLLM
attention backend, on top of the PrimTS context FMHA already on main.
prims_tspinned toharrisonzhy/trtllm-prims-ts-dev_vc-attn-20261029@ 7087b06c2: the canonicaltrtllm-prims-ts-dev-20261012tip (aa709061) plus one squashed commit per FlashInfer PR:flashinfer PR 6296 (VC-Attention-QK16),
flashinfer PR 6306 (VC-Attention-QK8) and
flashinfer PR 6721 (preparation fused into the
pre-pass kernels), cherry-picked. Lock and compatibility patch regenerated by
scripts/vendor/manage.py; thepatch content is unchanged.
QuantAttentionConfig.vc_attentionruns a recipe as VC-Attention:(bf16, fp8, (0, 0, 1))isVC-Attention-QK16 and
(fp8, fp8, (128, 128, 1))VC-Attention-QK8, on SM100/SM103 withTLLM_FMHA_LIBS=+prims_ts.vc_repair_budgetappends that fraction of tokens as V repair rows insteadof restoring the tile means (
0keeps the means) and requiresvc_attention.the repair budget or on the V-Smooth schedule, and passes them to the attention op as
AttentionForwardArgs.vc_operands. The PrimTS adapter only runs the matching plan, keyed on thedemean phase and repair tile count, which are compile-time plan options of the kernel. Requires equal Q
and K/V head counts, head dimension 128 and a dense mask; VC requests with a KV cache are rejected.
timestepthe attention already receives, like thetimestep-scheduled sparse backends (
sparse/timestep_phase.py): the top quarter of the timestep rangesmooths V with four regroupings, the rest runs plain E4M3 V. With CUDA graphs that phase is a graph key
(
vc_smooth_phase), so each phase replays its own graph.Vendor Promotion
Test Coverage
tests/unittest/_torch/visual_gen/test_visual_gen_args.py:vc_attentionon both recipes,vc_repair_budgetacceptance, bounds and rejection, non-TRTLLM and non-Blackwell rejection.tests/unittest/_torch/visual_gen/test_vc_timestep_phase.py: the timestep schedule and the graph key.tests/unittest/_torch/attention/test_prims_ts_attention_backend.py(GPU): both recipes with tile meansand with a repair budget, VC operands passed, SDPA match; VC rejected on paged-KV requests.
trtllm-serve, FLUX.3 klein-base text-to-image through theVisualGen API, both recipes with and without
vc_repair_budget: 0.005.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.