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
861a0a0a
Unverified
Commit
861a0a0a
authored
Jun 14, 2025
by
Konrad Zawora
Committed by
GitHub
Jun 14, 2025
Browse files
[Bugfix] Don't attempt to use triton if no driver is active (#19561)
parent
bc956b38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
vllm/triton_utils/importing.py
vllm/triton_utils/importing.py
+30
-0
No files found.
vllm/triton_utils/importing.py
View file @
861a0a0a
...
...
@@ -12,6 +12,36 @@ HAS_TRITON = (
find_spec
(
"triton"
)
is
not
None
or
find_spec
(
"pytorch-triton-xpu"
)
is
not
None
# Not compatible
)
if
HAS_TRITON
:
try
:
from
triton.backends
import
backends
# It's generally expected that x.driver exists and has
# an is_active method.
# The `x.driver and` check adds a small layer of safety.
active_drivers
=
[
x
.
driver
for
x
in
backends
.
values
()
if
x
.
driver
and
x
.
driver
.
is_active
()
]
if
len
(
active_drivers
)
!=
1
:
logger
.
info
(
"Triton is installed but %d active driver(s) found "
"(expected 1). Disabling Triton to prevent runtime errors."
,
len
(
active_drivers
))
HAS_TRITON
=
False
except
ImportError
:
# This can occur if Triton is partially installed or triton.backends
# is missing.
logger
.
warning
(
"Triton is installed, but `triton.backends` could not be imported. "
"Disabling Triton."
)
HAS_TRITON
=
False
except
Exception
as
e
:
# Catch any other unexpected errors during the check.
logger
.
warning
(
"An unexpected error occurred while checking Triton active drivers:"
" %s. Disabling Triton."
,
e
)
HAS_TRITON
=
False
if
not
HAS_TRITON
:
logger
.
info
(
"Triton not installed or not compatible; certain GPU-related"
...
...
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