rebase: align vllm-omni with vLLM 740f379faefd
Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
d25be7385f
commit
b73036f538
7 files changed
+14
-35
No files matched your search
@@ -1567,16 +1567,18 @@ class AsyncOmniEngine:
|
||||
# and can cause CUDA OOM for subsequent engine instances (especially
|
||||
# large models like BAGEL-7B-MoT whose weights alone consume ~134 GiB).
|
||||
#
|
||||
# Discard mode (level=2) is correct at shutdown: there is no benefit to
|
||||
# keeping a CPU backup when the engine is being torn down.
|
||||
# CuMemAllocator.sleep() is NOT idempotent — calling it on already-
|
||||
# slept entries causes CUDA_ERROR_INVALID_VALUE at cumem_allocator
|
||||
# cuMemRelease (double-free of the memory handle). Use release_pools()
|
||||
# instead, which is the designed cleanup path: it drops MemPool refs
|
||||
# and lets the destructor/free path handle asleep entries correctly
|
||||
# (returns a null handle so the C extension skips unmap/release).
|
||||
try:
|
||||
from vllm.device_allocator.cumem import CuMemAllocator, cumem_available
|
||||
|
||||
if cumem_available:
|
||||
allocator = CuMemAllocator.get_instance()
|
||||
# Sleep at level 2 discards all pool memory from the GPU
|
||||
# without creating CPU backups — cheapest and fastest.
|
||||
allocator.sleep()
|
||||
allocator.release_pools()
|
||||
logger.debug("[AsyncOmniEngine] Released CuMem memory pool during shutdown")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in new issue
Block a user