[None][refactor] Refactor Skip Softmax Attention Interface - #14687
Merged
Conversation
bobboli
force-pushed
the
bli/skip-softmax-decouple-llm-vg
branch
26 times, most recently
from
May 29, 2026 13:15
03da487 to
0472e42
Compare
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
…cy tests WanTransformer3DModel.forward expects a normalized timestep in [0, 1] and rescales to the scheduler's 1000-step range internally. The direct-transformer accuracy tests in test_wan21_t2v_pipeline.py passed a raw timestep (500), which became 500000 after the internal rescale and drove the timestep embedding out of its trained range. NVFP4's 4-bit dynamic range amplified the resulting activation error, dropping NVFP4 end-to-end cosine similarity to 0.9426 (below the 0.95 threshold); the FP8 paths masked the same issue under their 0.99 tolerance. Pass a normalized timestep so the embedder receives the correct range. NVFP4 end-to-end cosine similarity recovers to 0.9643 and the FP8 paths are now numerically correct as well. Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
bobboli
force-pushed
the
bli/skip-softmax-decouple-llm-vg
branch
from
June 17, 2026 02:15
c945bea to
6817fb2
Compare
yuxianq
approved these changes
Jun 17, 2026
Collaborator
Author
|
/bot reuse-pipeline |
Collaborator
|
PR_Github #54722 [ reuse-pipeline ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #54722 [ reuse-pipeline ] completed with state |
lowsfer
added a commit
to lowsfer/TensorRT-LLM
that referenced
this pull request
Jun 17, 2026
Refactor NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs on main that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2), independent of KVCacheManagerV2: - _util.py: the cross KV-cache _create_kv_cache_manager() call passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=..., but AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path does. This is a pre-existing main regression surfaced by this PR's CI; kept in a dedicated commit separate from the KVCacheManagerV2 translation. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
lowsfer
added a commit
to lowsfer/TensorRT-LLM
that referenced
this pull request
Jun 18, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
lowsfer
added a commit
to lowsfer/TensorRT-LLM
that referenced
this pull request
Jun 18, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
xinhe-nv
pushed a commit
to tensorrt-cicd/TensorRT-LLM
that referenced
this pull request
Jun 23, 2026
1 task
xinhe-nv
pushed a commit
to tensorrt-cicd/TensorRT-LLM
that referenced
this pull request
Jun 24, 2026
7 tasks
liji-nv
pushed a commit
to liji-nv/TensorRT-LLM
that referenced
this pull request
Jul 7, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
liji-nv
pushed a commit
to liji-nv/TensorRT-LLM
that referenced
this pull request
Jul 7, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
liji-nv
pushed a commit
to liji-nv/TensorRT-LLM
that referenced
this pull request
Jul 7, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
liji-nv
pushed a commit
to liji-nv/TensorRT-LLM
that referenced
this pull request
Jul 8, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
liji-nv
pushed a commit
to liji-nv/TensorRT-LLM
that referenced
this pull request
Jul 9, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
lowsfer
added a commit
to lowsfer/TensorRT-LLM
that referenced
this pull request
Jul 9, 2026
These are pre-existing bugs on main (not caused by the KVCacheManagerV2 work) that this PR's CI surfaces; grouped here, separate from the squashed translation commit. 1) NVIDIA#14687 (Skip Softmax Attention Interface) renamed the AttentionMetadata field to sparse_metadata_params but left two stale kwargs that break all T5/BART encoder-decoder tests (both kv-v1 and kv-v2): - _util.py: cross KV-cache _create_kv_cache_manager() was passed sparse_attn_config=None; the parameter is sparse_attention_config. - model_engine.py: the encoder attention-metadata construction passed sparse_attention_config=...; AttentionMetadata expects sparse_metadata_params. Convert via to_sparse_metadata_params() like the decoder path. 2) create_perf_comparison_report.py raised FileNotFoundError when the sole perf test is skipped/waived (nvbugs/6329256) and no CSV is produced, failing the 'Create Perf Report' CI stage. Skip report generation gracefully when no perf CSVs exist, mirroring sanity_perf_check.py. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AttentionBackendinstances store loweredSparseParams, not public config objects.SkipSoftmaxParams.to_sparse_params()before backend construction, including ModelOptignorehandling.config.json.disabled_until_timestepand include the resulting Skip Softmax Attention phase in CUDA graph keys.Details
Sparse runtime params boundary
SparseParamsandSparseMetadataParams: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/attention_backend/sparse/params.py#L25TrtllmAttentionaccepts and stores lowered sparse runtime params: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/attention_backend/trtllm.py#L1114create_attention()forwardssparse_paramsinto backend constructors instead of exposing user config to backend instances: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/attention_backend/utils.py#L77Shared Skip Softmax Attention backend logic
sparse_attention_config.config_groups, allowing at most one Skip Softmax Attention group: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/attention_backend/sparse/skip_softmax.py#L60target_sparsitytothreshold_scale_factorlowering: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/attention_backend/sparse/skip_softmax.py#L124SkipSoftmaxSchedulerresolves concrete kernel params and handles VisualGen timestep-based disablement: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/attention_backend/sparse/skip_softmax.py#L282SkipSoftmaxParamsis the runtime object passed to the attention backend: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/attention_backend/sparse/skip_softmax.py#L420LLM lowering path
SkipSoftmaxAttentionConfigvalidatestarget_sparsity, resolves checkpoint defaults, lowers toSkipSoftmaxParams, and applies checkpointignorepatterns: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/llmapi/llm_args.py#L668ignorematching: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/modules/attention.py#L531VisualGen per-layer lowering and checkpoint calibration
SkipSoftmaxAttentionConfigfor runtime knobs such asthreshold_scale_factor,target_sparsity, anddisabled_until_timestep: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/visual_gen/sparse_attention.py#L46Nonefor ModelOpt-ignored layers orSkipSoftmaxParamsfor enabled layers: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/visual_gen/sparse_attention.py#L71module_nameand componentpretrained_configinto lowering: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/visual_gen/modules/attention.py#L203ignorepatterns are supported for multi-transformer checkpoints such astransformerandtransformer_2: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/visual_gen/sparse_attention.py#L107VisualGen timestep cutoff and CUDA graph keys
BaseDiffusionModelregisters the Skip Softmax Attention graph phase from the model-forwardtimestep: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/visual_gen/models/modeling.py#L38timestepas an internal scheduling signal and does not pass it to the raw attention op: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tensorrt_llm/_torch/visual_gen/attention_backend/trtllm.py#L291Docs and tests
ignorepatterns, timestep cutoff behavior, and per-model checkpoint metadata: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tests/unittest/_torch/visual_gen/sparse_attention/test_skip_softmax.py#L78ignorepatterns, and direct sparse checkpoint config lowering: https://github.com/bobboli/TensorRT-LLM/blob/bli/skip-softmax-decouple-llm-vg/tests/unittest/llmapi/test_llm_args.py#L2359Follow-ups
ignoreinconfig.json; this PR treats that as the supported sparse layer-disable path. Existinghf_quant_config.json/exclude_moduleshandling should remain a quantization compatibility concern, not the primary sparse-attention interface.Test plan
pre-commit run --files tensorrt_llm/_torch/attention_backend/sparse/skip_softmax.py tensorrt_llm/_torch/modules/attention.py tensorrt_llm/llmapi/llm_args.py tests/unittest/_torch/visual_gen/sparse_attention/test_skip_softmax.py tests/unittest/llmapi/test_llm_args.pypython3 -m py_compileandgit diff --check.