Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
c54bda30
Unverified
Commit
c54bda30
authored
Dec 02, 2024
by
HAI
Committed by
GitHub
Dec 02, 2024
Browse files
Use rocminfo instead of rocm-smi for more OS/WSL support (#2310)
parent
3c79ad35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+4
-3
No files found.
python/sglang/srt/utils.py
View file @
c54bda30
...
@@ -903,7 +903,9 @@ def get_amdgpu_memory_capacity():
...
@@ -903,7 +903,9 @@ def get_amdgpu_memory_capacity():
try
:
try
:
# Run rocm-smi and capture the output
# Run rocm-smi and capture the output
result
=
subprocess
.
run
(
result
=
subprocess
.
run
(
[
"rocm-smi --showmeminfo vram | grep 'Total Memory' | awk '{print $NF}'"
],
[
"rocminfo | grep 'gfx94' -A 100 | grep 'Pool 1' -A 5 | grep 'Size:' | awk '{print $2}'"
],
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
,
shell
=
True
,
...
@@ -914,9 +916,8 @@ def get_amdgpu_memory_capacity():
...
@@ -914,9 +916,8 @@ def get_amdgpu_memory_capacity():
# Parse the output to extract memory values in MiB
# Parse the output to extract memory values in MiB
memory_values
=
[
memory_values
=
[
float
(
mem
)
/
1024
/
1024
float
(
mem
.
split
(
"("
)[
0
].
strip
())
/
1024
for
mem
in
result
.
stdout
.
strip
().
split
(
"
\n
"
)
for
mem
in
result
.
stdout
.
strip
().
split
(
"
\n
"
)
if
re
.
match
(
r
"^\d+(\.\d+)?$"
,
mem
.
strip
())
]
]
if
not
memory_values
:
if
not
memory_values
:
...
...
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