Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
0fe01404
Unverified
Commit
0fe01404
authored
Oct 30, 2025
by
Zhewen Li
Committed by
GitHub
Oct 30, 2025
Browse files
[KV offload] Enable CPU KV offload on CUDA alike Platforms (#27770)
Signed-off-by:
zhewenli
<
zhewenli@meta.com
>
parent
4e68cc9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
tests/v1/kv_offload/test_cpu_offloading.py
tests/v1/kv_offload/test_cpu_offloading.py
+0
-4
vllm/v1/kv_offload/cpu.py
vllm/v1/kv_offload/cpu.py
+2
-2
No files found.
tests/v1/kv_offload/test_cpu_offloading.py
View file @
0fe01404
...
...
@@ -12,7 +12,6 @@ from tqdm import tqdm
from
vllm
import
LLM
,
SamplingParams
,
TokensPrompt
from
vllm.config
import
KVEventsConfig
,
KVTransferConfig
from
vllm.distributed.kv_events
import
BlockStored
,
KVEventBatch
from
vllm.platforms
import
current_platform
CPU_BLOCK_SIZES
=
[
16
,
48
]
...
...
@@ -64,9 +63,6 @@ class MockSubscriber:
self
.
sub
.
close
()
@
pytest
.
mark
.
skipif
(
not
current_platform
.
is_cuda
(),
reason
=
"CPU offloading only supported on CUDA"
)
@
pytest
.
mark
.
parametrize
(
"cpu_block_size"
,
CPU_BLOCK_SIZES
)
def
test_cpu_offloading
(
cpu_block_size
:
int
)
->
None
:
"""
...
...
vllm/v1/kv_offload/cpu.py
View file @
0fe01404
...
...
@@ -51,9 +51,9 @@ class CPUOffloadingSpec(OffloadingSpec):
self
,
kv_caches
:
dict
[
str
,
torch
.
Tensor
]
)
->
Iterator
[
tuple
[
type
[
LoadStoreSpec
],
type
[
LoadStoreSpec
],
OffloadingHandler
]]:
if
not
self
.
_handler
:
if
not
current_platform
.
is_cuda
():
if
not
current_platform
.
is_cuda
_alike
():
raise
Exception
(
"CPU Offloading is currently only supported on CUDA GPUs"
"CPU Offloading is currently only supported on CUDA
-alike
GPUs"
)
layer_names
=
list
(
kv_caches
.
keys
())
...
...
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