-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (116 loc) · 4.62 KB
/
mlx-macos.yml
File metadata and controls
136 lines (116 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Copyright (c) 2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
name: MLX macOS smoke
on:
push:
branches:
- main
- "codex/**"
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mlx-cartpole:
name: MLX cartpole backend smoke
runs-on: macos-14
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
run: python -m pip install --upgrade uv
- name: Create virtual environment
run: uv venv --python 3.11 .venv
- name: Install MLX smoke dependencies
run: |
uv pip install --python .venv/bin/python \
-e source/isaaclab[macos-mlx,dev] \
-e source/isaaclab_rl[dev]
- name: Prepare benchmark artifact directory
run: mkdir -p logs/benchmarks/mlx
- name: Run public install smoke
run: |
PYTHONPATH=.:source/isaaclab:source/isaaclab_rl .venv/bin/python - <<'PY'
import json
from pathlib import Path
from isaaclab.backends import resolve_runtime_selection, set_runtime_selection
set_runtime_selection(resolve_runtime_selection(compute_backend="mlx", sim_backend="mac-sim", device="cpu"))
import isaaclab
import isaaclab.backends.mac_sim
import isaaclab.controllers
import isaaclab.envs.mdp.actions.actions_cfg
import isaaclab.envs.mdp.actions.rmpflow_actions_cfg
import isaaclab.sim
import isaaclab.sim.converters
import isaaclab.sim.schemas
import isaaclab.sim.spawners.from_files
import isaaclab_rl.sb3
import isaaclab_rl.skrl
from isaaclab.backends.mac_sim import MacCartpoleEnv
env = MacCartpoleEnv()
observations, _ = env.reset()
payload = {
"modules": [
"isaaclab",
"isaaclab.backends.mac_sim",
"isaaclab.controllers",
"isaaclab.envs.mdp.actions.actions_cfg",
"isaaclab.envs.mdp.actions.rmpflow_actions_cfg",
"isaaclab.sim",
"isaaclab.sim.converters",
"isaaclab.sim.schemas",
"isaaclab.sim.spawners.from_files",
"isaaclab_rl.sb3",
"isaaclab_rl.skrl",
],
"policy_shape": list(observations["policy"].shape),
"package": isaaclab.__name__,
}
out_path = Path("logs/benchmarks/mlx/install_import_smoke.json")
out_path.write_text(json.dumps(payload, indent=2, sort_keys=True) + "\n", encoding="utf-8")
print(payload["policy_shape"])
PY
- name: Run MLX backend smoke tests
run: |
PYTHONPATH=.:source/isaaclab:source/isaaclab_rl .venv/bin/pytest \
scripts/tools/test/test_bootstrap_isaac_sources.py \
source/isaaclab/test/backends/test_runtime.py \
source/isaaclab_rl/test/test_import_safety.py \
source/isaaclab/test/backends/test_portability_utils.py \
source/isaaclab/test/backends/test_mac_cartpole.py \
source/isaaclab/test/backends/test_mac_cartpole_showcase.py \
source/isaaclab/test/backends/test_mac_cart_double_pendulum.py \
source/isaaclab/test/backends/test_mac_quadcopter.py -q
- name: Run MLX cart-double-pendulum smoke script
run: |
PYTHONPATH=.:source/isaaclab .venv/bin/python \
scripts/reinforcement_learning/mlx/play_cart_double_pendulum.py \
--num-envs 8 --episodes 1 --max-steps 256 --random-actions
- name: Run MLX quadcopter smoke script
run: |
PYTHONPATH=.:source/isaaclab .venv/bin/python \
scripts/reinforcement_learning/mlx/play_quadcopter.py \
--num-envs 8 --episodes 1 --episode-length-s 0.5 --max-steps 256 --thrust-action 0.2 --no-random-actions
- name: Run MLX benchmark smoke
run: |
PYTHONPATH=.:source/isaaclab .venv/bin/python \
scripts/benchmarks/mlx/benchmark_mac_tasks.py \
--tasks cartpole cart-double-pendulum quadcopter \
--num-envs 64 \
--steps 128 \
--json-out logs/benchmarks/mlx/smoke.json
- name: Upload MLX smoke artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: mlx-macos-smoke-${{ github.run_id }}
path: logs/benchmarks/mlx
if-no-files-found: warn