Skip to content

[https://nvbugs/6248769][fix] In KVCacheManager.__init__, after resolving max_attention_window_vec and… - #14887

Closed
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6248769
Closed

[https://nvbugs/6248769][fix] In KVCacheManager.__init__, after resolving max_attention_window_vec and…#14887
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6248769

Conversation

@tensorrt-cicd

@tensorrt-cicd tensorrt-cicd commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: max_attention_window_vec is clamped to max_seq_len (512) by _resolve_max_attention_window_vec, but pool_configurations retained the unclamped sliding window (Ministral's 32768), so layers resolving to window 512 had no matching pool key → KeyError: 512.
  • Fix: In KVCacheManager.__init__, after resolving max_attention_window_vec and before _build_layer_to_pool_idx(), rebuild self.pool_configurations with window_size=min(pc.window_size, self.max_seq_len), keeping head_dim/dtype and pool indices intact.
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Summary by CodeRabbit

  • Bug Fixes

    • Fixed KV cache memory pool configuration to ensure window size values remain consistent with normalized attention specifications, improving overall cache memory management reliability and stability across different configurations
  • Tests

    • Re-enabled accuracy test for model registry functionality, restoring test coverage for model deployment and registration scenarios

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 825a2fd2-894e-4090-833f-64ae56a3715e

📥 Commits

Reviewing files that changed from the base of the PR and between c798fd9 and 324f098.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/pyexecutor/resource_manager.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

📝 Walkthrough

Walkthrough

KVCacheManager now imports replace from dataclasses to clamp per-pool window sizes to max_seq_len after computing the maximum attention window vector, maintaining consistency between per-pool metadata and clamped window sizes. A related test waiver is removed from the accuracy test skip list.

Changes

KV Cache Manager Window Clamping and Test Configuration Update

Layer / File(s) Summary
Window size clamping with dataclasses import
tensorrt_llm/_torch/pyexecutor/resource_manager.py
replace is added to the dataclasses import to enable remapping of per-pool pool_configurations entries after max_attention_window_vec computation, clamping each window_size to min(original_window_size, self.max_seq_len).
Accuracy test waiver removal
tests/integration/test_lists/waives.txt
A specific SKIP waiver entry for test_autodeploy_from_registry targeting mistralai_Ministral-8B-Instruct-2410-False is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#14870: Also removes a waived accuracy/test_llm_api_autodeploy.py::TestModelRegistryAccuracy test entry from waives.txt.
  • NVIDIA/TensorRT-LLM#14802: Modifies the waiver for the same accuracy/test_llm_api_autodeploy.py::TestModelRegistryAccuracy::test_autodeploy_from_registry[mistralai_Ministral-8B-Instruct-2410-False] test case.
  • NVIDIA/TensorRT-LLM#14854: Also updates the set of waived/skipped test cases in waives.txt.

Suggested reviewers

  • nvchenghaoz
  • xinhe-nv
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: clamping per-pool window_size values in KVCacheManager.init to resolve KeyError mismatches.
Description check ✅ Passed The description adequately explains the root cause, fix details, and test verification. However, PR checklist items are not explicitly checked off as required by the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@MrGeva MrGeva self-assigned this Jun 3, 2026
@MrGeva

MrGeva commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #51816 [ run ] triggered by Bot. Commit: 324f098 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #51816 [ run ] completed with state SUCCESS. Commit: 324f098
/LLM/main/L0_MergeRequest_PR pipeline #41179 completed with status: 'FAILURE'

CI Report

⚠️ 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

Link to invocation

@MrGeva MrGeva closed this Jun 4, 2026
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.

3 participants