Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
- [ ] `python matchmaker_eval/validate_submission.py submissions/<name> --smoke`
passes locally.
- [ ] I tuned on the **valid** fold (or my own data) and did not use the eval
fold to develop, tune, select or validate this follower —
fold to develop, tune, select or validate this score follower —
see [docs/eval-protocol.md](../docs/eval-protocol.md).
- [ ] The code is mine to submit under the repository's licence, or I have said
in `metadata.yaml` where it comes from.

### For the maintainer

The evaluation runs automatically after merge; the leaderboard is committed by
CI. Review is the trust boundary — CI executes submitted code, it does not
sandbox it. See [docs/maintaining.md](../docs/maintaining.md).
123 changes: 0 additions & 123 deletions .github/workflows/evaluate-amt.yml

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/evaluate-delay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: "Evaluate - Matchmaker (delay)"
on:
workflow_call:
inputs:
shards:
type: string
default: '2'
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
shards: ${{ steps.plan.outputs.shards }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- id: plan
env:
SHARDS: ${{ inputs.shards }}
run: |
pip install --quiet pyyaml
python - <<'PY' >> "$GITHUB_OUTPUT"
import json
import os

import yaml

methods = sorted(yaml.safe_load(open("data/builtin_methods.yaml"))["audio"])
shards = int(os.environ["SHARDS"])
print("matrix=" + json.dumps({"method": methods, "shard": list(range(shards))}))
print(f"shards={shards}")
PY
evaluate:
needs: plan
runs-on: ubuntu-latest
timeout-minutes: 350
strategy:
fail-fast: false
max-parallel: 12
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
env:
MATCHMAKER_DATA_DIR: ${{ github.workspace }}/benchmark-data
OMP_NUM_THREADS: '1'
OPENBLAS_NUM_THREADS: '1'
MKL_NUM_THREADS: '1'
NUMEXPR_NUM_THREADS: '1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends fluidsynth libsndfile1 ffmpeg
pip install -r requirements-eval.txt
- name: Stream the valid fold at playback speed
run: |
python matchmaker_eval/run_delay.py --method '${{ matrix.method }}' \
--shard '${{ matrix.shard }}' --num-shards '${{ needs.plan.outputs.shards }}' \
--output results/delay
- uses: actions/upload-artifact@v4
with:
name: refshard-${{ matrix.method }}-audio-${{ matrix.shard }}
path: results/delay
retention-days: 30
merge:
needs: [plan, evaluate]
if: always() && needs.plan.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: |
pip install -r requirements-eval.txt
- uses: actions/download-artifact@v4
with:
pattern: refshard-*
path: results/refshards
- name: Merge each method
run: python matchmaker_eval/merge_references.py results/refshards --output results/delay
- name: Summarise the delays
run: |
python - <<'PY' | tee -a "$GITHUB_STEP_SUMMARY"
import json
from pathlib import Path

import numpy as np

keys = ["delay_median_ms", "delay_p95_ms", "delay_max_ms", "delay_end_ms"]
print("| method | " + " | ".join(keys) + " |")
print("|---" * (len(keys) + 1) + "|")
for path in sorted(Path("results/delay").glob("*/metrics.json")):
pieces = json.loads(path.read_text())["pieces"]
medians = [np.nanmedian([p.get(k, np.nan) for p in pieces]) for k in keys]
print(f"| {path.parent.name} | " + " | ".join(f"{v:.0f}" for v in medians) + " |")
PY
- uses: actions/upload-artifact@v4
if: always()
with:
name: benchmark-results-delay
path: results/delay
retention-days: 90
5 changes: 2 additions & 3 deletions .github/workflows/evaluate-diagnostics.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Evaluate diagnostic suites
name: "Evaluate - Matchmaker (diagnostics)"
on:
workflow_call:
inputs:
Expand Down Expand Up @@ -67,8 +67,7 @@ jobs:
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends fluidsynth libsndfile1 ffmpeg
pip install "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install pyyaml pydantic-settings
pip install -r requirements-eval.txt
- name: Run frozen diagnostic cases
run: |
python matchmaker_eval/run_diagnostics.py run \
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/evaluate-offline.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Evaluate offline reference
name: "Evaluate - Matchmaker (offline)"
on:
workflow_call:
inputs:
Expand Down Expand Up @@ -54,8 +54,7 @@ jobs:
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends fluidsynth libsndfile1 ffmpeg
pip install "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install pyyaml pydantic-settings
pip install -r requirements-eval.txt
- name: Install the offline numerical environment
run: |
pip install 'numpy==1.26.4' 'scipy==1.14.1' 'pandas==2.2.3' 'librosa==0.10.2' 'numba==0.64.0' ipython pretty_midi music21
Expand Down Expand Up @@ -84,8 +83,7 @@ jobs:
with:
python-version: '3.12'
- run: |
pip install "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install pyyaml pydantic-settings
pip install -r requirements-eval.txt
- uses: actions/download-artifact@v4
with:
pattern: offline-*
Expand Down
47 changes: 34 additions & 13 deletions .github/workflows/evaluate-references.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Evaluate the built-in methods described in data/builtin_methods.yaml.
name: Evaluate references
name: "Evaluate - Matchmaker"

on:
workflow_dispatch:
Expand All @@ -15,7 +15,7 @@ on:
required: false
default: ""
fold:
description: "Fold: eval, beyond_piano, diagnostics, offline, or amt_reference"
description: "Fold: eval, beyond_piano, diagnostics, offline, or delay"
required: false
default: eval
shards:
Expand All @@ -35,12 +35,6 @@ env:
FOLD: ${{ github.event.inputs.fold || 'eval' }}

jobs:
amt_reference:
if: github.event.inputs.fold == 'amt_reference'
uses: ./.github/workflows/evaluate-amt.yml
with:
shards: ${{ github.event.inputs.shards || '4' }}

offline:
if: github.event.inputs.fold == 'offline'
uses: ./.github/workflows/evaluate-offline.yml
Expand All @@ -55,8 +49,14 @@ jobs:
only: ${{ github.event.inputs.only || '' }}
input_type: ${{ github.event.inputs.input_type || 'both' }}

delay:
if: github.event.inputs.fold == 'delay'
uses: ./.github/workflows/evaluate-delay.yml
with:
shards: ${{ github.event.inputs.shards || '2' }}

plan:
if: github.event.inputs.fold != 'diagnostics' && github.event.inputs.fold != 'offline' && github.event.inputs.fold != 'amt_reference'
if: github.event.inputs.fold != 'diagnostics' && github.event.inputs.fold != 'offline' && github.event.inputs.fold != 'delay'
runs-on: ubuntu-latest
outputs:
jobs: ${{ steps.plan.outputs.jobs }}
Expand Down Expand Up @@ -92,6 +92,14 @@ jobs:
if not only or method in only
for s in range(n)
]
amt = yaml.safe_load(open("data/amt_methods.yaml"))["midi"]
if os.environ["FOLD"] == "eval" and "audio" in types:
jobs += [
{"method": f"amt-{method}", "amt": method, "input_type": "audio", "shard": s}
for method in amt
if not only or f"amt-{method}" in only
for s in range(n)
]
print(f"jobs={json.dumps(jobs)}")
print(f"count={len(jobs)}")
print(f"num_shards={n}")
Expand Down Expand Up @@ -140,8 +148,7 @@ jobs:
- name: Install the benchmark environment
run: |
python -m pip install --upgrade pip
pip install "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install pyyaml pydantic-settings
pip install -r requirements-eval.txt

- name: Check out the benchmark data
if: vars.MATCHMAKER_DATA_DIR == ''
Expand Down Expand Up @@ -193,6 +200,7 @@ jobs:
--num-shards ${{ needs.plan.outputs.num_shards }}

- name: Run the shard
if: ${{ !matrix.job.amt }}
# One BLAS thread keeps the timing columns comparable across runners.
env:
OMP_NUM_THREADS: "1"
Expand All @@ -208,6 +216,20 @@ jobs:
--num-shards ${{ needs.plan.outputs.num_shards }} \
--output "results/shards/current"

- name: Run the shard on frozen AMT output
if: ${{ matrix.job.amt }}
env:
OMP_NUM_THREADS: "1"
OPENBLAS_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
NUMEXPR_NUM_THREADS: "1"
run: |
python matchmaker_eval/run_amt.py \
--method "${{ matrix.job.amt }}" \
--shard ${{ matrix.job.shard }} \
--num-shards ${{ needs.plan.outputs.num_shards }} \
--output "results/shards/current"

- uses: actions/upload-artifact@v4
with:
name: refshard-${{ matrix.job.method }}-${{ matrix.job.input_type }}-${{ matrix.job.shard }}
Expand All @@ -227,8 +249,7 @@ jobs:

- name: Install what the merge needs
run: |
pip install --quiet "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install --quiet pyyaml pydantic-settings
pip install --quiet -r requirements-eval.txt

- uses: actions/download-artifact@v4
with:
Expand Down
Loading
Loading