Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Refactor] Move testing utils out of src #12238

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

Merged
DN6 merged 8 commits into main from move-testing-utils
Aug 28, 2025
Merged

[Refactor] Move testing utils out of src #12238

DN6 merged 8 commits into main from move-testing-utils
Aug 28, 2025

Conversation

DN6
Copy link
Collaborator

@DN6 DN6 commented Aug 26, 2025
edited
Loading

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.

sayakpaul reacted with heart emoji

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

@sayakpaul sayakpaul Aug 26, 2025

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
Reviewers

@sayakpaul sayakpaul sayakpaul approved these changes

@yiyixuxu yiyixuxu Awaiting requested review from yiyixuxu

Assignees
No one assigned
Labels
roadmap Add to current release roadmap
Projects
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /