Skip to content

Commit 75691e1

Browse files
Using more specific GPU runners (#69)
Changing GHA to use more specific GPU runners, so nightly tests split among 1xGPU and 4xGPU, and pytests run on 1xGPU or 4xGPU as appopriate
1 parent 828b339 commit 75691e1

8 files changed

Lines changed: 97 additions & 13 deletions

File tree

.github/workflows/nightly-training.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ permissions:
1515

1616
jobs:
1717
training:
18-
runs-on: codebuild-holosoma-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
18+
runs-on: codebuild-holosoma-l4-${{ matrix.multigpu == 'True' && 'x4' || 'x1' }}-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
19+
#TODO: test nightly on a10g/other GPUs
20+
# runs-on: codebuild-holosoma-a10g-${{ matrix.multigpu == 'True' && 'x4' || 'x1' }}-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
1921
continue-on-error: true
2022
strategy:
2123
fail-fast: false # continue on one experiment failing

.github/workflows/pytest.yaml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,23 @@ on:
1818
jobs:
1919
tests:
2020
strategy:
21+
fail-fast: false # continue on one test failing
2122
matrix:
2223
simulator: [isaacgym, isaacsim]
23-
name: Run ${{ matrix.simulator }} Tests
24-
runs-on: codebuild-holosoma-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
24+
multigpu: ["False"]
25+
# no multigpu isaacsim tests for now
26+
include:
27+
- simulator: isaacgym
28+
multigpu: "True"
29+
name: Run ${{ matrix.simulator }} Tests with ${{ matrix.multigpu == 'True' && 'multi-gpu' || 'single-gpu' }}
30+
runs-on:
31+
- codebuild-holosoma-a10g-${{ matrix.multigpu == 'True' && 'x4' || 'x1' }}-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
32+
continue-on-error: true
2533
container:
26-
image: 982423663241.dkr.ecr.us-west-2.amazonaws.com/holosoma:latest
34+
image: 982423663241.dkr.ecr.us-west-2.amazonaws.com/holosoma-${{ matrix.simulator }}:latest
2735
options: "--gpus all --runtime=nvidia --shm-size=12g"
28-
volumes:
29-
- "precommit-cache:/github/home/.cache/pre-commit"
36+
env:
37+
HOLOSOMA_MULTIGPU: ${{ matrix.multigpu }}
3038
steps:
3139
- name: Checkout code
3240
uses: actions/checkout@v6
@@ -41,11 +49,42 @@ jobs:
4149
fi
4250
bash tests/ci/${{ matrix.simulator }}_ci_tests.sh
4351
52+
e2e-tests:
53+
strategy:
54+
fail-fast: false # continue on one test failing
55+
# e2e only on isaacgym single gpu for now
56+
matrix:
57+
simulator: [isaacgym]
58+
multigpu: ["False"]
59+
name: Run ${{ matrix.simulator }} Tests end-to-end with ${{ matrix.multigpu == 'True' && 'multi-gpu' || 'single-gpu' }}
60+
runs-on:
61+
- codebuild-holosoma-a10g-${{ matrix.multigpu == 'True' && 'x4' || 'x1' }}-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
62+
continue-on-error: true
63+
container:
64+
# needs both hsgym and hsinference envs
65+
image: 982423663241.dkr.ecr.us-west-2.amazonaws.com/holosoma:latest
66+
options: "--gpus all --runtime=nvidia --shm-size=12g"
67+
env:
68+
HOLOSOMA_MULTIGPU: ${{ matrix.multigpu }}
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v6
72+
- name: Pytest
73+
id: pytest
74+
shell: bash
75+
run: |
76+
ln -s /root/.holosoma_deps "$HOME/.holosoma_deps"
77+
if [[ ! -L /workspace/holosoma ]]; then
78+
rm -rf /workspace/holosoma
79+
ln -sfF "$GITHUB_WORKSPACE" /workspace/holosoma
80+
fi
81+
bash tests/ci/${{ matrix.simulator }}_e2e_ci_tests.sh
82+
4483
inference-tests:
4584
name: Run Inference Unit Tests
4685
runs-on: codebuild-holosoma-cpu-build-${{ github.run_id }}-${{ github.run_attempt }}
4786
container:
48-
# TODO: Switch to holosoma-inference:latest once it's available in ECR
87+
# TODO: Switch to `holosoma-inference` once it's been confirmed functional
4988
# image: 982423663241.dkr.ecr.us-west-2.amazonaws.com/holosoma-inference:latest
5089
# Until then, the inference tests will run in isaacsim env.
5190
image: 982423663241.dkr.ecr.us-west-2.amazonaws.com/holosoma:latest

conftest.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44
from holosoma.utils.safe_torch_import import torch # noqa: F401
55

66

7+
def mark_str(marker, msg):
8+
return f"{marker}: marks tests as requiring {msg} (deselect with '-m \"not {marker}\"')"
9+
10+
711
def pytest_configure(config):
812
"""Register custom markers for pytest."""
913
config.addinivalue_line(
10-
"markers", "isaacsim: marks tests as requiring Isaac Sim (deselect with '-m \"not isaacsim\"')"
14+
"markers",
15+
mark_str("isaacsim", "Isaac Sim"),
16+
)
17+
config.addinivalue_line(
18+
"markers",
19+
mark_str("multi_gpu", "multiple GPUs"),
1120
)
1221
config.addinivalue_line(
13-
"markers", "multi_gpu: marks tests as requiring multiple GPUs (deselect with '-m \"not multi_gpu\"')"
22+
"markers",
23+
mark_str("requires_inference", "inference environment"),
1424
)

scripts/source_isaacgym_setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ fi
88
CONDA_ENV_NAME=${CONDA_ENV_NAME:-hsgym}
99
echo "conda environment name is set to: $CONDA_ENV_NAME"
1010

11-
source ${SCRIPT_DIR}/source_common.sh
12-
source ${CONDA_ROOT}/bin/activate $CONDA_ENV_NAME
11+
source "${SCRIPT_DIR}/source_common.sh"
12+
source "${CONDA_ROOT}/bin/activate" "$CONDA_ENV_NAME"
1313
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CONDA_ROOT}/envs/$CONDA_ENV_NAME/lib

tests/ci/isaacgym_ci_tests.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@ source scripts/source_isaacgym_setup.sh
88
pip install -e 'src/holosoma[unitree,booster]'
99
pip install -e src/holosoma_inference
1010

11-
pytest -s --ignore=thirdparty --ignore=src/holosoma_inference -m "not isaacsim"
11+
marker="not isaacsim and not requires_inference"
12+
if [[ "$HOLOSOMA_MULTIGPU" == "True" ]]; then
13+
marker="$marker and multi_gpu"
14+
elif [[ "$HOLOSOMA_MULTIGPU" == "False" ]]; then
15+
marker="$marker and not multi_gpu"
16+
fi
17+
18+
pytest -s --ignore=thirdparty --ignore=src/holosoma_inference -m "$marker"

tests/ci/isaacgym_e2e_ci_tests.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# CI runs this inside holosoma docker
3+
set -ex
4+
5+
cd /workspace/holosoma
6+
7+
source scripts/source_isaacgym_setup.sh
8+
pip install -e 'src/holosoma[unitree,booster]'
9+
pip install -e src/holosoma_inference
10+
11+
marker="not isaacsim and requires_inference"
12+
if [[ "$HOLOSOMA_MULTIGPU" == "True" ]]; then
13+
marker="$marker and multi_gpu"
14+
elif [[ "$HOLOSOMA_MULTIGPU" == "False" ]]; then
15+
marker="$marker and not multi_gpu"
16+
fi
17+
18+
pytest -s --ignore=thirdparty --ignore=src/holosoma_inference -m "$marker"

tests/ci/isaacsim_ci_tests.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@ source scripts/source_isaacsim_setup.sh
99
python -m pip install -e 'src/holosoma[unitree,booster]'
1010
python -m pip install -e src/holosoma_inference
1111

12-
python -m pytest -s -m "isaacsim" --ignore=holosoma/holosoma/envs/legged_base_task/tests/ --ignore=thirdparty --ignore=src/holosoma_inference
12+
marker="isaacsim and not requires_inference"
13+
if [[ "$HOLOSOMA_MULTIGPU" == "True" ]]; then
14+
marker="$marker and multi_gpu"
15+
elif [[ "$HOLOSOMA_MULTIGPU" == "False" ]]; then
16+
marker="$marker and not multi_gpu"
17+
fi
18+
19+
python -m pytest -s -m "$marker" --ignore=holosoma/holosoma/envs/legged_base_task/tests/ --ignore=thirdparty --ignore=src/holosoma_inference

tests/e2e/test_run_policy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def assert_run_policy_with_hsinference(config_name: str, model_path: str, timeou
9999
pass
100100

101101

102+
@pytest.mark.requires_inference
102103
@pytest.mark.parametrize(
103104
("workflow_name", "config_name"),
104105
[

0 commit comments

Comments
 (0)