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
14d03b8d
Unverified
Commit
14d03b8d
authored
Jan 24, 2026
by
7. Sun
Committed by
GitHub
Jan 23, 2026
Browse files
[Perf] Cache xpu_get_mem_info() result to avoid duplicate calls (#32983)
Signed-off-by:
7. Sun
<
jhao.sun@gmail.com
>
parent
d0cbac58
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
vllm/v1/worker/xpu_worker.py
vllm/v1/worker/xpu_worker.py
+2
-1
No files found.
vllm/v1/worker/xpu_worker.py
View file @
14d03b8d
...
@@ -107,7 +107,8 @@ class XPUWorker(Worker):
...
@@ -107,7 +107,8 @@ class XPUWorker(Worker):
torch
.
xpu
.
empty_cache
()
torch
.
xpu
.
empty_cache
()
torch_allocated_bytes
=
torch
.
xpu
.
memory_stats
()[
"allocated_bytes.all.current"
]
torch_allocated_bytes
=
torch
.
xpu
.
memory_stats
()[
"allocated_bytes.all.current"
]
total_allocated_bytes
=
self
.
xpu_get_mem_info
()[
1
]
-
self
.
xpu_get_mem_info
()[
0
]
free_mem
,
total_mem
=
self
.
xpu_get_mem_info
()
total_allocated_bytes
=
total_mem
-
free_mem
non_torch_allocations
=
total_allocated_bytes
-
torch_allocated_bytes
non_torch_allocations
=
total_allocated_bytes
-
torch_allocated_bytes
if
non_torch_allocations
>
0
:
if
non_torch_allocations
>
0
:
...
...
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