[https://nvbugs/6330273][fix] Reserve worst-case SWA slots to avoid single-request deadlock - #15588
Conversation
📝 WalkthroughWalkthroughAdds SWA-aware minimum-slot floor logic to ChangesSWA-aware minimum slot floor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #55487 [ run ] triggered by Bot. Commit: |
|
PR_Github #55487 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
/bot run --disable-fail-fast |
|
PR_Github #55940 [ run ] triggered by Bot. Commit: |
|
PR_Github #55940 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #56354 [ run ] triggered by Bot. Commit: |
|
PR_Github #56354 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #56425 [ run ] triggered by Bot. Commit: |
|
PR_Github #56425 [ run ] completed with state
|
…ingle-request deadlock When a sliding-window attention (SWA) layer has window_size <= tokens_per_block, the instantaneous in-window block count oscillates between 1 and 2 as the window slides across block boundaries. Sizing the pool to the minimum (1) could leave a lone request unable to obtain the 2nd block it needs mid-generation, deadlocking. Floor the per-pool-group minimum slots at the worst-case in-window span, ceil((window_size - 1) / tokens_per_block) + 1 plus sink blocks, computed per attention life cycle. Full-attention life cycles use the largest SWA floor (all attention life cycles see the same seq_len, so it is a valid lower bound). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… SWA min-slots floor The SWA worst-case min_slots floor keeps the in-window blocks resident, so the GPU level can no longer be shrunk below the window's block requirement and in-window pages are not dropped/migrated under memory pressure. Rework the two event-manager tests to use a small window (small floor) with more committed blocks than fit after the shrink, and assert per-layer-group event well-formedness (events emitted for each layer group, correct cache_level diff, hashes previously stored) instead of cross-group symmetry / exact counts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
|
/bot run --disable-fail-fast |
|
PR_Github #56960 [ run ] triggered by Bot. Commit: |
|
PR_Github #56960 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
1 similar comment
|
/bot run --disable-fail-fast |
|
PR_Github #58170 [ run ] triggered by Bot. Commit: |
|
PR_Github #58170 [ run ] completed with state |
|
@yizhang-nv could you review this? |
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
… KVCacheManagerV2 Translate two main-branch Python changes in runtime/kv_cache_manager_v2/ into the C++ backend under cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/: Translated from: - 17190cf [feat] add commit min snapshot for SSM reuse (NVIDIA#15752) config: drop HelixConfig/ssm_reuse_interval, add commit_min_snapshot; page: add SsmCommittedPage + UncommittedPage::convertToSsmCommitted; blockRadixTree: unlinkPage(expectedPage) guard + snapshot-length-aware SSM match truncation; kvCache: commit(is_end), _commitBlock(commitSsm,moveSsm), rewritten _snapshotSsmToTreeBlock, new _copyPageToTreeBlock and _snapshotPartialBlockToTree, plus commit_min_snapshot assert relaxations; nanobind: commit(is_end) and config/manager surface updates. - 52fc8f4 [fix] Reserve worst-case SWA slots to avoid single-request deadlock (NVIDIA#15588, nvbugs/6330273) storageManager::computeMinSlotsFromConstraints SWA worst-case floor; lifeCycleRegistry getStaleRange comment. Also in this change: - Mirror the Python Block._release_pages() eager reclaim into C++ Block::releasePages()/removeSubtree so page reclamation does not depend on ~Block() destruction timing. - Add kv::AssertionError + a nanobind translator to Python AssertionError so config validation and the commit history-alignment check match the Python backend's exception type. - Add white-box reuse-tree introspection helpers (attention/swa/ssm life-cycle ids, reuse_match_pages) to the C++ _introspection submodule and _introspection.py, and route the shared tests through them instead of Python-only internals. - Adapt the SWA event-manager tests (small window; deeper load for the migration test to force both pool groups to migrate under the new slot floor). - _core/_kv_cache.py: add the same VIRTUAL_STOP loop-break/partial-snapshot guard the C++ commit() uses, keeping the two backends behaviourally aligned. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
Summary by CodeRabbit
Description
When a sliding-window attention (SWA) layer is configured with
window_size <= tokens_per_block, the number of in-window blocks needed oscillates between 1 and 2 as the window slides across block boundaries. The live window for a step is[history_length + 1 - window_size, history_length](the+ 1accounts for the in-flight input token that always attends within the window). When those tokens straddle a block boundary, two blocks are live simultaneously, even thoughwindow_size <= tokens_per_block.Previously the per-pool-group minimum slot floor was
1per life cycle. With a tight quota this could size an SWA pool to a single slot, so a lone request could not obtain the 2nd block it needs mid-generation and the manager would deadlock — unable to serve even one request.This change floors the per-pool-group minimum slots at the worst-case in-window span:
computed per attention life cycle. Full-attention life cycles use the largest SWA floor among all attention life cycles — a valid lower bound because all attention life cycles see the same
seq_len. SSM / non-attention life cycles keep a floor of 1. The floor flows into_min_quota_for_level, so the GPU quota is bumped up when needed to guarantee a single request can always make progress.A clarifying comment was also added to
AttnLifeCycle.get_stale_rangedocumenting why the+ 1in the window boundary is intentional.🤖 Generated with Claude Code