Skip to content

[Mac OS] Support macOS arm64 (CPU-only) in the uv environment - #8191

Open
AntoineRichard wants to merge 2 commits into
isaac-sim:mainfrom
AntoineRichard:antoiner/feat/macos-uv-install
Open

AntoineRichard wants to merge 2 commits into
isaac-sim:mainfrom
AntoineRichard:antoiner/feat/macos-uv-install

Conversation

@AntoineRichard

Copy link
Copy Markdown
Collaborator

Description

Adds experimental, CPU-only macOS on Apple silicon to the source checkout's uv environment, so uv run isaaclab … resolves and installs on a Mac and runs kit-less Newton workflows (Newton + MuJoCo-Warp on Warp's CPU device, PyTorch on CPU).

Today uv sync on a Mac stops immediately: The current Python platform is not compatible with the lockfile's supported environments.

Changes:

  • [tool.uv].environments: added sys_platform == 'darwin' and platform_machine == 'arm64'.
  • torch / torchvision / torchaudio: the cu130 index has no macOS wheels, so the source switches to PyPI on macOS (same pinned versions).
  • Skipped on macOS (these ship no macOS wheels):
  • pxr provider: usd-exchange has no macOS wheels, so macOS installs usd-core instead. Each platform still gets exactly one pxr provider.
    • The usd-exchange override repeats the marker, because uv overrides replace markers too.
  • The generated uv-overrides.txt files are regenerated, and uv.lock is re-locked.
  • Tests: test_version_single_source_matches_literal_pins, test_resolved_torch_stack_supports_blackwell and test_resolved_environment_has_no_second_usd_provider now check their invariants per platform instead of assuming every platform is CUDA:
    • Linux and Windows must resolve +cu130 torch and usd-exchange, and no lock edge may pull usd-core there.
    • macOS must resolve PyPI torch and usd-core only.
  • Docs: added a macOS tab to the uv installation section.

Linux and Windows resolutions are unchanged. The lock diff for those platforms only updates the workspace members' own versions (isaaclab 31.0.0 → 32.1.0, …): uv lock --check already fails on develop because the lock predates the last version bumps.

Works best with (independent, can merge in any order):

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Validation

On macOS 26 / Apple M-series, with this branch plus the three PRs above:

uv sync
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole-Direct --device cpu physics=newton_mjwarp --max_iterations 30

This trains to completion (mean reward 0.09 → 1.75 over 30 iterations, 64 envs). All isaaclab, isaaclab_newton, isaaclab_tasks, isaaclab_rl, isaaclab_assets, isaaclab_physx, isaaclab_ov, and isaaclab_visualizers modules import.

source/isaaclab/test/cli/test_source_package_metadata.py, test_uv_run_pyproject.py, and test_wheel_builder_metadata.py all pass (26 tests).

Not validated on macOS yet: the Newton GL / Rerun / Viser visualizers, and other tasks and RL libraries.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format (all hooks pass except check-git-lfs-pointers, which needs git-lfs installed locally)
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team infrastructure labels Sep 30, 2026
@AntoineRichard AntoineRichard changed the title Support macOS arm64 (CPU-only) in the uv environment [Mac OS] Support macOS arm64 (CPU-only) in the uv environment Sep 30, 2026
@AntoineRichard
AntoineRichard marked this pull request as ready for review September 30, 2026 14:15
@AntoineRichard
AntoineRichard requested a review from a team September 30, 2026 14:15
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Medium risk] Adds macOS arm64 support to dependency configuration.

The PR is not safe to merge as standalone macOS training support because its documented workflow still requires separate asset-download and CPU-agent fixes.

Findings

  1. P1 Remote Cartpole assets cannot load ▶
  2. P1 Agent remains on CUDA ▶
  3. P2 Missing macOS torch goes undetected ▶
  4. P2 Second macOS USD provider goes undetected ▶

Summary

Adds an experimental macOS arm64 resolution to the source uv environment, using PyPI PyTorch and usd-core while excluding unavailable Isaac Sim and OV dependencies.

  • Updates the lockfile, installation guidance, package metadata checks, and changelog fragments.
  • The documented Newton training path still depends on separate asset-download and CPU-agent fixes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[macOS arm64 uv environment] --> B[PyPI PyTorch and usd-core]
  A --> C[Newton Cartpole training]
  C --> D[Remote Cartpole USD]
  D --> E[Asset downloader imports omni.client]
  C --> F[RSL-RL agent defaults to cuda:0]
Loading

Reviews (1) · Last reviewed commit: "Support macOS arm64 in the uv environmen..."

Comment thread pyproject.toml
"botocore", # omni.replicator.core S3 backend
"starlette>=1.3.1", # livestream; minimum patched for current security advisories
"omniverseclient==2.74.0",
# no macOS wheels; isaaclab.utils.assets reads HTTP(S) assets directly without it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Remote Cartpole assets cannot load

On macOS, the documented Cartpole task needs a remote USD file. This change excludes omniverseclient, but the current asset downloader still imports omni.client to fetch remote files. The load raises ModuleNotFoundError, so training cannot start unless the separate HTTP asset-fallback change is present.

Comment on lines +242 to +243
uv run isaaclab train --rl_library rsl_rl \
--task Isaac-Cartpole-Direct --device cpu physics=newton_mjwarp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Agent remains on CUDA

In this macOS example, --device cpu sets the simulation device, but the RSL-RL agent keeps its cuda:0 default. Non-distributed training does not copy the simulation device to the agent, so building the policy fails on a CPU-only Mac unless the separate runner-fallback change is present.

Comment on lines +52 to +54
assert all(
package["source"]["registry"] == "https://pypi.org/simple" for package in packages if package not in cuda
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing macOS torch goes undetected

If a macOS torch, torchvision, or torchaudio entry disappears from the lockfile, this assertion checks an empty set and still passes. Assert that each package resolves for macOS so the test catches a missing CPU stack.

Comment on lines +102 to +103
assert not any(_applies(dep.get("marker"), env) for dep in usd_core_edges for env in _CUDA_ENVIRONMENTS)
assert "usd-exchange" in {package["name"] for package in lock["package"]}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Second macOS USD provider goes undetected

This test rules out usd-core on CUDA platforms, but it does not rule out usd-exchange on macOS. If a transitive dependency adds usd-exchange there, both packages could install the same pxr files while this test passes. Check the lockfile dependencies for both providers on each supported platform.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Adds experimental CPU-only macOS arm64 support through platform markers, PyPI torch sources, and a darwin-only usd-core provider. The overall platform split is coherent, but the documentation incorrectly describes the entire importers extra as unavailable and the macOS torch lock assertion can pass without any macOS torch entry.

  • Design and architecture: The platform-specific dependency split stays at the existing resolver boundary: markers select one pxr provider and the appropriate torch index without introducing a parallel installation mechanism or new abstraction.
  • API: The reviewed surface includes root dependencies and extras, [tool.uv].environments, platform-specific torch sources, the isaaclab_ov dependency metadata, and generated override files. Existing extra names and package pins remain, but the public documentation misstates the importers behavior: only isaacsim-asset-isolated is excluded on macOS, while tinyobjloader remains available through the extra.
  • Compatibility and deprecation: Breaking changes: none identified. The added darwin environment and darwin-only dependencies extend source-checkout support, while the new exclusion markers preserve the prior Linux and Windows dependency selections. The generated override copies consistently retain the non-macOS usd-exchange requirement.
  • Implementation: The dependency markers are propagated consistently from the root metadata into both generated override files and the isaaclab_ov ovstage dependency. The macOS path selects PyPI for the torch stack and usd-core instead of usd-exchange, while CUDA platforms retain their existing sources and provider.
  • Style consistency: The marker spelling and changelog coverage are consistent with adjacent metadata patterns. However, the installation guide and Isaac Lab changelog say the whole importers extra is unavailable or skipped on macOS, contradicting the metadata that retains tinyobjloader; both statements should identify only the unavailable Isaac Sim asset importer.
  • Test quality: The changed packaging tests extend existing owner-boundary checks rather than adding duplicate platform tests. The CUDA torch assertions remain explicit, but the new macOS/PyPI assertion is vacuous when no non-CUDA package exists; assert that the macOS selection is non-empty before validating its registry.

Minor fixes needed. Posted 2 actionable findings inline.

Automated review; human maintainers own approval decisions.

assert cuda
assert all(package["version"].endswith("+cu130") for package in cuda)
assert all(package["source"]["registry"] == "https://download.pytorch.org/whl/cu130" for package in cuda)
assert all(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Test Quality — macOS torch assertion passes vacuously

The CUDA half is guarded by assert cuda, but this all(...) iterates packages if package not in cuda, which is True for an empty sequence. If the darwin environment is dropped or the lock stops forking these entries, the documented "macOS resolves PyPI torch" contract goes unverified while the test still passes. Assert that the non-CUDA selection is non-empty before checking its registry, mirroring assert cuda.

:sync: macos-arm64

macOS support is experimental and CPU-only. It covers the Newton backend without Isaac Sim;
Isaac Sim, the OV PhysX and OV RTX backends, and the ``importers`` extra are unavailable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Suggestion · Style Consistency — Docs overstate importers extra removal

pyproject.toml excludes only isaacsim-asset-isolated on darwin; tinyobjloader still resolves, so uv run --extra importers installs on macOS. Saying the whole extra is unavailable contradicts the metadata, and the changelog fragment repeats the claim. Reword both to state that the standalone Isaac Sim asset importer is unavailable.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant