Skip to content

Fix torch installation on mac#1829

Open
yuvalshkolar wants to merge 2 commits intoNVIDIA:mainfrom
ftatiana-nv:shkolar/fix-mac
Open

Fix torch installation on mac#1829
yuvalshkolar wants to merge 2 commits intoNVIDIA:mainfrom
ftatiana-nv:shkolar/fix-mac

Conversation

@yuvalshkolar
Copy link
Copy Markdown
Collaborator

Fix Installation of the dependencies when developing on mac

@yuvalshkolar yuvalshkolar requested review from a team as code owners April 9, 2026 08:58
@yuvalshkolar yuvalshkolar requested a review from edknv April 9, 2026 08:58
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 9, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 9, 2026

Greptile Summary

This PR fixes Mac development setup by adding sys_platform != 'darwin' markers to the [tool.uv.sources] entries for torch and torchvision, so that on macOS those packages are resolved from the default PyPI index (which carries CPU/MPS builds) instead of the CUDA-specific torch-cuda wheel index, which has no macOS wheels and was causing installation failures.

Confidence Score: 5/5

Safe to merge — minimal, targeted fix for a well-understood Mac installation problem.

The change is a one-line-per-package addition of a standard PEP 508 sys_platform marker to exclude the CUDA-only wheel index on macOS. No logic, no runtime code, and no API surface is touched. The approach mirrors how vllm is already handled in this file. All remaining findings are P2 or lower.

No files require special attention.

Important Files Changed

Filename Overview
nemo_retriever/pyproject.toml Adds sys_platform != 'darwin' markers to the torch and torchvision source entries so they are fetched from PyPI (CPU/MPS builds) on macOS instead of the CUDA-only wheel index that has no macOS wheels.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[uv install on developer machine] --> B{sys_platform?}
    B -->|darwin - macOS| C[Resolve torch & torchvision<br/>from PyPI default index]
    B -->|linux / win32| D[Resolve torch & torchvision<br/>from torch-cuda index<br/>download.pytorch.org/whl/cu130]
    C --> E[CPU / MPS build installed ✓]
    D --> F[CUDA-enabled build installed ✓]
    D --> G[Resolve vllm from<br/>GitHub release URLs<br/>x86_64 or aarch64]
    B -->|darwin - macOS| H[vllm skipped<br/>sys_platform == linux guard<br/>in project.dependencies]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: nemo_retriever/pyproject.toml
Line: 64-67

Comment:
**Consider platform-guarding remaining GPU-only Nemotron packages**

`nemotron-page-elements-v3`, `nemotron-graphic-elements-v1`, and `nemotron-table-structure-v1` are sourced from `test-pypi` without any platform marker, and their source index entry has no macOS guard. If these packages lack macOS wheels on test-pypi, `uv sync` on a Mac will still fail after this fix. `nemotron-ocr` already has `sys_platform == 'linux'` in the dependency spec — it may be worth applying the same treatment to the other three Nemotron packages if they also publish only Linux wheels.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (3): Last reviewed commit: "Merge branch 'main' into shkolar/fix-mac" | Re-trigger Greptile

Signed-off-by: Yuval Shkolar <yshkolar@nvidia.com>
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