Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,13 @@ void SharedPageLock::releasePageIndex()
{
int oldBaseIndex
= mUser.kvCache->updateBasePageIndex(mUser.beamIndex, mUser.ordinal, mUser.lifeCycle, kBadPageIndex.value());
// Mirrors Python assertion: old base index must match this page's slot ID.
TLLM_CHECK_DEBUG(oldBaseIndex == slotIdToPageIndexValue(page()->slotId()));
// Mirrors Python assertion: old base index must match this page's slot ID -- except for SSM
// pages, which are locked with kBadBlockOrdinal because they have no per-block index slot.
// updateBasePageIndex() tracks nothing for those and reports kBadPageIndex, so comparing
// against the page's slot would fail for every SSM page (_page.py SharedPageLock.unlock()
// carries the same exemption; the port dropped it).
TLLM_CHECK_DEBUG(oldBaseIndex
== (mUser.ordinal == kBadBlockOrdinal ? kBadPageIndex.value() : slotIdToPageIndexValue(page()->slotId())));
(void) oldBaseIndex;
}

Expand Down
Loading