Skip to content

Conversation

@yao-matrix
Copy link
Contributor

@yao-matrix yao-matrix commented May 9, 2025

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.

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)
Copy link
Contributor Author

@yao-matrix yao-matrix May 9, 2025

Choose a reason for hiding this comment

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

  1. weights_only default value changed from False to True from PyTorch 2.6, so set explicitly to False here, otherwise tests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py::TextToVideoZeroPipelineSlowTests::test_full_model will raise error
  2. set map_location default as None which aligns w. torch.load, otherwise tests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py::TextToVideoZeroPipelineSlowTests::test_full_model will raise error

Copy link
Collaborator

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.

Copy link
Contributor Author

@yao-matrix yao-matrix May 19, 2025

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)
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@a-r-r-o-w a-r-r-o-w requested a review from DN6 May 12, 2025 10:45
@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.

@yao-matrix
Copy link
Contributor Author

@DN6, could you pls review and comment? Thx very much.

@yao-matrix
Copy link
Contributor Author

@a-r-r-o-w , pls help review and merged if OK, thx very much.

@yao-matrix
Copy link
Contributor Author

@DN6 @a-r-r-o-w , pls help review and merged if OK, thx very much.

@DN6 DN6 merged commit 049082e into huggingface:main May 26, 2025
12 checks passed
@yao-matrix yao-matrix deleted the diffusions-xpu branch May 26, 2025 22:36
@DN6 DN6 added the roadmap Add to current release roadmap label Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmap Add to current release roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants