[None][fix] Fix stale sparse attention kwargs - #15460
Conversation
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
|
Caution Review failedAn error occurred during the review process. Please try again later. 📝 WalkthroughWalkthroughTwo small fixes adjust sparse attention handling in encoder-side paths: the cross-attention KV cache manager is now constructed with ChangesSparse Attention Encoder Path Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #54860 [ run ] triggered by Bot. Commit: |
|
PR_Github #54860 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #54879 [ run ] triggered by Bot. Commit: |
|
PR_Github #54879 [ run ] completed with state |
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com> Signed-off-by: GitLab CI Bot <gitlab-ci@nvidia.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com> Signed-off-by: GitLab CI Bot <gitlab-ci@nvidia.com>
Summary
sparse_metadata_paramsinstead of the user-facing sparse config.Details
PR #14687 renamed and split sparse-attention plumbing so
AttentionMetadataconsumesSparseMetadataParams, while KV-cache manager construction usessparse_attention_config.Two stale call sites remained on main:
KvCacheCreator._create_cross_kv_cache_manager()still passedsparse_attn_config=Noneto_create_kv_cache_manager(), whose parameter is nowsparse_attention_config.PyTorchModelEngine._prepare_tp_inputs_encoder()still passedsparse_attention_config=self.sparse_attention_configintoself.attn_backend.Metadata(...), butTrtllmAttentionMetadatanow expectssparse_metadata_params.This fixes both reported pre-merge CI failures:
_create_kv_cache_manager() got an unexpected keyword argument 'sparse_attn_config'TrtllmAttentionMetadata.__init__() got an unexpected keyword argument 'sparse_attention_config'Test Plan
git diff --checkpython3 -m py_compile tensorrt_llm/_torch/pyexecutor/_util.py tensorrt_llm/_torch/pyexecutor/model_engine.pypre-commit run --files tensorrt_llm/_torch/pyexecutor/_util.py tensorrt_llm/_torch/pyexecutor/model_engine.pypytest tests/unittest/_torch/executor/test_dual_pool_kv_cache.py -q, because the local Python environment does not havepytestinstalled.Summary by CodeRabbit