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
b6f01bd9
Unverified
Commit
b6f01bd9
authored
Sep 22, 2025
by
Yizhou
Committed by
GitHub
Sep 22, 2025
Browse files
refactor: abstract graph mode support into platform interface (#25161)
Signed-off-by:
Yizhou Liu
<
liu_yizhou@outlook.com
>
parent
4cf71cc8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
7 deletions
+23
-7
vllm/config/__init__.py
vllm/config/__init__.py
+1
-1
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
vllm/platforms/xpu.py
vllm/platforms/xpu.py
+7
-6
No files found.
vllm/config/__init__.py
View file @
b6f01bd9
...
...
@@ -503,7 +503,7 @@ class VllmConfig:
if
self
.
compilation_config
.
pass_config
.
enable_sequence_parallelism
:
self
.
compilation_config
.
custom_ops
.
append
(
"+rms_norm"
)
if
current_platform
.
is_cuda_alike
()
or
current_platform
.
is_xpu
():
if
current_platform
.
support_static_graph_mode
():
# if cudagraph_mode is not explicitly set by users, set default
# value
if
self
.
compilation_config
.
cudagraph_mode
is
None
:
...
...
vllm/platforms/cuda.py
View file @
b6f01bd9
...
...
@@ -498,6 +498,10 @@ class CudaPlatformBase(Platform):
def
support_hybrid_kv_cache
(
cls
)
->
bool
:
return
True
@
classmethod
def
support_static_graph_mode
(
cls
)
->
bool
:
return
True
# NVML utils
# Note that NVML is not affected by `CUDA_VISIBLE_DEVICES`,
...
...
vllm/platforms/interface.py
View file @
b6f01bd9
...
...
@@ -587,6 +587,13 @@ class Platform:
"""
return
False
@
classmethod
def
support_static_graph_mode
(
cls
)
->
bool
:
"""
Returns if the graph mode is supported by the current platform.
"""
return
False
@
classmethod
def
use_sync_weight_loader
(
cls
)
->
bool
:
"""
...
...
vllm/platforms/rocm.py
View file @
b6f01bd9
...
...
@@ -477,3 +477,7 @@ class RocmPlatform(Platform):
@
classmethod
def
support_hybrid_kv_cache
(
cls
)
->
bool
:
return
True
@
classmethod
def
support_static_graph_mode
(
cls
)
->
bool
:
return
True
vllm/platforms/xpu.py
View file @
b6f01bd9
...
...
@@ -113,12 +113,9 @@ class XPUPlatform(Platform):
# lazy import to avoid circular import
from
vllm.config
import
CompilationLevel
,
CUDAGraphMode
compilation_config
=
vllm_config
.
compilation_config
if
compilation_config
.
cudagraph_mode
is
None
or
\
compilation_config
.
cudagraph_mode
.
max_cudagraph_mode
()
\
!=
CUDAGraphMode
.
NONE
:
logger
.
info
(
"[XPU] CUDA graph is not supported on XPU, disabling "
"cudagraphs. Fallback to cudagraph_mode=NONE"
)
compilation_config
.
cudagraph_mode
=
CUDAGraphMode
.
NONE
assert
compilation_config
.
cudagraph_mode
==
CUDAGraphMode
.
NONE
,
\
"CUDA graph mode should be NONE on XPU"
if
vllm_config
.
lora_config
is
not
None
:
compilation_config
.
level
=
CompilationLevel
.
NO_COMPILATION
...
...
@@ -169,6 +166,10 @@ class XPUPlatform(Platform):
def
support_hybrid_kv_cache
(
cls
)
->
bool
:
return
True
@
classmethod
def
support_static_graph_mode
(
cls
)
->
bool
:
return
False
@
classmethod
def
is_pin_memory_available
(
cls
):
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