Skip to content

Commit 1efa9c8

Browse files
fix(deps): align torchao constraint in requirements.txt with pyproject.toml (#1298)
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.
1 parent 55476ee commit 1efa9c8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

requirements.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ python-multipart>=0.0.18
3434
numba>=0.63.1
3535
vector-quantize-pytorch>=1.27.15
3636
torchcodec>=0.9.1; platform_machine != 'aarch64'
37-
torchao
37+
# Must match pyproject.toml. Unpinned, this resolves to torchao 0.18.x, which
38+
# imports torch.nn.functional.ScalingType -- a symbol that does not exist in the
39+
# torch 2.7.1+cu128 build pinned above for Windows. The model then fails to load
40+
# with "cannot import name 'ScalingType'". Keep these two declarations aligned.
41+
torchao>=0.16.0,<0.17.0; platform_machine != 'aarch64'
42+
torchao; platform_machine == 'aarch64'
3843
toml
3944
modelscope
4045

0 commit comments

Comments
 (0)