Skip to content

fix(deps): align torchao constraint in requirements.txt with pyproject.toml - #1298

Open
BigBirdReturns wants to merge 1 commit into
ace-step:mainfrom
BigBirdReturns:fix/align-torchao-pin-with-pyproject
Open

fix(deps): align torchao constraint in requirements.txt with pyproject.toml#1298
BigBirdReturns wants to merge 1 commit into
ace-step:mainfrom
BigBirdReturns:fix/align-torchao-pin-with-pyproject

Conversation

@BigBirdReturns

@BigBirdReturns BigBirdReturns commented Aug 17, 2026

Copy link
Copy Markdown

Align the torchao constraint in requirements.txt with pyproject.toml

requirements.txt declares torchao unpinned, while pyproject.toml declares:

torchao>=0.16.0,<0.17.0; platform_machine != 'aarch64'
torchao; platform_machine == '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 sys_platform == 'win32'. torchao 0.18.x imports ScalingType from torch.nn.functional, which does not exist in torch 2.7.1, so model loading fails:

File ".../torchao/quantization/quantize_/workflows/float8/float8_tensor.py", line 12
    from torch.nn.functional import ScalingType, scaled_grouped_mm
ImportError: cannot import name 'ScalingType' from 'torch.nn.functional'

RuntimeError: Failed to load model with attention implementations ['sdpa', 'eager']:
cannot import name 'ScalingType' from 'torch.nn.functional'

Installing the range already declared in pyproject.toml (torchao 0.16.0) restores loading, with no other change.

Reproduction

base commit 6d467e4b5081ccb0abf1ec1bf4fdf9051a2d34b0
OS Windows
Python 3.12.10
torch 2.7.1+cu128 (as pinned for win32)
torchao resolved before 0.18.0 → model load fails
torchao resolved after 0.16.0 → model load succeeds

Verified in a clean virtual environment created from scratch and installed only from requirements.txt:

  • before the changetorchao 0.18.0 resolved; DiT checkpoint load raised the ScalingType ImportError above.
  • after the changetorchao 0.16.0 resolved; import torchao and import torchao.quantization succeed, 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.0 emits a compatibility advisory against torch 2.7.1 referencing pytorch/ao#2919. It is advisory only; torchao.quantization imports and the model loads and generates.

Change

Only the two torchao environment markers, mirroring pyproject.toml, plus a comment recording why the two declarations must stay aligned.

Summary by CodeRabbit

  • Chores
    • Updated platform-specific compatibility requirements for the torchao package.
    • Added support for newer compatible versions on non-ARM64 platforms.
    • Preserved existing ARM64 installation behavior.

…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.
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 454c46ca-cde3-4910-99b1-fccc6fb688f7

📥 Commits

Reviewing files that changed from the base of the PR and between 14c0211 and c0d63ea.

📒 Files selected for processing (1)
  • requirements.txt

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

requirements.txt now pins torchao to version 0.16.x on non-aarch64 platforms. Aarch64 platforms retain an unpinned dependency. Comments document compatibility with the pinned Windows PyTorch build.

Changes

torchao dependency constraints

Layer / File(s) Summary
Platform-specific dependency requirements
requirements.txt
Non-aarch64 platforms require torchao>=0.16.0,<0.17.0. Aarch64 platforms retain unpinned torchao. Comments document Windows PyTorch compatibility.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to c0d63

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

I’m a rabbit with requirements to weigh,
Pinning torchao just the right way.
Windows notes sit neat,
Aarch64 stays free,
And clean builds hop along today.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the dependency constraint alignment in requirements.txt and pyproject.toml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

1 participant