A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 12, 17:15 UTC
[Bugfix] Fix block size in block_table with PCP (#29094)
Signed-off-by: Livinfly <luojie3m@gmail.com>
Jie Luo committed
Nov 22, 2025 at 09:34 UTC
5c8f2adf50e0cf2c5acf908ac796089cc45abdcf
1 file changed
+9
-2
vllm/v1/worker/block_table.py
+9
-2
@@ -84,7 +84,7 @@ class BlockTable:
84
self.pcp_world_size = get_pcp_group().world_size
85
self.pcp_rank = get_pcp_group().rank_in_group
86
except AssertionError:
87
- # DCP might not be initialized in testing
87
+ # PCP might not be initialized in testing
88
self.pcp_world_size = 1
89
self.pcp_rank = 0
90
try:
@@ -268,6 +268,11 @@ class MultiGroupBlockTable:
268
# (max_model_len//dcp_world_size) tokens in kvcache,
269
# so the block_size which used for calc max_num_blocks_per_req
270
# must be multiplied by dcp_world_size.
271
+ try:
272
+ pcp_world_size = get_pcp_group().world_size
273
+ except AssertionError:
274
+ # PCP might not be initialized in testing
275
+ pcp_world_size = 1
276
try:
277
dcp_world_size = get_dcp_group().world_size
278
except AssertionError:
@@ -280,12 +285,14 @@ class MultiGroupBlockTable:
285
f"must match block_sizes length ({len(block_sizes)})"
286
)
287
288
+ total_cp_world_size = dcp_world_size * pcp_world_size
289
+
290
self.block_tables = [
291
BlockTable(
292
block_size,
293
max_num_reqs,
294
max(
288
- cdiv(max_model_len, block_size * dcp_world_size),
295
+ cdiv(max_model_len, block_size * total_cp_world_size),
296
1 + num_speculative_tokens,
297
),
298
max_num_batched_tokens,