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
40c39653
Unverified
Commit
40c39653
authored
Sep 13, 2024
by
shangmingc
Committed by
GitHub
Sep 13, 2024
Browse files
[Bugfix] Mapping physical device indices for e2e test utils (#8290)
parent
5ec9c0fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
tests/utils.py
tests/utils.py
+11
-0
No files found.
tests/utils.py
View file @
40c39653
...
...
@@ -356,12 +356,23 @@ def error_on_warning():
yield
def
get_physical_device_indices
(
devices
):
visible_devices
=
os
.
environ
.
get
(
"CUDA_VISIBLE_DEVICES"
)
if
visible_devices
is
None
:
return
devices
visible_indices
=
[
int
(
x
)
for
x
in
visible_devices
.
split
(
","
)]
index_mapping
=
{
i
:
physical
for
i
,
physical
in
enumerate
(
visible_indices
)}
return
[
index_mapping
[
i
]
for
i
in
devices
if
i
in
index_mapping
]
@
_nvml
()
def
wait_for_gpu_memory_to_clear
(
devices
:
List
[
int
],
threshold_bytes
:
int
,
timeout_s
:
float
=
120
)
->
None
:
# Use nvml instead of pytorch to reduce measurement error from torch cuda
# context.
devices
=
get_physical_device_indices
(
devices
)
start_time
=
time
.
time
()
while
True
:
output
:
Dict
[
int
,
str
]
=
{}
...
...
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