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
d6a518fd
Unverified
Commit
d6a518fd
authored
Sep 17, 2025
by
Simon Mo
Committed by
GitHub
Sep 17, 2025
Browse files
Remove unused find_cuda_init helper script (#25044)
parent
4aa8c7b0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
36 deletions
+0
-36
find_cuda_init.py
find_cuda_init.py
+0
-36
No files found.
find_cuda_init.py
deleted
100644 → 0
View file @
4aa8c7b0
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import
importlib
import
traceback
from
typing
import
Callable
from
unittest.mock
import
patch
def
find_cuda_init
(
fn
:
Callable
[[],
object
])
->
None
:
"""
Helper function to debug CUDA re-initialization errors.
If `fn` initializes CUDA, prints the stack trace of how this happens.
"""
from
torch.cuda
import
_lazy_init
stack
=
None
def
wrapper
():
nonlocal
stack
stack
=
traceback
.
extract_stack
()
return
_lazy_init
()
with
patch
(
"torch.cuda._lazy_init"
,
wrapper
):
fn
()
if
stack
is
not
None
:
print
(
"==== CUDA Initialized ===="
)
print
(
""
.
join
(
traceback
.
format_list
(
stack
)).
strip
())
print
(
"=========================="
)
if
__name__
==
"__main__"
:
find_cuda_init
(
lambda
:
importlib
.
import_module
(
"vllm.model_executor.models.llava"
))
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