[TPU] Increase block size and reset block shapes (#16458)
This commit is contained in:
@@ -76,9 +76,9 @@ class TpuPlatform(Platform):
|
||||
from vllm.config import CompilationLevel
|
||||
|
||||
cache_config = vllm_config.cache_config
|
||||
# For v0, the default block size is 16.
|
||||
if cache_config and cache_config.block_size is None:
|
||||
cache_config.block_size = 16
|
||||
|
||||
compilation_config = vllm_config.compilation_config
|
||||
|
||||
# TPU only supports DYNAMO_ONCE compilation level
|
||||
@@ -101,16 +101,18 @@ class TpuPlatform(Platform):
|
||||
if envs.VLLM_USE_V1:
|
||||
from vllm.v1.attention.backends.pallas import (
|
||||
PallasAttentionBackend)
|
||||
cache_config.block_size = PallasAttentionBackend.get_page_size(
|
||||
vllm_config)
|
||||
min_page_size = PallasAttentionBackend.get_min_page_size(
|
||||
vllm_config)
|
||||
if min_page_size > vllm_config.cache_config.block_size:
|
||||
if min_page_size > cache_config.block_size:
|
||||
logger.warning(
|
||||
"Increase the page size from %s to %s to make sure there's"
|
||||
"no SMEM OOM",
|
||||
vllm_config.cache_config.block_size,
|
||||
cache_config.block_size,
|
||||
min_page_size,
|
||||
)
|
||||
vllm_config.cache_config.block_size = min_page_size
|
||||
cache_config.block_size = min_page_size
|
||||
|
||||
parallel_config = vllm_config.parallel_config
|
||||
scheduler_config = vllm_config.scheduler_config
|
||||
|
||||
Reference in New Issue
Block a user