[https://nvbugs/6248769][fix] AutoDeploy: clamp KV pool window to max_seq_len#14907
[https://nvbugs/6248769][fix] AutoDeploy: clamp KV pool window to max_seq_len#14907MrGeva wants to merge 1 commit into
Conversation
|
/bot run |
📝 WalkthroughWalkthroughThe change modifies ChangesKV Cache Resource Management
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
PR_Github #51837 [ run ] triggered by Bot. Commit: |
…_seq_len Mixed sliding-window / full-attention models (e.g. Ministral-8B-Instruct-2410) report a full-attention sliding_window larger than max_seq_len. In _identify_managed_kv_resources the effective window was used unclamped as the pool key, producing two distinct pools (e.g. 512 and 32768 under max_seq_len=512). With the TRTLLM attention backend (requires_uniform_kv_caches) this tripped "KV resources are not uniform" and failed engine build. Clamp the effective window to max_seq_len so windows that reach or exceed max_seq_len collapse into a single concrete pool key. Safe because at most max_seq_len tokens are ever cached. Signed-off-by: Eran Geva <19514940+MrGeva@users.noreply.github.com>
a6bf30e to
6475266
Compare
|
/bot run |
|
PR_Github #51839 [ run ] triggered by Bot. Commit: |
|
PR_Github #51837 [ run ] completed with state |
|
PR_Github #51839 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51895 [ run ] triggered by Bot. Commit: |
|
PR_Github #51895 [ run ] completed with state
|
Mixed sliding-window / full-attention models (e.g.
mistralai/Ministral-8B-Instruct-2410) report a full-attentionsliding_windowlarger thanmax_seq_len. InCachedSequenceInterface._identify_managed_kv_resources, the effective window was used unclamped as the KV pool key, producing two distinct pools (e.g. 512 and 32768 undermax_seq_len=512). With the TRTLLM attention backend (requires_uniform_kv_caches=True) this trippedRuntimeError: KV resources are not uniform ... requires all V caches to share a single pooland failed the engine build.This clamps the effective window to
max_seq_lenso windows that reach or exceedmax_seq_lencollapse into a single concrete pool key. Safe because at mostmax_seq_lentokens are ever cached.Summary by CodeRabbit
Bug Fixes
Description
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)
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.