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
b447624e
Unverified
Commit
b447624e
authored
Jun 18, 2025
by
Michael Goin
Committed by
GitHub
Jun 17, 2025
Browse files
[Bugfix] Fix faulty triton importing logic when using Ray for DP (#19734)
Signed-off-by:
mgoin
<
mgoin64@gmail.com
>
parent
cda92307
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
vllm/triton_utils/importing.py
vllm/triton_utils/importing.py
+17
-1
No files found.
vllm/triton_utils/importing.py
View file @
b447624e
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import
os
import
types
import
types
from
importlib.util
import
find_spec
from
importlib.util
import
find_spec
...
@@ -23,7 +24,22 @@ if HAS_TRITON:
...
@@ -23,7 +24,22 @@ if HAS_TRITON:
x
.
driver
for
x
in
backends
.
values
()
x
.
driver
for
x
in
backends
.
values
()
if
x
.
driver
and
x
.
driver
.
is_active
()
if
x
.
driver
and
x
.
driver
.
is_active
()
]
]
if
len
(
active_drivers
)
!=
1
:
# Check if we're in a distributed environment where CUDA_VISIBLE_DEVICES
# might be temporarily empty (e.g., Ray sets it to "" during actor init)
cuda_visible_devices
=
os
.
environ
.
get
(
"CUDA_VISIBLE_DEVICES"
)
is_distributed_env
=
(
cuda_visible_devices
is
not
None
and
len
(
cuda_visible_devices
.
strip
())
==
0
)
# Apply lenient driver check for distributed environments
if
is_distributed_env
and
len
(
active_drivers
)
==
0
:
# Allow 0 drivers in distributed environments - they may become
# active later when CUDA context is properly initialized
logger
.
debug
(
"Triton found 0 active drivers in distributed environment. "
"This is expected during initialization."
)
elif
not
is_distributed_env
and
len
(
active_drivers
)
!=
1
:
# Strict check for non-distributed environments
logger
.
info
(
logger
.
info
(
"Triton is installed but %d active driver(s) found "
"Triton is installed but %d active driver(s) found "
"(expected 1). Disabling Triton to prevent runtime errors."
,
"(expected 1). Disabling Triton to prevent runtime errors."
,
...
...
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