Skip to content

Commit 1deec3d

Browse files
committed
Fix line length violations
Signed-off-by: gholmes829 <[email protected]>
1 parent 4e63857 commit 1deec3d

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

vllm/v1/worker/gpu_worker.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,12 @@ def determine_available_memory(self) -> int:
243243
if (self.cache_config.enable_pp_prop_kv_cache
244244
and pp_group.world_size > 1
245245
and envs.VLLM_PP_LAYER_PARTITION):
246-
num_hidden_layers = self.model_config.hf_text_config.num_hidden_layers
246+
hf_config = self.model_config.hf_text_config
247+
num_hidden_layers = hf_config.num_hidden_layers
247248

248249
start_layer, end_layer = get_pp_indices(
249-
num_hidden_layers, pp_group.rank_in_group, pp_group.world_size)
250+
num_hidden_layers, pp_group.rank_in_group,
251+
pp_group.world_size)
250252
local_layers = end_layer - start_layer
251253
prop_kv_cache_bytes = int(kv_cache_memory_bytes *
252254
local_layers / num_hidden_layers)
@@ -263,16 +265,17 @@ def determine_available_memory(self) -> int:
263265
return prop_kv_cache_bytes
264266

265267
msg = (
266-
f"Initial free memory {GiB(self.init_snapshot.free_memory):.2f} "
267-
f"GiB, reserved {GiB(kv_cache_memory_bytes):.2f} GiB memory for "
268-
"KV Cache as specified by kv_cache_memory_bytes config and "
269-
"skipped memory profiling. This does not respect the "
270-
"gpu_memory_utilization config. Only use kv_cache_memory_bytes "
271-
"config when you want manual control of KV cache memory "
272-
"size. If OOM'ed, check the difference of initial free "
273-
"memory between the current run and the previous run "
274-
"where kv_cache_memory_bytes is suggested and update it "
275-
"correspondingly.")
268+
f"Initial free memory "
269+
f"{GiB(self.init_snapshot.free_memory):.2f} "
270+
f"GiB, reserved {GiB(kv_cache_memory_bytes):.2f} GiB memory "
271+
f"for KV Cache as specified by kv_cache_memory_bytes config "
272+
f"and skipped memory profiling. This does not respect the "
273+
f"gpu_memory_utilization config. Only use "
274+
f"kv_cache_memory_bytes config when you want manual control "
275+
f"of KV cache memory size. If OOM'ed, check the difference "
276+
f"of initial free memory between the current run and the "
277+
f"previous run where kv_cache_memory_bytes is suggested and "
278+
f"update it correspondingly.")
276279
logger.info(msg)
277280
return kv_cache_memory_bytes
278281

vllm/worker/worker.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,12 @@ def determine_available_kv_cache_memory(self,
241241
if (self.cache_config.enable_pp_prop_kv_cache
242242
and pp_group.world_size > 1
243243
and envs.VLLM_PP_LAYER_PARTITION):
244-
num_hidden_layers = self.model_config.hf_text_config.num_hidden_layers
244+
hf_config = self.model_config.hf_text_config
245+
num_hidden_layers = hf_config.num_hidden_layers
245246

246247
start_layer, end_layer = get_pp_indices(
247-
num_hidden_layers, pp_group.rank_in_group, pp_group.world_size)
248+
num_hidden_layers, pp_group.rank_in_group,
249+
pp_group.world_size)
248250
local_layers = end_layer - start_layer
249251
prop_kv_cache_bytes = int(kv_cache_memory_bytes *
250252
local_layers / num_hidden_layers)
@@ -263,15 +265,15 @@ def determine_available_kv_cache_memory(self,
263265
msg = (
264266
f"Initial free memory "
265267
f"{GiB(self.baseline_snapshot.free_memory):.2f} "
266-
f"GiB, reserved {GiB(kv_cache_memory_bytes):.2f} GiB memory for "
267-
"KV Cache as specified by kv_cache_memory_bytes config and "
268-
"skipped memory profiling. This does not respect the "
269-
"gpu_memory_utilization config. Only use kv_cache_memory_bytes "
270-
"config when you want manual control of KV cache memory "
271-
"size. If OOM'ed, check the difference of initial free "
272-
"memory between the current run and the previous run "
273-
"where kv_cache_memory_bytes is suggested and update it "
274-
"correspondingly.")
268+
f"GiB, reserved {GiB(kv_cache_memory_bytes):.2f} GiB memory "
269+
f"for KV Cache as specified by kv_cache_memory_bytes config "
270+
f"and skipped memory profiling. This does not respect the "
271+
f"gpu_memory_utilization config. Only use "
272+
f"kv_cache_memory_bytes config when you want manual control "
273+
f"of KV cache memory size. If OOM'ed, check the difference "
274+
f"of initial free memory between the current run and the "
275+
f"previous run where kv_cache_memory_bytes is suggested and "
276+
f"update it correspondingly.")
275277
logger.info(msg)
276278
return self.cache_config.kv_cache_memory_bytes
277279

0 commit comments

Comments
 (0)