Skip to content

Conversation

yao-matrix
Copy link
Contributor

to make below 4 cases pass on XPU

pytest -rA tests/modular_pipelines/stable_diffusion_xl/test_modular_pipeline_stable_diffusion_xl.py::SDXLImg2ImgModularPipelineFastTests::test_components_auto_cpu_offload_inference_consistent
pytest -rA tests/modular_pipelines/stable_diffusion_xl/test_modular_pipeline_stable_diffusion_xl.py::SDXLInpaintingModularPipelineFastTests::test_components_auto_cpu_offload_inference_consistent
pytest -rA tests/modular_pipelines/stable_diffusion_xl/test_modular_pipeline_stable_diffusion_xl.py::SDXLModularPipelineFastTests::test_components_auto_cpu_offload_inference_consistent
pytest -rA tests/lora/test_lora_layers_hunyuanvideo.py::HunyuanVideoLoRAIntegrationTests::test_original_format_cseti

@DN6 @a-r-r-o-w , pls help review, thx very much

Signed-off-by: Yao, Matrix <[email protected]>

def enable_auto_cpu_offload(self, device: Union[str, int, torch.device] = "cuda", memory_reserve_margin="3GB"):
def enable_auto_cpu_offload(self, device: Union[str, int, torch.device] = None, memory_reserve_margin="3GB"):
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as in #11288, i suggest make None as the default value of device, so in that case, if users run on other devices like XPU w/o specify the device argument, the code will auto detect the device and run, rather than crash. Thx

@yao-matrix
Copy link
Contributor Author

@DN6 @a-r-r-o-w , could you pls take a review? Thx very much.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@DN6 DN6 merged commit 7a58734 into huggingface:main Sep 24, 2025
13 checks passed
@yao-matrix yao-matrix deleted the issue-522 branch September 24, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants