-
Notifications
You must be signed in to change notification settings - Fork 6.5k
enable pipeline test cases on xpu #11527
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
Conversation
Signed-off-by: Yao Matrix <[email protected]>
Signed-off-by: Yao Matrix <[email protected]>
src/diffusers/utils/testing_utils.py
Outdated
| response = requests.get(url, timeout=DIFFUSERS_REQUEST_TIMEOUT) | ||
| response.raise_for_status() | ||
| arry = torch.load(BytesIO(response.content), map_location=map_location) | ||
| arry = torch.load(BytesIO(response.content), map_location=map_location, weights_only=False) |
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.
weights_onlydefault value changed fromFalsetoTruefrom PyTorch 2.6, so set explicitly toFalsehere, otherwisetests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py::TextToVideoZeroPipelineSlowTests::test_full_modelwill raise error- set
map_locationdefault as None which aligns w.torch.load, otherwisetests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py::TextToVideoZeroPipelineSlowTests::test_full_modelwill raise error
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.
Could we add weights_only=True as an arg to load_pt and pass in to torch load. In the test itself we can set it to false so that it's clear what's happening in the test. I would avoid doing this under the hood because it is a potential security hole.
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.
@DN6 , done, pls help review, thx.
| pipe = TextToVideoZeroPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(torch_device) | ||
| pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config) | ||
| generator = torch.Generator(device="cuda").manual_seed(0) | ||
| generator = torch.Generator(device="cpu").manual_seed(0) |
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.
PRNG will behave different across accelerators, set back to "cpu" for cross-device reproducibility, as other cases in diffusers
|
|
||
| @unittest.skipIf(torch_device not in ["cuda", "xpu"], reason="float16 requires CUDA or XPU") | ||
| @require_accelerator | ||
| @require_torch_accelerator |
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.
actually it's torch case, use require_torch_accelerator to reflect fact
|
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, could you pls review and comment? Thx very much. |
|
@a-r-r-o-w , pls help review and merged if OK, thx very much. |
|
@DN6 @a-r-r-o-w , pls help review and merged if OK, thx very much. |
incl.
stable_diffusion_k_diffusion
stable_diffusion_sag
stable_diffusion_ldm3d
text_to_video_synthesis
unclip
stable_unclip
@a-r-r-o-w @DN6 , pls help review, thx very much.