Skip to content

Conversation

DN6
Copy link
Collaborator

@DN6 DN6 commented Aug 26, 2025

What does this PR do?

No need to ship our testing utils. This PR

  • Deprecates using imports from diffusers.utils.testing_utils
  • Moves relevant utils that currently exists in testing utils to torch_utils (mostly ones related to device agnostic backend device management)
  • Updates all paths

Unfortunately we can't just remove testing_utils.py from src because it appears to be used in a lot of places
https://github.com/search?q=%22from+diffusers.utils.testing_utils+import%22+language:python&type=code

Although, most of these are probably forks. Just to be safe, we'll do a deprecation now and remove by 1.0.0

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@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 requested review from yiyixuxu and sayakpaul August 26, 2025 07:59
Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Very cool, thank you! Just one comment.

@@ -24,7 +24,8 @@
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
from diffusers.utils import get_logger
from diffusers.utils.import_utils import compare_versions
from diffusers.utils.testing_utils import (

from ..testing_utils import (
Copy link
Member

Choose a reason for hiding this comment

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

Should we be using torch_utils here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The utils still exist in tests/testing_utils. Just did a search/replace here. Can do a follow up to handle importing the stuff that has been moved to torch_utils

@DN6 DN6 merged commit 7aa6af1 into main Aug 28, 2025
33 of 34 checks passed
@DN6 DN6 added the roadmap Add to current release roadmap label Aug 28, 2025
@DN6 DN6 moved this from In Progress to Done in Diffusers Roadmap 0.36 Aug 28, 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
Development

Successfully merging this pull request may close these issues.

3 participants