-
Notifications
You must be signed in to change notification settings - Fork 788
Benchmark replay #3347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Dreamsorcerer
wants to merge
27
commits into
main
Choose a base branch
from
sam/benchmark-replay
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Benchmark replay #3347
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1b8c639
Benchmark replay
Dreamsorcerer 77c8f6b
Merge branch 'main' into sam/benchmark-replay
Dreamsorcerer badf42c
Fix
Dreamsorcerer c0079c7
Merge branch 'sam/benchmark-replay' of github.com:dimensionalOS/dimos…
Dreamsorcerer 11a09b1
Fix
Dreamsorcerer 82a52d1
Fix
Dreamsorcerer 92ca3fa
Fix
Dreamsorcerer 8c41c87
Fix
Dreamsorcerer 8189b7b
Fix
Dreamsorcerer 628aeb6
Fix
Dreamsorcerer ed607ed
Fix
Dreamsorcerer 439c2e6
Merge branch 'main' into sam/benchmark-replay
Dreamsorcerer 3ef4edb
Fix
Dreamsorcerer 5c03ee6
Update codspeed.yml
Dreamsorcerer d63aafb
Fix
Dreamsorcerer c0eeb39
Merge branch 'sam/benchmark-replay' of github.com:dimensionalOS/dimos…
Dreamsorcerer 227bd81
Fix
Dreamsorcerer fec1a35
Fix
Dreamsorcerer 8fcddca
Fix
Dreamsorcerer 4374d1e
Apply suggestions from code review
Dreamsorcerer 1b706d5
[autofix.ci] apply automated fixes
autofix-ci[bot] 8fcece4
Update .github/workflows/codspeed.yml
Dreamsorcerer 45db7f8
Update .github/workflows/codspeed.yml
Dreamsorcerer 9da3d05
Update .github/workflows/codspeed.yml
Dreamsorcerer 5ebb013
Single-process simulation
Dreamsorcerer 83893fb
Fix
Dreamsorcerer ce17563
Enable profiler
Dreamsorcerer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| name: codspeed | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: {} | ||
|
|
||
| env: | ||
| UV_NO_SYNC: "1" | ||
| # Walltime benchmarks die without a traceback otherwise. | ||
| PYTHONFAULTHANDLER: "1" | ||
|
|
||
| jobs: | ||
| compute-ros-pin: | ||
| # Same as ci.yml. | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read # For checkout | ||
| outputs: | ||
| digest: ${{ steps.read.outputs.digest }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| - id: read | ||
| run: | | ||
| DIGEST=$(grep -oE 'sha256:[a-f0-9]{64}' docker/ros-dev-pin/Dockerfile) | ||
| if [ -z "$DIGEST" ]; then | ||
| echo "::error::No sha256 digest found in docker/ros-dev-pin/Dockerfile" | ||
| exit 1 | ||
| fi | ||
| echo "digest=$DIGEST" >> "$GITHUB_OUTPUT" | ||
|
|
||
| benchmarks: | ||
| # Same-repo PRs and pushes only: fork PRs must not run on the self-hosted | ||
| # runner (mirrors the self-hosted-tests gate in ci.yml). | ||
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | ||
| needs: compute-ros-pin | ||
| timeout-minutes: 30 | ||
| # codspeed-macro doesn't support ARMv8.2+ needed for ML dependencies. | ||
| runs-on: | ||
| - self-hosted | ||
| - Linux | ||
| - base | ||
| container: | ||
| image: ghcr.io/dimensionalos/ros-dev@${{ needs.compute-ros-pin.outputs.digest }} | ||
| options: --memory=6g --memory-swap=6g --cap-add PERFMON | ||
| volumes: | ||
| - /var/cache/dimos-nix:/nix | ||
| - /var/cache/dimos-root-cache:/root/.cache | ||
| permissions: | ||
| contents: read | ||
| id-token: write # OIDC upload to CodSpeed (tokenless for public repos) | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| - name: Fetch the replay dataset from LFS if not cached | ||
| run: | | ||
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| if git lfs pointer --check --file data/.lfs/go2_hongkong_office.db.tar.gz; then | ||
| git lfs pull --include="data/.lfs/go2_hongkong_office.db.tar.gz" --exclude="" | ||
| else | ||
| echo "archive already smudged" | ||
| fi | ||
| - name: Install system dependencies | ||
| run: | | ||
| apt-get update | ||
| apt-get install -y libturbojpeg | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v8.3.2 | ||
| with: | ||
| # /root/.cache is a persisted volume | ||
| enable-cache: false | ||
| # uv-managed rather than the container's python for sqlite (>=3.45). | ||
| # TODO: Can be dropped after upgrading to 26.04. | ||
| - name: Setup Python | ||
| run: uv python install 3.12 | ||
| - name: Install dependencies | ||
| run: uv sync --group tests --frozen | ||
| - name: Pre-extract the replay database | ||
| run: uv run python -c "from dimos.utils.data import get_data; print(get_data('go2_hongkong_office.db'))" | ||
| - name: Run benchmarks | ||
| uses: CodSpeedHQ/action@v5 | ||
| env: | ||
| # In this rootful container the runner would otherwise autodetect | ||
| # elevation and wrap the benchmark in systemd-run, which does not | ||
| # exist here. No cpuset hooks either, so run unisolated — the job | ||
| # already has the machine to itself. | ||
| CODSPEED_ISOLATION: "false" | ||
| with: | ||
| mode: walltime | ||
| run: uv run pytest --codspeed -m '' --no-cov dimos/robot/unitree/go2/test_replay_benchmark.py | ||
|
|
||
| simulation: | ||
| # Single-process instruction-count benchmark (Valgrind) of the replay | ||
| # compute pipeline; runs on hosted runners — no self-hosted, no workers. | ||
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | ||
| timeout-minutes: 45 | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write # OIDC upload to CodSpeed | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| - name: Fetch the replay dataset | ||
| run: git lfs pull --include="data/.lfs/go2_short.db.tar.gz" --exclude="" | ||
| # pyaudio build needs portaudio; the recording's JPEG frames need turbojpeg. | ||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y portaudio19-dev libturbojpeg | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v8.3.2 | ||
| with: | ||
| enable-cache: true | ||
| - name: Setup Python | ||
| run: uv python install 3.12 | ||
| - name: Install dependencies | ||
| run: uv sync --group tests --frozen | ||
| - name: Pre-extract the replay database | ||
| run: uv run python -c "from dimos.utils.data import get_data; print(get_data('go2_short.db'))" | ||
| - name: Run benchmarks | ||
| uses: CodSpeedHQ/action@v5 | ||
| with: | ||
| mode: simulation | ||
| run: uv run pytest --codspeed -m '' --no-cov dimos/robot/unitree/go2/test_replay_pipeline_benchmark.py | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.