Skip to content

Commit ee2032a

Browse files
kzawora-intelabmfy
authored andcommitted
[Bugfix] Restore support for larger block sizes (vllm-project#11259)
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
1 parent 94c0de0 commit ee2032a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

vllm/config.py

+4
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,10 @@ def _verify_args(self) -> None:
917917
raise ValueError(
918918
"GPU memory utilization must be less than 1.0. Got "
919919
f"{self.gpu_memory_utilization}.")
920+
if (current_platform.is_cuda() and self.block_size is not None
921+
and self.block_size > 32):
922+
raise ValueError("CUDA Paged Attention kernel only supports "
923+
f"block sizes up to 32. Got {self.block_size}.")
920924

921925
def _verify_cache_dtype(self) -> None:
922926
if self.cache_dtype == "auto":

vllm/engine/arg_utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,12 @@ def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser:
424424
parser.add_argument('--block-size',
425425
type=int,
426426
default=EngineArgs.block_size,
427-
choices=[8, 16, 32],
427+
choices=[8, 16, 32, 64, 128],
428428
help='Token block size for contiguous chunks of '
429429
'tokens. This is ignored on neuron devices and '
430-
'set to max-model-len')
430+
'set to max-model-len. On CUDA devices, '
431+
'only block sizes up to 32 are supported. '
432+
'On HPU devices, block size defaults to 128.')
431433

432434
parser.add_argument(
433435
"--enable-prefix-caching",

0 commit comments

Comments
 (0)