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
f8c3af2d
Unverified
Commit
f8c3af2d
authored
Apr 04, 2026
by
Xiaoshuang Wang
Committed by
GitHub
Apr 03, 2026
Browse files
[vLLM IR] add `import_ir_kernels()` to support OOT platforms (#38807)
Signed-off-by:
Icey
<
1790571317@qq.com
>
parent
50cd5674
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
vllm/config/kernel.py
vllm/config/kernel.py
+5
-2
vllm/platforms/interface.py
vllm/platforms/interface.py
+9
-0
No files found.
vllm/config/kernel.py
View file @
f8c3af2d
...
@@ -68,10 +68,13 @@ class IrOpPriorityConfig:
...
@@ -68,10 +68,13 @@ class IrOpPriorityConfig:
def
set_priority
(
self
):
def
set_priority
(
self
):
"""
"""
Context manager to set the IR op priority for all op members.
Context manager to set the IR op priority for all op members.
It also imports vllm.kernels to ensure all implementations are made available.
It also imports IR kernel implementations for the current platform
to ensure all implementations are made available.
"""
"""
import
vllm.kernels
# noqa: F401, registers IR op implementations
from
vllm.ir.op
import
IrOp
from
vllm.ir.op
import
IrOp
from
vllm.platforms
import
current_platform
current_platform
.
import_ir_kernels
()
with
contextlib
.
ExitStack
()
as
stack
:
with
contextlib
.
ExitStack
()
as
stack
:
for
field
in
fields
(
self
):
for
field
in
fields
(
self
):
...
...
vllm/platforms/interface.py
View file @
f8c3af2d
...
@@ -207,6 +207,15 @@ class Platform:
...
@@ -207,6 +207,15 @@ class Platform:
"""
"""
return
cls
.
simple_compile_backend
return
cls
.
simple_compile_backend
@
classmethod
def
import_ir_kernels
(
cls
)
->
None
:
"""
The default implementation imports ``vllm.kernels``, which registers
the built-in IR op implementations. Out-of-tree (OOT) platforms should
override this method to import their own kernel modules.
"""
import
vllm.kernels
# noqa: F401
@
classmethod
@
classmethod
def
device_id_to_physical_device_id
(
cls
,
device_id
:
int
):
def
device_id_to_physical_device_id
(
cls
,
device_id
:
int
):
# Treat empty device control env var as unset. This is a valid
# Treat empty device control env var as unset. This is a valid
...
...
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