Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
kecinstone
2024pra-vllm
Commits
0b7db411
You need to sign in or sign up before continuing.
Unverified
Commit
0b7db411
authored
Jun 26, 2023
by
Zhuohan Li
Committed by
GitHub
Jun 26, 2023
Browse files
[Bug] Fix the OOM condition for CPU cache (#260)
parent
471a7a45
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
vllm/engine/llm_engine.py
vllm/engine/llm_engine.py
+1
-1
vllm/worker/worker.py
vllm/worker/worker.py
+2
-0
No files found.
vllm/engine/llm_engine.py
View file @
0b7db411
...
...
@@ -128,7 +128,7 @@ class LLMEngine:
logger
.
info
(
f
'# GPU blocks:
{
num_gpu_blocks
}
, '
f
'# CPU blocks:
{
num_cpu_blocks
}
'
)
if
num_gpu_blocks
<=
0
or
num_cpu_blocks
<=
0
:
if
num_gpu_blocks
<=
0
:
raise
ValueError
(
"No available memory for the cache blocks. "
"Try increasing `gpu_memory_utilization` when "
"initializing the engine."
)
...
...
vllm/worker/worker.py
View file @
0b7db411
...
...
@@ -113,6 +113,8 @@ class Worker:
num_gpu_blocks
=
int
((
total_gpu_memory
*
gpu_memory_utilization
-
peak_memory
)
//
cache_block_size
)
num_cpu_blocks
=
int
(
cpu_swap_space
//
cache_block_size
)
num_gpu_blocks
=
max
(
num_gpu_blocks
,
0
)
num_cpu_blocks
=
max
(
num_cpu_blocks
,
0
)
torch
.
cuda
.
empty_cache
()
# Reset the seed to ensure that the random state is not affected by
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment