Skip to content

Commit

Permalink
Update vllm/v1/engine/core.py
Browse files Browse the repository at this point in the history
Co-authored-by: Chen Zhang <zhangch99@outlook.com>
  • Loading branch information
ruisearch42 and heheda12345 authored Feb 12, 2025
1 parent 42872e3 commit 20e45cd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions vllm/v1/engine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,9 @@ def _initialize_kv_caches(self,
kv_cache_config = get_kv_cache_config(vllm_config, kv_cache_spec,
available_gpu_memory)
kv_cache_configs.append(kv_cache_config)
if num_gpu_blocks is None:
num_gpu_blocks = kv_cache_config.num_blocks
elif num_gpu_blocks != kv_cache_config.num_blocks:
raise NotImplementedError(
"num_gpu_blocks need to be the same across workers: "
f"{num_gpu_blocks} != {kv_cache_config.num_blocks}")
assert num_gpu_blocks is not None
assert len(set(config.num_blocks for config in kv_cache_configs)) == 1,
f"num_gpu_blocks need to be the same across workers: {num_gpu_blocks} != {kv_cache_config.num_blocks}"
num_gpu_blocks = kv_cache_configs[0].num_blocks
num_cpu_blocks = 0

Check failure on line 90 in vllm/v1/engine/core.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff

vllm/v1/engine/core.py:89:81: SyntaxError: Expected an expression

Check failure on line 90 in vllm/v1/engine/core.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff

vllm/v1/engine/core.py:90:1: SyntaxError: Unexpected indentation

Check failure on line 90 in vllm/v1/engine/core.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff (E501)

vllm/v1/engine/core.py:90:81: E501 Line too long (114 > 80)

# Initialize kv cache and warmup the execution
Expand Down

0 comments on commit 20e45cd

Please sign in to comment.