-
Notifications
You must be signed in to change notification settings - Fork 6k
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Yao Matrix <matrix.yao@intel.com>
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_only
default value changed fromFalse
toTrue
from PyTorch 2.6, so set explicitly toFalse
here, otherwisetests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py::TextToVideoZeroPipelineSlowTests::test_full_model
will raise error- set
map_location
default as None which aligns w.torch.load
, otherwisetests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py::TextToVideoZeroPipelineSlowTests::test_full_model
will 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 , pls help review, thx.
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
@@ -220,7 +220,7 @@ def test_dict_tuple_outputs_equivalent(self, expected_max_difference=1e-4): | |||
self.assertLess(max_diff, expected_max_difference) | |||
|
|||
@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. |
Signed-off-by: Matrix Yao <matrix.yao@intel.com>
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.