Skip to content

[core] Enforce minimum supported versions in availability checks - #15148

Open
DN6 wants to merge 2 commits into
mainfrom
version-available
Open

DN6 wants to merge 2 commits into
mainfrom
version-available

Conversation

@DN6

@DN6 DN6 commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

This PR

  • Updates is_*_available checks to also account for the minimum supported version in our deps table. This prevents stuff like import issues when unsupported versions of optional libraries are installed in the env, e.g Fix model imports when torchao is older than 0.15 #15095
  • Cleans up many version checks for unsupported deps.

Fixes # (issue)

Before submitting

  • Did you use an AI agent (Claude Code, Codex, Cursor, etc.) to help with this PR? If so:
    • Did you read the Coding with AI agents guide?
    • Did you run the self-review skill on the diff?
    • Did you share the final self-review notes in the PR description or a comment?
  • Did you read the contributor guideline?
  • Did you read our philosophy doc? (important for complex PRs)
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?
  • Are you the author (or part of the team) of the model/pipeline (only applicable for model/pipeline related PRs)?

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

Copy link
Copy Markdown

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 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

/diffusers-bot style

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Style bot fixed some files and pushed the changes.

@DN6
DN6 requested review from sayakpaul and yiyixuxu October 30, 2026 09:31
@DN6 DN6 added this to the Release 0.43.0 milestone Oct 30, 2026

@yiyixuxu yiyixuxu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks! just left some small questions


if pkg_exists and import_name in _PKG_TO_DEPS_KEY:
requirement = Requirement(deps[_PKG_TO_DEPS_KEY[import_name]])
if not requirement.specifier.contains(parse(pkg_version).base_version):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we add a try ... except here?

if is_accelerate_available():
from accelerate import cpu_offload_with_hook
else:
raise ImportError("`enable_model_cpu_offload` requires `accelerate v0.17.0` or higher.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ohh should we change the messages here too?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants