jsummer10 performance improvements #10
Workflow file for this run
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
| name: CodSpeed | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| benchmarks: | |
| name: Run benchmarks | |
| runs-on: codspeed-macro | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.15.0-beta.1 | |
| architecture: arm64-freethreaded | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Hash the dataset seed | |
| # Mix a hash of the secret seed into the cache key so changing the | |
| # seed invalidates the cache, without exposing the seed itself | |
| # (cache keys are visible in the Actions UI). | |
| id: seed-hash | |
| env: | |
| DATASET_SEED: ${{ secrets.DATASET_SEED }} | |
| run: | | |
| hash=$(printf '%s' "$DATASET_SEED" | shasum -a 256 | head -c 16) | |
| echo "value=$hash" >> "$GITHUB_OUTPUT" | |
| - name: Cache datasets | |
| id: cache-datasets | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| rounds/1_histogram/data | |
| rounds/2_corruption/data | |
| rounds/3_dna/data | |
| key: datasets-${{ hashFiles('rounds/*/gen_data.py', 'scripts/setup.py') }}-${{ steps.seed-hash.outputs.value }} | |
| - name: Generate datasets | |
| if: steps.cache-datasets.outputs.cache-hit != 'true' | |
| env: | |
| DATASET_SEED: ${{ secrets.DATASET_SEED }} | |
| run: uv run scripts/setup.py ${DATASET_SEED:+--seed "$DATASET_SEED"} | |
| - name: Run correctness tests | |
| run: uv run pytest -k "not test_bench" | |
| - name: Run benchmarks | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| mode: walltime | |
| run: uv run pytest --codspeed |