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
4f6593b0
Unverified
Commit
4f6593b0
authored
Sep 11, 2025
by
Mengqing Cao
Committed by
GitHub
Sep 11, 2025
Browse files
[HybridKVCache][Platform] Add support_hybrid_kv_cache for platform (#24646)
Signed-off-by:
MengqingCao
<
cmq0113@163.com
>
parent
94e6b2d5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
2 deletions
+20
-2
vllm/config/__init__.py
vllm/config/__init__.py
+1
-2
vllm/platforms/cpu.py
vllm/platforms/cpu.py
+4
-0
vllm/platforms/cuda.py
vllm/platforms/cuda.py
+4
-0
vllm/platforms/interface.py
vllm/platforms/interface.py
+7
-0
vllm/platforms/rocm.py
vllm/platforms/rocm.py
+4
-0
No files found.
vllm/config/__init__.py
View file @
4f6593b0
...
@@ -3529,8 +3529,7 @@ class VllmConfig:
...
@@ -3529,8 +3529,7 @@ class VllmConfig:
# logger should only print warning message for hybrid models. As we
# logger should only print warning message for hybrid models. As we
# can't know whether the model is hybrid or not now, so we don't log
# can't know whether the model is hybrid or not now, so we don't log
# warning message here and will log it later.
# warning message here and will log it later.
if
not
(
current_platform
.
is_cuda
()
or
current_platform
.
is_rocm
()
if
not
current_platform
.
support_hybrid_kv_cache
():
or
current_platform
.
is_cpu
()):
# Hybrid KV cache manager is not supported on non-GPU platforms.
# Hybrid KV cache manager is not supported on non-GPU platforms.
self
.
scheduler_config
.
disable_hybrid_kv_cache_manager
=
True
self
.
scheduler_config
.
disable_hybrid_kv_cache_manager
=
True
if
self
.
kv_transfer_config
is
not
None
:
if
self
.
kv_transfer_config
is
not
None
:
...
...
vllm/platforms/cpu.py
View file @
4f6593b0
...
@@ -347,3 +347,7 @@ class CpuPlatform(Platform):
...
@@ -347,3 +347,7 @@ class CpuPlatform(Platform):
@
classmethod
@
classmethod
def
opaque_attention_op
(
cls
)
->
bool
:
def
opaque_attention_op
(
cls
)
->
bool
:
return
True
return
True
@
classmethod
def
support_hybrid_kv_cache
(
cls
)
->
bool
:
return
True
vllm/platforms/cuda.py
View file @
4f6593b0
...
@@ -571,6 +571,10 @@ class CudaPlatformBase(Platform):
...
@@ -571,6 +571,10 @@ class CudaPlatformBase(Platform):
"You can use float16 instead by explicitly setting the "
"You can use float16 instead by explicitly setting the "
"`dtype` flag in CLI, for example: --dtype=half."
)
"`dtype` flag in CLI, for example: --dtype=half."
)
@
classmethod
def
support_hybrid_kv_cache
(
cls
)
->
bool
:
return
True
# NVML utils
# NVML utils
# Note that NVML is not affected by `CUDA_VISIBLE_DEVICES`,
# Note that NVML is not affected by `CUDA_VISIBLE_DEVICES`,
...
...
vllm/platforms/interface.py
View file @
4f6593b0
...
@@ -586,6 +586,13 @@ class Platform:
...
@@ -586,6 +586,13 @@ class Platform:
"""
"""
raise
NotImplementedError
raise
NotImplementedError
@
classmethod
def
support_hybrid_kv_cache
(
cls
)
->
bool
:
"""
Returns if the hybrid kv cache is supported by the current platform.
"""
return
False
class
UnspecifiedPlatform
(
Platform
):
class
UnspecifiedPlatform
(
Platform
):
_enum
=
PlatformEnum
.
UNSPECIFIED
_enum
=
PlatformEnum
.
UNSPECIFIED
...
...
vllm/platforms/rocm.py
View file @
4f6593b0
...
@@ -498,3 +498,7 @@ class RocmPlatform(Platform):
...
@@ -498,3 +498,7 @@ class RocmPlatform(Platform):
f
"Your
{
gpu_name
}
GPU
{
compute_str
}
. "
f
"Your
{
gpu_name
}
GPU
{
compute_str
}
. "
"You can use float16 instead by explicitly setting the "
"You can use float16 instead by explicitly setting the "
"`dtype` flag in CLI, for example: --dtype=half."
)
"`dtype` flag in CLI, for example: --dtype=half."
)
@
classmethod
def
support_hybrid_kv_cache
(
cls
)
->
bool
:
return
True
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