Fix dependency resolution on macOS / Apple Silicon - #298
Open
medyadanhasan wants to merge 1 commit into
Open
medyadanhasan wants to merge 1 commit into
medyadanhasan wants to merge 1 commit into
Conversation
`uv sync` fails on darwin-arm64 before any package is installed: Distribution `torch==2.13.0+cu132` can't be installed because it doesn't have a source distribution or wheel for the current platform Three unconditional CUDA-only pins are responsible: - ltx-core pins `torch` / `torchaudio` to the cu132 indexes, which ship no darwin wheels at all, so no torch version can ever resolve on macOS. - ltx-trainer pins `torchcodec` / `torchaudio` the same way. - The root `override-dependencies` entry for `nvidia-cudnn-cu13` has no marker, so the CUDA-only cuDNN wheel is forced onto macOS as well. Attach `sys_platform != 'darwin'` markers to the index sources so macOS falls back to PyPI (where the MPS-enabled wheels live), and scope the cuDNN override to Linux. Linux and Windows resolution is unchanged -- the markers only add a fallback where the pinned indexes have nothing to offer. Verified on macOS 26 / M-series: `uv sync --package ltx-pipelines` installs torch 2.13.0 with `torch.backends.mps.is_available() == True`, and `python -m ltx_pipelines.distilled --help` runs. This also makes the existing Apple-Silicon-only `mps-sdpa` dependency in ltx-core reachable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
uv syncfails on darwin-arm64 before a single package is installed:Three unconditional CUDA-only pins cause it:
packages/ltx-core/pyproject.tomlpointstorch/torchaudioat the cu132 indexes. Those indexes ship no darwin wheels for any version, so no torch can ever resolve on macOS.packages/ltx-trainer/pyproject.tomldoes the same fortorchcodec/torchaudio.override-dependenciesentry fornvidia-cudnn-cu13carries no marker, so the CUDA-only cuDNN wheel is forced onto macOS as well.This PR attaches
sys_platform != 'darwin'markers to the index sources, letting macOS fall back to PyPI where the MPS-enabled wheels live, and scopes the cuDNN override to Linux.Why
The repo already treats Apple Silicon as a supported target:
ltx-coredeclaresmps-sdpaforsys_platform == 'darwin' and platform_machine == 'arm64'(with a comment noting it is "the only viable attention kernel" there),ltx_core/devices.pyresolves and returnstorch.device("mps"),attention.pyselects an MPS-SDPA backend, and the README states thenattenextra is skipped automatically on macOS so "the same command works everywhere". Today that path is unreachable — dependency resolution fails first.Impact on other platforms
None. Linux and Windows keep resolving torch, torchaudio and torchcodec from the same CUDA indexes as before, and keep the
nvidia-cudnn-cu13override. The markers only add a fallback where the pinned indexes have nothing to offer.Verification
On macOS 26 / Apple M5 Max (36 GB), Python 3.14:
uv sync --package ltx-pipelinesinstalls torch 2.13.0 and torchaudio 2.11.0 from PyPI;torch.backends.mps.is_available()isTrue;mps-sdpainstalls as intended.python -m ltx_pipelines.distilled --helpruns.--offload disk: transformer builds with "attention backends -- self: MPS-SDPA, masked: MPS-SDPA", and 1024x576 and 1920x1088 clips with synchronized audio were produced successfully.Note for reviewers, unrelated to this diff
--quantization fp8-castcannot work on MPS:_upcast_and_roundinltx_core/quantization/fp8_cast.pyraisesRuntimeError: Undefined type Float8_e4m3fn, since the MPS backend has no fp8 dtype. Apple Silicon users' only memory levers are--offload cpu/--offload diskand resolution. A clearer up-front error (or a doc line) would save people a 43 GB load before the failure. Happy to open a separate issue or PR for that if useful.