Repository navigation
[ROCm] [CI] Fix diffusion test #4574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ce963a1
fix voxtral tts test
tjtanaa 50b3efb
increase timeout
tjtanaa c78924a
revert time out change first
tjtanaa 39f06dc
Merge remote-tracking branch 'origin/main' into fixvoxtral
tjtanaa afd35a2
fix diffusion test cases
tjtanaa b08fdf9
fix diffusion worker
tjtanaa 2d960da
fix precommit
tjtanaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good: Lazy import wrapper prevents hipSetDevice symbol error on ROCm. |
||
| 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 @@ def sleep(self, level: int = 1) -> bool: | |
| 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 @@ def wake_up(self, tags: list[str] | None = None) -> bool: | |
| 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 @@ def _maybe_get_memory_pool_context(self, tag: str) -> AbstractContextManager: | |
| 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." | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good: Helper function centralizes the mock patching pattern.