forked from Genesis-Embodied-AI/genesis-world
-
Notifications
You must be signed in to change notification settings - Fork 2
210 lines (189 loc) · 7.46 KB
/
Copy pathgeneric.yml
File metadata and controls
210 lines (189 loc) · 7.46 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Generic
on:
pull_request:
branches:
- main
release:
branches:
- main
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
generic-cpu:
name: ${{ matrix.OS }}-${{ matrix.PYTHON_VERSION }}-${{ matrix.GS_BACKEND }}-${{ matrix.GS_ENABLE_NDARRAY == '0' && 'field' || 'ndarray' }}
strategy:
fail-fast: false
matrix:
# See official Github documentation for details: https://shorturl.at/NJgsj
OS: ["ubuntu-24.04", "macos-15"]
PYTHON_VERSION: ["3.10", "3.11", "3.12", "3.13"]
GS_BACKEND: ["cpu"]
GS_ENABLE_NDARRAY: ["1"]
include:
# CPU backend - dynamic array (other OSes)
- OS: "ubuntu-22.04"
PYTHON_VERSION: "3.12"
GS_BACKEND: "cpu"
GS_ENABLE_NDARRAY: "1"
- OS: "ubuntu-24.04-arm"
PYTHON_VERSION: "3.12"
GS_BACKEND: "cpu"
GS_ENABLE_NDARRAY: "1"
- OS: "windows-2025"
PYTHON_VERSION: "3.12"
GS_BACKEND: "cpu"
GS_ENABLE_NDARRAY: "1"
# CPU backend - field array
- OS: "ubuntu-24.04"
PYTHON_VERSION: "3.12"
GS_BACKEND: "cpu"
GS_ENABLE_NDARRAY: "0"
- OS: "ubuntu-24.04-arm"
PYTHON_VERSION: "3.12"
GS_BACKEND: "cpu"
GS_ENABLE_NDARRAY: "0"
# FIXME: Quadrants compilation is taking so slow on Windows that running the unit tests
# for static arrays takes about 400min, which is not acceptable. Disabling for now.
# - OS: "windows-2025"
# PYTHON_VERSION: "3.12"
# GS_BACKEND: "cpu"
# GS_ENABLE_NDARRAY: "0"
- OS: "macos-15"
PYTHON_VERSION: "3.12"
GS_BACKEND: "cpu"
GS_ENABLE_NDARRAY: "0"
# GPU backend - field array
- OS: "macos-15"
PYTHON_VERSION: "3.12"
GS_BACKEND: "gpu"
GS_ENABLE_NDARRAY: "1"
env:
HF_HUB_DOWNLOAD_TIMEOUT: "60"
FORCE_COLOR: "1"
PY_COLORS: "1"
GS_CACHE_FILE_PATH: ".cache/genesis"
GS_ENABLE_NDARRAY: ${{ matrix.GS_ENABLE_NDARRAY }}
GS_TORCH_FORCE_CPU_DEVICE: ${{ startsWith(matrix.OS, 'macos-') && '1' || '0' }}
QD_OFFLINE_CACHE: "1"
QD_OFFLINE_CACHE_CLEANING_POLICY: "never"
QD_OFFLINE_CACHE_FILE_PATH: ".cache/quadrants"
QD_ENABLE_CUDA: ${{ matrix.GS_BACKEND == 'gpu' && '1' || '0' }}
QD_ENABLE_AMDGPU: ${{ matrix.GS_BACKEND == 'gpu' && '1' || '0' }}
QD_ENABLE_METAL: ${{ matrix.GS_BACKEND == 'gpu' && '1' || '0' }}
QD_DEBUG: "0"
OMNI_KIT_ACCEPT_EULA: "yes"
runs-on: ${{ matrix.OS }}
if: github.event_name != 'release'
steps:
- name: Print system information (Windows)
if: startsWith(matrix.OS, 'windows-')
shell: pwsh
run: |
$cpu = Get-CimInstance -ClassName Win32_Processor
$ram = Get-CimInstance -ClassName Win32_ComputerSystem
[PSCustomObject]@{
CPU_Name = $cpu.Name
Physical_Cores = ($cpu | Measure-Object -Property NumberOfCores -Sum).Sum
Logical_Processors = ($cpu | Measure-Object -Property NumberOfLogicalProcessors -Sum).Sum
Total_RAM_GB = [math]::Round($ram.TotalPhysicalMemory / 1GB, 2)
}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install system dependencies (Windows)
if: startsWith(matrix.OS, 'windows-')
shell: bash
run: |
curl -L -o mesa.7z https://github.com/pal1000/mesa-dist-win/releases/download/25.1.5/mesa3d-25.1.5-release-msvc.7z
7z x mesa.7z -omesa
mv -v mesa/x64/* /C/Windows/System32/
- name: Install Mesa OpenGL driver (Linux)
if: startsWith(matrix.OS, 'ubuntu-')
run: |
for retry in {1..10}; do
sudo add-apt-repository -y ppa:kisak/kisak-mesa && break || sleep 5;
done
sudo apt install -y \
libglu1-mesa \
libegl-mesa0 \
libgl1-mesa-dev
- name: Install python dependencies
shell: bash
run: |
python -m pip install --upgrade pip setuptools pkg-info wheel
# FIXME: Must install torch>2.9.1 to support zerocopy on Apple Metal
pip3 install torch --upgrade --index-url https://download.pytorch.org/whl/cpu
- name: Install Genesis
shell: bash
run: |
PYTHON_DEPS="dev"
# Install USD for all platforms except ARM (usd-core doesn't support ARM)
# This is required for test_mesh.py which tests USD parsing functionality
if [[ "${{ matrix.OS }}" != 'ubuntu-24.04-arm' ]] ; then
PYTHON_DEPS="${PYTHON_DEPS},usd"
fi
pip install ".[${PYTHON_DEPS}]"
- name: Get artifact prefix name
id: artifact_prefix
shell: bash
run: |
OS_FAMILY=$(python -c "import platform; print(platform.system())")
MACHINE_ARCH=$(python -c "import platform; print(platform.machine())")
QUADRANTS_VERSION=$(python -c "import importlib.metadata ; print(importlib.metadata.version('quadrants'))")
echo "ARTIFACT_PREFIX=${OS_FAMILY}-${MACHINE_ARCH}-${QUADRANTS_VERSION}" >> $GITHUB_OUTPUT
- name: Restore Quadrants Kernel Cache
if: ${{ always() && steps.artifact_prefix.outputs.ARTIFACT_PREFIX != '' }}
uses: actions/cache/restore@v4
with:
path: .cache
key: ${{ steps.artifact_prefix.outputs.ARTIFACT_PREFIX }}
restore-keys: |
${{ steps.artifact_prefix.outputs.ARTIFACT_PREFIX }}-
- name: Run unit tests
run: |
pytest -v -ra --logical --dev --backend ${{ matrix.GS_BACKEND }} -m 'required and not slow' --forked ./tests
- name: Save Updated Quadrants Kernel Cache
if: >-
${{ always() &&
(matrix.OS == 'ubuntu-24.04' || matrix.OS == 'ubuntu-24.04-arm' || matrix.OS == 'macos-15' || matrix.OS == 'windows-2025') &&
matrix.PYTHON_VERSION == '3.12' &&
matrix.GS_BACKEND == 'cpu' &&
matrix.GS_ENABLE_NDARRAY == '1' &&
steps.artifact_prefix.outputs.ARTIFACT_PREFIX != '' }}
uses: actions/cache/save@v4
with:
path: .cache
# Note that it is necessary to create a new archive systematically for now:
# See: https://github.com/actions/cache/issues/1594
key: ${{ steps.artifact_prefix.outputs.ARTIFACT_PREFIX }}-${{ github.run_id }}-${{ github.run_attempt }}
publish-pypi:
name: Publish on PyPI
runs-on: ubuntu-24.04
permissions:
id-token: write
environment:
name: advance
if: github.event_name == 'release'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build wheels
run: |
pip wheel --no-deps . -w wheelhouse
- name: Publish the wheels on PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
packages-dir: wheelhouse
verify-metadata: true
attestations: true
print-hash: true
skip-existing: true