[ROCm] [CI] Fix diffusion test (#4574)
Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
This commit is contained in:
1 parent
6ff246bf3c
commit
e70822ed54
2 files changed
+26
-14
No files matched your search
@@ -161,6 +161,12 @@ def _create_diffusion_worker_vllm_config(device: torch.device, od_config: OmniDi
|
||||
return vllm_config
|
||||
|
||||
|
||||
def _get_cumem_allocator_class() -> type:
|
||||
from vllm.device_allocator.cumem import CuMemAllocator
|
||||
|
||||
return CuMemAllocator
|
||||
|
||||
|
||||
def _resolve_ir_op_priority(od_config: OmniDiffusionConfig, vllm_config: VllmConfig) -> Any:
|
||||
ir_op_priority = current_omni_platform.get_default_ir_op_priority(vllm_config)
|
||||
ir_op_priority_func = get_diffusion_ir_op_priority_func(od_config)
|
||||
@@ -455,8 +461,7 @@ class DiffusionWorker:
|
||||
Args:
|
||||
level: Sleep level. Level 1 offloads weights, level 2 also saves buffers.
|
||||
"""
|
||||
from vllm.device_allocator.cumem import CuMemAllocator
|
||||
|
||||
CuMemAllocator = _get_cumem_allocator_class()
|
||||
allocator = CuMemAllocator.get_instance()
|
||||
|
||||
usage_before = allocator.get_current_usage()
|
||||
@@ -508,8 +513,7 @@ class DiffusionWorker:
|
||||
tags: List of memory pool tags to re-activate (e.g., ["weights"]
|
||||
to match Level 1 sleep). If None, all pools are re-activated.
|
||||
"""
|
||||
from vllm.device_allocator.cumem import CuMemAllocator
|
||||
|
||||
CuMemAllocator = _get_cumem_allocator_class()
|
||||
allocator = CuMemAllocator.get_instance()
|
||||
allocator.wake_up(tags)
|
||||
current_omni_platform.synchronize()
|
||||
@@ -631,8 +635,7 @@ class DiffusionWorker:
|
||||
if is_sleep_enabled:
|
||||
current_omni_platform.synchronize()
|
||||
gc.collect()
|
||||
from vllm.device_allocator.cumem import CuMemAllocator
|
||||
|
||||
CuMemAllocator = _get_cumem_allocator_class()
|
||||
allocator = CuMemAllocator.get_instance()
|
||||
if tag == "weights":
|
||||
assert allocator.get_current_usage() == 0, "Sleep mode can only be used for one instance per process."
|
||||
|
||||
Reference in new issue
Block a user