Skip to content

Commit 4456db0

Browse files
committed
linux cpu unit tests
1 parent 45cdbd1 commit 4456db0

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

.circleci/unittest/linux/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ printf "Installing PyTorch with %s\n" "${CU_VERSION}"
3030
if [ "${CU_VERSION:-}" == cpu ] ; then
3131
pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
3232
else
33-
pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu113
33+
pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
3434
fi
3535

3636
# smoke test

.circleci/unittest/linux/scripts/setup_env.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,21 @@ else
6363
fi
6464

6565
export MUJOCO_GL=$PRIVATE_MUJOCO_GL
66-
conda env config vars set MUJOCO_PY_MUJOCO_PATH=$root_dir/.mujoco/mujoco210 \
66+
if [ "${CU_VERSION:-}" == cpu ]; then
67+
conda env config vars set MUJOCO_PY_MUJOCO_PATH=$root_dir/.mujoco/mujoco210 \
6768
DISPLAY=unix:0.0 \
6869
MJLIB_PATH=$root_dir/.mujoco/mujoco-2.1.1/lib/libmujoco.so.2.1.1 \
6970
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$root_dir/.mujoco/mujoco210/bin \
7071
SDL_VIDEODRIVER=dummy \
7172
MUJOCO_GL=$PRIVATE_MUJOCO_GL \
7273
PYOPENGL_PLATFORM=$PRIVATE_MUJOCO_GL
74+
else
75+
conda env config vars set MUJOCO_PY_MUJOCO_PATH=$root_dir/.mujoco/mujoco210 \
76+
MJLIB_PATH=$root_dir/.mujoco/mujoco-2.1.1/lib/libmujoco.so.2.1.1 \
77+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$root_dir/.mujoco/mujoco210/bin \
78+
MUJOCO_GL=$PRIVATE_MUJOCO_GL \
79+
PYOPENGL_PLATFORM=$PRIVATE_MUJOCO_GL
80+
fi
7381

7482
# Software rendering requires GLX and OSMesa.
7583
if [ $PRIVATE_MUJOCO_GL == 'egl' ] || [ $PRIVATE_MUJOCO_GL == 'osmesa' ] ; then

.github/workflows/test-linux-cpu.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Unit-tests on Linux CPU
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- nightly
8+
- main
9+
- release/*
10+
workflow_dispatch:
11+
12+
env:
13+
CHANNEL: "nightly"
14+
15+
jobs:
16+
tests:
17+
strategy:
18+
matrix:
19+
python_version: ["3.8", "3.9", "3.10"]
20+
fail-fast: false
21+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
22+
with:
23+
runner: linux.12xlarge
24+
repository: pytorch/rl
25+
timeout: 90
26+
script: |
27+
# Set env vars from matrix
28+
export PYTHON_VERSION=${{ matrix.python_version }}
29+
export CU_VERSION="cpu"
30+
31+
echo "PYTHON_VERSION: $PYTHON_VERSION"
32+
echo "CU_VERSION: $CU_VERSION"
33+
34+
cd /work
35+
36+
## setup_env.sh
37+
./.circleci/unittest/linux/scripts/setup_env.sh
38+
39+
## install.sh
40+
./.circleci/unittest/linux/scripts/install.sh
41+
42+
## run_test.sh
43+
./.circleci/unittest/linux/scripts/run_test.sh
44+
45+
## post_process.sh
46+
./.circleci/unittest/linux/scripts/post_process.sh

0 commit comments

Comments
 (0)