Skip to content

[https://nvbugs/6525898][fix] Append a constraint of _max_resident_sequences() + reserved-dummy… - #17071

Open
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6525898
Open

[https://nvbugs/6525898][fix] Append a constraint of _max_resident_sequences() + reserved-dummy…#17071
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6525898

Conversation

@trtllm-agent

@trtllm-agent trtllm-agent commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: With avg_seq_len unset no constraints are emitted, so the SSM pool group got no min_slots floor and the ratio-based grain split rounded it to 31 slots, below the 34 live/dummy slots __init__ requires.
  • Fix: Append a constraint of _max_resident_sequences() + reserved-dummy zero-capacity KVCacheDescs, which floors the SSM pool without adding attention pages.
  • 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

Dev Engineer Review

  • Consolidates required SSM slot sizing through _num_required_state_slots().
  • Adds zero-capacity KVCacheDesc constraints for required live and dummy slots.
  • Prevents the V2 Mamba SSM pool from being under-allocated when avg_seq_len is unset.
  • Does not increase attention page allocation.
  • Removes one valid waiver entry without unrelated configuration changes.

QA Engineer Review

  • Modified test_v2_hybrid_typical_batch_splits_capacity_across_ssm_states_and_dummies.
  • Added test_v2_hybrid_constrains_ssm_pool_to_live_slot_floor.
  • Neither test is listed in tests/integration/test_lists/ for CI (test-db/) or manual QA (qa/) coverage.
  • Verdict: needs follow-up.

@coderabbitai

coderabbitai Bot commented Jul 30, 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: 004948f6-df68-421b-b5f5-111fbc7ba163

📥 Commits

Reviewing files that changed from the base of the PR and between 8bc2e14 and e68d27d.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
  • tests/integration/test_lists/waives.txt
  • tests/unittest/_torch/executor/test_mamba_cache_manager.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/integration/test_lists/waives.txt
  • tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py

Walkthrough

MambaHybridCacheManagerV2 now centralizes required live state-slot calculation and applies the full live and reserved-dummy slot floor to SSM cache constraints. Regression coverage was added, and one integration waiver was removed.

Changes

Mamba SSM cache floor

Layer / File(s) Summary
Centralize required state slots
tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
Adds _num_required_state_slots() and uses it for initialization and minimum live GPU quota calculation.
Enforce and validate the SSM floor
tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py, tests/unittest/_torch/executor/test_mamba_cache_manager.py, tests/integration/test_lists/waives.txt
Adds an SSM constraint for all required live and reserved-dummy slots, reuses a shared zero-capacity descriptor, adds regression coverage, and removes the related integration waiver.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: simengliu-nv, schetlur-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the bug fix and describes the added constraint for required Mamba cache slots.
Description check ✅ Passed The description explains the root cause and fix, links the bug, and includes a test plan; the omitted checklist does not prevent review.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

MambaHybridCacheManagerV2.__init__ requires the SSM pool to hold one slot
per resident lineage plus every reserved dummy slot. When avg_seq_len is
unset, _build_base_config emits no constraints, so the storage manager
received no min_slots floor for the SSM pool group; only the fallback
typical_step steered the pool ratio. A ratio is not a floor, so the
grain-based split rounded the SSM pool below the required count and
initialization failed with 'The V2 Mamba state pool has only 31 slots but
needs at least 34 live/dummy slots'.

Emit the live/dummy slot count as an explicit constraint. The descriptors
carry no capacity, so the attention pool floor is unchanged.

Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
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.

2 participants