fix(deps): align torchao constraint in requirements.txt with pyproject.toml - #1298
fix(deps): align torchao constraint in requirements.txt with pyproject.toml#1298BigBirdReturns wants to merge 1 commit into
Conversation
…t.toml
requirements.txt declares `torchao` unpinned while pyproject.toml declares
`torchao>=0.16.0,<0.17.0` for non-aarch64. A fresh
`pip install -r requirements.txt` on Windows therefore resolves torchao 0.18.0,
while the same file pins torch==2.7.1+cu128 for win32.
torchao 0.18.x imports `ScalingType` from `torch.nn.functional`, which does not
exist in torch 2.7.1, so loading the DiT checkpoint fails with:
ImportError: cannot import name 'ScalingType' from 'torch.nn.functional'
RuntimeError: Failed to load model with attention implementations
['sdpa', 'eager']
Installing the range already declared in pyproject.toml (torchao 0.16.0)
restores loading with no other change. Verified in a clean virtual environment
on Python 3.12.10: torchao resolves to 0.16.0, `import torchao.quantization`
succeeds, the released checkpoint loads on CUDA, and seeded generation produces
decoded audio identical to the same seeded request in a separately built
environment.
Mirrors the pyproject.toml markers exactly so the two declarations cannot drift
apart again.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. 📝 WalkthroughWalkthrough
Changestorchao dependency constraints
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to The dependency constraint is aligned with the project configuration to prevent an incompatible torchao resolution on Windows; no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Align the
torchaoconstraint inrequirements.txtwithpyproject.tomlrequirements.txtdeclarestorchaounpinned, whilepyproject.tomldeclares:A fresh
pip install -r requirements.txton Windows therefore resolvestorchao 0.18.0, while the same file pinstorch==2.7.1+cu128forsys_platform == 'win32'.torchao 0.18.ximportsScalingTypefromtorch.nn.functional, which does not exist in torch 2.7.1, so model loading fails:Installing the range already declared in
pyproject.toml(torchao 0.16.0) restores loading, with no other change.Reproduction
6d467e4b5081ccb0abf1ec1bf4fdf9051a2d34b02.7.1+cu128(as pinned for win32)0.18.0→ model load fails0.16.0→ model load succeedsVerified in a clean virtual environment created from scratch and installed only from
requirements.txt:torchao 0.18.0resolved; DiT checkpoint load raised theScalingTypeImportErrorabove.torchao 0.16.0resolved;import torchaoandimport torchao.quantizationsucceed, the released DiT checkpoint loads cleanly on CUDA, and generation runs to completion.Two seeded generations in that clean environment produced decoded audio identical to the same seeded request in a separately built environment, so the change does not perturb generation behaviour.
Note
torchao 0.16.0emits a compatibility advisory against torch 2.7.1 referencing pytorch/ao#2919. It is advisory only;torchao.quantizationimports and the model loads and generates.Change
Only the two
torchaoenvironment markers, mirroringpyproject.toml, plus a comment recording why the two declarations must stay aligned.Summary by CodeRabbit
torchaopackage.