Skip to content

fix: pin diffusers>=0.37.0 for torchao 0.16.0 compatibility#983

Merged
ChuxiJ merged 1 commit intomainfrom
fix/pin-diffusers-for-torchao-compat
Mar 31, 2026
Merged

fix: pin diffusers>=0.37.0 for torchao 0.16.0 compatibility#983
ChuxiJ merged 1 commit intomainfrom
fix/pin-diffusers-for-torchao-compat

Conversation

@ChuxiJ
Copy link
Copy Markdown
Contributor

@ChuxiJ ChuxiJ commented Mar 31, 2026

Summary

Root Cause

PR #974 bumped torchao from <0.16.0 to >=0.16.0, but left diffusers unpinned. This created a dependency incompatibility:

torchao <0.16.0 torchao >=0.16.0
diffusers <0.37.0 ✅ Works Crashes
diffusers >=0.37.0 ✅ Works ✅ Works

torchao 0.16.0 removed torchao.dtypes.uintx.uint4_layout, which diffusers 0.36.0 imports at module level. The import failure triggers a NameError (logger not yet defined), crashing VAE model loading:

RuntimeError: Failed to import diffusers.models.autoencoders.autoencoder_oobleck
NameError: name 'logger' is not defined

diffusers 0.37.0+ fixed this via huggingface/diffusers#11018 by gating the import behind is_torchao_version(">", "0.15.0").

Fix

-    "diffusers",
+    "diffusers>=0.37.0",

Test plan

  • uv sync resolves diffusers >=0.37.0
  • python -c "from diffusers.models import AutoencoderOobleck" succeeds
  • Gradio server starts and model initialization completes without errors

Fixes #982

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated minimum version requirement for the diffusers dependency to ensure compatibility with version 0.37.0 and later.

PR #974 bumped torchao from <0.16.0 to >=0.16.0, but diffusers was
left unpinned. torchao 0.16.0 removed the
`torchao.dtypes.uintx.uint4_layout` module, which diffusers 0.36.0
tries to import at module level. This causes model initialization to
fail with `NameError: name 'logger' is not defined`.

diffusers 0.37.0+ handles this correctly by gating the import behind
a torchao version check (huggingface/diffusers#11018).

Fixes #982

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8dacaabb-4c32-4c8c-91ef-8e4444371726

📥 Commits

Reviewing files that changed from the base of the PR and between 2552812 and d20c026.

📒 Files selected for processing (1)
  • pyproject.toml

📝 Walkthrough

Walkthrough

The pyproject.toml dependency specification for diffusers has been updated from an unpinned entry to a version constraint of >=0.37.0, establishing a minimum compatible version while maintaining flexibility for patch and minor updates.

Changes

Cohort / File(s) Summary
Dependency Version Pinning
pyproject.toml
Updated diffusers dependency from unpinned to >=0.37.0, establishing minimum version compatibility.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

Poem

🐰 A version pinned down, so tight and so true,
The diffusers now know the minimum to do,
No more dancing with bugs in the 0.36 night,
0.37 and beyond—our dependencies aligned right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: pinning diffusers to >=0.37.0 for torchao 0.16.0 compatibility, which matches the actual modification in pyproject.toml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pin-diffusers-for-torchao-compat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ChuxiJ ChuxiJ merged commit 89a5f6e into main Mar 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: torchao>=0.16.0 breaks model initialization due to diffusers 0.36.0 incompatibility (PR #974)

1 participant