Skip to content

feat(macos): enable mujoco/mjbatch tensor-runtime off-policy training on macOS #120

feat(macos): enable mujoco/mjbatch tensor-runtime off-policy training on macOS

feat(macos): enable mujoco/mjbatch tensor-runtime off-policy training on macOS #120

name: Tensor Runtime CI
on:
pull_request:
branches: [develop/tensor-runtime]
workflow_dispatch:
inputs:
run_cuda:
description: Run the explicitly gated single-GPU CUDA profile
required: false
default: false
type: boolean
cuda_devices:
description: CUDA device mask for the gated profile (single GPU only)
required: false
default: "0"
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
env:
UV_FROZEN: "1"
UNILAB_LOCAL_UNISIM: ${{ github.workspace }}/../unisim
jobs:
focused-cpu:
name: Focused CPU tensor profile
timeout-minutes: 20
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6.0.2
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }}
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
version: "0.12.5"
enable-cache: true
python-version: "3.11"
- name: Materialize pinned sibling workspace
run: uv run --no-project python scripts/tools/sync_tensor_workspace.py --sync
- name: Install CPU runtime
run: |
uv sync --extra mujoco \
--no-install-package torch \
--no-install-package nvidia-cublas-cu12 \
--no-install-package nvidia-cuda-cupti-cu12 \
--no-install-package nvidia-cuda-nvrtc-cu12 \
--no-install-package nvidia-cuda-runtime-cu12 \
--no-install-package nvidia-cudnn-cu12 \
--no-install-package nvidia-cufft-cu12 \
--no-install-package nvidia-cufile-cu12 \
--no-install-package nvidia-curand-cu12 \
--no-install-package nvidia-cusolver-cu12 \
--no-install-package nvidia-cusparse-cu12 \
--no-install-package nvidia-cusparselt-cu12 \
--no-install-package nvidia-nccl-cu12 \
--no-install-package nvidia-nvjitlink-cu12 \
--no-install-package nvidia-nvtx-cu12 \
--no-install-package triton
uv pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu
- name: Focused contract tests
run: >
uv run --no-sync pytest -q
tests/base/test_backend_imports.py::test_unisim_dependency_uses_an_approved_source
tests/scripts/test_tensor_workspace.py
tests/tasks/test_tensor_runtime_components.py
tests/tasks/test_go2_tensor_runtime.py
tests/scripts/test_g1_flashsac_backend.py
tests/algos/test_offpolicy_double_buffer_runner.py
gated-cuda:
name: Gated single-GPU tensor profile
if: github.event_name == 'workflow_dispatch' && inputs.run_cuda
timeout-minutes: 45
runs-on: [self-hosted, cuda]
env:
CUDA_VISIBLE_DEVICES: ${{ inputs.cuda_devices }}
steps:
- uses: actions/checkout@v6.0.2
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
version: "0.12.5"
# The self-hosted CUDA profile uses a persistent shared uv cache;
# avoid setup-uv's save/prune hooks on it.
enable-cache: false
python-version: "3.11"
- name: Materialize pinned sibling workspace
run: uv run --no-project python scripts/tools/sync_tensor_workspace.py --sync
- name: Install tensor runtime
run: uv sync --extra mujoco --extra mjwarp --extra newton --extra uni_rl
- name: CUDA task contract tests
run: >
uv run --no-sync pytest -q
tests/tasks/test_flashsac_owner_contract.py
tests/tasks/test_tensor_runtime_components.py