[Bugfix] Align block table for TRTLLM MLA edge-case (#39324)

Signed-off-by: Benjamin Chislett <bchislett@nvidia.com>
This commit is contained in:
Benjamin Chislett
2026-05-06 11:17:02 -07:00
committed by GitHub
parent 27702f6d08
commit 38e16678ba
2 changed files with 12 additions and 0 deletions
+7
View File
@@ -257,6 +257,13 @@ class MultiGroupBlockTable:
f"must match block_sizes length ({len(block_sizes)})"
)
# Align to a multiple of (128 / block_size) as required
# by some attention backends such as TRTLLM (#39324)
max_num_blocks = [
cdiv(n, 128 // bs) * (128 // bs) if bs <= 128 else n
for n, bs in zip(max_num_blocks, block_sizes)
]
self.block_tables = [
BlockTable(
block_size,