-
Notifications
You must be signed in to change notification settings - Fork 6k
enable cpu offloading of new pipelines on XPU & use device agnostic empty to make pipelines work on XPU #11671
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: YAO Matrix <[email protected]>
Signed-off-by: YAO Matrix <[email protected]>
@@ -193,7 +193,7 @@ def __init__( | |||
def enable_xformers_memory_efficient_attention(self, attention_op: Optional[Callable] = None): | |||
self.decoder_pipe.enable_xformers_memory_efficient_attention(attention_op) | |||
|
|||
def enable_sequential_cpu_offload(self, gpu_id: Optional[int] = None, device: Union[torch.device, str] = "cuda"): | |||
def enable_sequential_cpu_offload(self, gpu_id: Optional[int] = None, device: Union[torch.device, str] = None): |
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.
per discussion in this PR #11288, we change the default to None
, so cpu_offloading can work on other accelerators like XPU w/ application code change.
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.
with such changes, cases like tests/pipelines/wuerstchen/test_wuerstchen_combined.py::WuerstchenCombinedPipelineFastTests::test_cpu_offload_forward_pass_twice
, tests/pipelines/kandinsky2_2/test_kandinsky_combined.py::KandinskyV22PipelineImg2ImgCombinedFastTests::test_cpu_offload_forward_pass_twice
can pass on XPU
Signed-off-by: YAO Matrix <[email protected]>
@a-r-r-o-w @DN6 , pls help review, thx very much. |
No description provided.