Skip to content

Conversation

@bobboli
Copy link
Collaborator

@bobboli bobboli commented Dec 9, 2025

Description

This PR adds support for Skip Softmax Attention, as described in https://arxiv.org/abs/2512.12087, which is a add-on feature for FlashAttention style kernels that allows dynamic sparse attention.

  • On Hopper, the implementation is integrated into fmha_v2 for prefilling.
  • On Blackwell, the feature supported by Trtllm-Gen kernels for both prefilling and decoding (provided as cubins).
  • Add 3rd Sparse Attention algorithm, skip_softmax, and provide necessary runtime modifications.

Anticipated API:

Through LLM API:

from tensorrt_llm import LLM
from tensorrt_llm.llmapi import SkipSoftmaxAttentionConfig
sparse_attention_config = SkipSoftmaxAttentionConfig(threshold_scale_factor=1000.0)
# Additionally, the threshold_scale_factor for prefill and decode could be separately configured.
sparse_attention_config = SkipSoftmaxAttentionConfig(threshold_scale_factor={"prefill": 1000.0, "decode": 500.0})
llm = LLM(
   model="Qwen/Qwen3-30B-A3B-Instruct-2507",
   sparse_attention_config=sparse_attention_config,
   # Other LLM arguments...
)

Through YAML config:

cat >extra_llm_api_options.yaml <<EOF
sparse_attention_config:
    algorithm: skip_softmax
    threshold_scale_factor: 1000.0
EOF

# Additionally, the threshold_scale_factor for prefill and decode could be separately configured.
cat >extra_llm_api_options.yaml <<EOF
sparse_attention_config:
    algorithm: skip_softmax
    threshold_scale_factor: 
        prefill: 1000.0
        decode: 500.0
EOF

trtllm-serve Qwen/Qwen3-30B-A3B-Instruct-2507 --extra_llm_api_options extra_llm_api_options.yaml

Known issues:

  • fmha_v2 FP8 + Skip Softmax attention has accuracy issues.
  • XQA based decoding on Hopper has not been integrated yet.

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)

  • 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

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

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.

@bobboli bobboli requested review from a team as code owners December 9, 2025 03:39
@bobboli
Copy link
Collaborator Author

bobboli commented Dec 9, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #27527 [ run ] triggered by Bot. Commit: 1e8d3b2

@tensorrt-cicd
Copy link
Collaborator

PR_Github #27527 [ run ] completed with state FAILURE. Commit: 1e8d3b2
LLM/main/L0_MergeRequest_PR #21007 (Blue Ocean) completed with status: ABORTED

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 10, 2025

/bot run --disable-fail-fast

@Tom-Zheng Tom-Zheng force-pushed the feat/skip_softmax_attention branch from 1e8d3b2 to 712ddd1 Compare December 11, 2025 08:29
@bobboli
Copy link
Collaborator Author

bobboli commented Dec 11, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #27826 [ run ] triggered by Bot. Commit: 712ddd1

@Tom-Zheng
Copy link
Collaborator

@bobboli this commit lacks sign-off: e72fb02. Would you pls squash the commits (they will be squashed anyway), or fix the sign-off?

@bobboli bobboli force-pushed the feat/skip_softmax_attention branch 2 times, most recently from 3a05728 to 0309317 Compare December 11, 2025 17:29
@bobboli
Copy link
Collaborator Author

bobboli commented Dec 11, 2025

/bot kill

@tensorrt-cicd
Copy link
Collaborator

PR_Github #27888 [ kill ] triggered by Bot. Commit: 0309317

@tensorrt-cicd
Copy link
Collaborator

PR_Github #27888 [ kill ] completed with state SUCCESS. Commit: 0309317
Successfully killed previous jobs for commit 0309317

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 11, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #27892 [ run ] triggered by Bot. Commit: 0309317

@tensorrt-cicd
Copy link
Collaborator

PR_Github #27892 [ run ] completed with state FAILURE. Commit: 0309317
/LLM/main/L0_MergeRequest_PR pipeline #21297 completed with status: 'FAILURE'

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 12, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #28002 [ run ] triggered by Bot. Commit: 785ddcb

@tensorrt-cicd
Copy link
Collaborator

PR_Github #28002 [ run ] completed with state SUCCESS. Commit: 785ddcb
/LLM/main/L0_MergeRequest_PR pipeline #21387 completed with status: 'FAILURE'

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 13, 2025

/bot run --disable-fail-fast

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 18, 2025

/bot run --reuse-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #28951 [ run ] triggered by Bot. Commit: c45de57

@tensorrt-cicd
Copy link
Collaborator

PR_Github #28951 [ run ] completed with state SUCCESS. Commit: c45de57
/LLM/main/L0_MergeRequest_PR pipeline #22179 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@PerkzZheng
Copy link
Collaborator

/bot run --reuse-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #28991 [ run ] triggered by Bot. Commit: c45de57

@tensorrt-cicd
Copy link
Collaborator

PR_Github #28991 [ run ] completed with state SUCCESS. Commit: c45de57
/LLM/main/L0_MergeRequest_PR pipeline #22215 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@Tom-Zheng
Copy link
Collaborator

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29088 [ run ] triggered by Bot. Commit: c45de57

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29088 [ run ] completed with state SUCCESS. Commit: c45de57
/LLM/main/L0_MergeRequest_PR pipeline #22306 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@Tom-Zheng
Copy link
Collaborator

/bot run --reuse-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29132 [ run ] triggered by Bot. Commit: c45de57

@EmmaQiaoCh
Copy link
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29139 [ run ] triggered by Bot. Commit: 0ee0cd9

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29139 [ run ] completed with state SUCCESS. Commit: 0ee0cd9
/LLM/main/L0_MergeRequest_PR pipeline #22346 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 20, 2025

/bot run --reuse-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29231 [ run ] triggered by Bot. Commit: 0ee0cd9

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29231 [ run ] completed with state FAILURE. Commit: 0ee0cd9
/LLM/main/L0_MergeRequest_PR pipeline #22436 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 20, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29249 [ run ] triggered by Bot. Commit: eada0bc

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29249 [ run ] completed with state SUCCESS. Commit: eada0bc
/LLM/main/L0_MergeRequest_PR pipeline #22452 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@bobboli
Copy link
Collaborator Author

bobboli commented Dec 21, 2025

/bot run --reuse-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29283 [ run ] triggered by Bot. Commit: eada0bc

@tensorrt-cicd
Copy link
Collaborator

PR_Github #29283 [ run ] completed with state SUCCESS. Commit: eada0bc
/LLM/main/L0_MergeRequest_PR pipeline #22481 completed with status: 'SUCCESS'

@bobboli bobboli merged commit a66eeab into NVIDIA:main Dec 21, 2025
5 checks passed
@Tom-Zheng Tom-Zheng deleted the feat/skip_softmax_attention branch December 21, 2025 16:05
@bobboli bobboli restored the feat/skip_softmax_attention branch December 22, 2025 06:19
lkomali pushed a commit to lkomali/TensorRT-LLM that referenced this pull request Dec 22, 2025
Signed-off-by: Bo Li <[email protected]>
Signed-off-by: Tian Zheng <[email protected]>
Co-authored-by: Tian Zheng <[email protected]>
Signed-off-by: lkomali <[email protected]>
codego7250 pushed a commit to codego7250/TensorRT-LLM that referenced this pull request Dec 22, 2025
Signed-off-by: Bo Li <[email protected]>
Signed-off-by: Tian Zheng <[email protected]>
Co-authored-by: Tian Zheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants