[https://nvbugs/6248764][fix] Normalize non-sliding KV windows to full attention in AutoDeploy - #14906
Conversation
📝 WalkthroughWalkthroughThe PR fixes KV cache pool grouping by detecting and normalizing oversized ChangesKVCache Pool Grouping Normalization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
…l attention in AutoDeploy The AutoDeploy kvcache transform keyed KV-cache pool grouping off the raw KVPagedResourceHandler.sliding_window (via __eq__). A layer whose sliding_window is >= max_seq_len can never slide and is functionally full attention, but it still compared unequal to the full-attention handlers (sliding_window=0), forking a redundant single-window pool. For google/gemma-3-1b-it run with max_seq_len=511, the local layers' sliding_window=512 produced a window=512 pool alongside the global window=511 pool, tripping the trtllm backend's uniform-cache requirement: "KV resources are not uniform ... requires all KV caches to share a single pool." Normalize sliding_window to 0 when it is >= max_seq_len before grouping, so such layers share the full-attention pool. Mirrors the KVCacheManager window clamp in resource_manager.py for the shim/grouping path. Signed-off-by: Yueh-Ting Chen <yuehtingc@nvidia.com>
…ry test The non-uniform KV pool failure for test_autodeploy_from_registry[google_gemma-3-1b-it-False] is resolved by normalizing non-sliding KV windows to full attention, so remove its SKIP waiver. Signed-off-by: Yueh-Ting Chen <yuehtingc@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #51834 [ run ] triggered by Bot. Commit: |
|
PR_Github #51834 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51894 [ run ] triggered by Bot. Commit: |
|
PR_Github #51894 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #52199 [ run ] triggered by Bot. Commit: |
|
PR_Github #52199 [ run ] completed with state |
…l attention in AutoDeploy (NVIDIA#14906) Signed-off-by: Yueh-Ting Chen <yuehtingc@nvidia.com> Signed-off-by: NVFB <186336021+NVFB@users.noreply.github.com>
…l attention in AutoDeploy (NVIDIA#14906) Signed-off-by: Yueh-Ting Chen <yuehtingc@nvidia.com>
A KV-cache layer whose
sliding_window >= max_seq_lencan never slide and is functionally full attention. The AutoDeploy kvcache transform was keying pool grouping off the rawsliding_window, so such a layer forked its own pool and tripped the trtllm backend's uniform-cache requirement.For
google/gemma-3-1b-itatmax_seq_len=511, the local layers'sliding_window=512produced awindow=512pool alongside the globalwindow=511pool, failing with:KV resources are not uniform ... requires all KV caches to share a single pool.This normalizes
sliding_windowto0(full attention) when it is>= max_seq_lenbefore grouping, so the layer shares the full-attention pool.Test coverage
test_autodeploy_from_registry[google_gemma-3-1b-it-False].Summary by CodeRabbit
Bug Fixes
Tests