Create configuration for GPU benchmarks on local runner #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GPU Benchmarks | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 1" # Run At 00:00 on Monday | |
permissions: | |
pull-requests: write | |
jobs: | |
benchmark: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/nvidia/jax:jax | |
options: --rm --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
run: | | |
pip install .[all] | |
- name: Install Gazebo SDF | |
run: | | |
apt update | |
apt install -y lsb-release gnupg | |
curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null | |
apt update | |
apt install -y gz-ionic sdf | |
- name: Performance regression check | |
uses: actions/checkout@v4 | |
- name: Run benchmark and store result | |
run: pytest tests/test_benchmark.py --benchmark-only --benchmark-json output.json | |
- name: Download previous benchmark data | |
uses: actions/cache@v4 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: 'pytest' | |
output-file-path: output.json | |
external-data-json-path: ./cache/benchmark-data.json | |
fail-on-alert: true | |
summary-always: true | |
alert-threshold: 150% | |
auto-push: false | |
gh-pages-branch: gh-pages | |
- name: Push benchmark result | |
if: github.event_name != 'pull_request' | |
run: git push 'https://ami-iit:${{ secrets.GITHUB_TOKEN }}@github.com/ami-iit/jaxsim.git' gh-pages:gh-pages |