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
123 changes: 123 additions & 0 deletions .github/workflows/evaluate-amt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Evaluate frozen AMT outputs
on:
workflow_call:
inputs:
shards:
type: string
default: '4'
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 = yaml.safe_load(open("data/amt_methods.yaml"))["midi"]
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: 180
strategy:
fail-fast: false
max-parallel: 8
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
env:
MATCHMAKER_DATA_DIR: ${{ github.workspace }}/benchmark-data
MATCHMAKER_DATA_BRANCH: 03b51262b9bce7993203044fa45c9be9dadebd34
OMP_NUM_THREADS: '1'
OPENBLAS_NUM_THREADS: '1'
MKL_NUM_THREADS: '1'
NUMBA_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 "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install pyyaml pydantic-settings
- name: Run symbolic follower on frozen transcription
run: |
python matchmaker_eval/run_amt.py --method '${{ matrix.method }}' \
--shard '${{ matrix.shard }}' --num-shards '${{ needs.plan.outputs.shards }}' --output results/amt
- name: Record installed packages
if: always()
run: mkdir -p results/amt && pip freeze > results/amt/environment.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: amt-${{ matrix.method }}-${{ matrix.shard }}
path: results/amt
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 "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install pyyaml pydantic-settings
- uses: actions/download-artifact@v4
with:
pattern: amt-*
path: results/shards
- name: Merge the shards
env:
SHARDS: ${{ needs.plan.outputs.shards }}
run: |
python - <<'PY'
import json
import os
import shutil
import sys
from pathlib import Path

import yaml

sys.path.insert(0, 'matchmaker_eval')
from merge_shards import merge
from matchmaker_eval.fetch_data import frozen_source

out = Path('results/amt-reference')
out.mkdir(parents=True, exist_ok=True)
for method in yaml.safe_load(open('data/amt_methods.yaml'))['midi']:
stage = Path('results/staging') / method
for i in range(int(os.environ['SHARDS'])):
shutil.copytree(Path('results/shards') / f'amt-{method}-{i}', stage / str(i))
merge(stage, out / method)
shutil.copytree('results/shards', out / 'raw-shards')
(out / 'amt-data-pin.json').write_text(json.dumps(frozen_source('amt'), indent=2))
PY
- uses: actions/upload-artifact@v4
with:
name: benchmark-results-amt-reference
path: results/amt-reference
retention-days: 90
105 changes: 105 additions & 0 deletions .github/workflows/evaluate-diagnostics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Evaluate diagnostic suites
on:
workflow_call:
inputs:
shards:
type: string
default: '4'
only:
type: string
default: ''
input_type:
type: string
default: both
permissions:
contents: read
env:
ONLY: ${{ inputs.only }}
INPUT_TYPE: ${{ inputs.input_type }}
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

from matchmaker_eval.run_diagnostics import select_configs

shards = int(os.environ["SHARDS"])
configs = select_configs(os.environ["ONLY"], os.environ["INPUT_TYPE"])
print("matrix=" + json.dumps([{"config": c, "shard": s} for c in configs for s in 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:
job: ${{ fromJSON(needs.plan.outputs.matrix) }}
env:
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
- name: Install environment
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
- name: Run frozen diagnostic cases
run: |
python matchmaker_eval/run_diagnostics.py run \
--config '${{ matrix.job.config }}' --shard '${{ matrix.job.shard }}' \
--shards '${{ needs.plan.outputs.shards }}' --output results/diagnostics
- uses: actions/upload-artifact@v4
if: always()
with:
name: diagnosis-${{ matrix.job.config }}-${{ matrix.job.shard }}
path: results/diagnostics
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 numpy pyyaml
- uses: actions/download-artifact@v4
with:
pattern: diagnosis-*
path: results/shards
- name: Aggregate
run: |
python matchmaker_eval/run_diagnostics.py merge --source results/shards \
--output results/diagnosis
- uses: actions/upload-artifact@v4
with:
name: benchmark-results-diagnosis
path: results/diagnosis
retention-days: 90
120 changes: 120 additions & 0 deletions .github/workflows/evaluate-offline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Evaluate offline reference
on:
workflow_call:
inputs:
shards:
type: string
default: '8'
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
shards: ${{ steps.plan.outputs.shards }}
steps:
- id: plan
env:
SHARDS: ${{ inputs.shards }}
run: |
python - <<'PY' >> "$GITHUB_OUTPUT"
import json
import os

shards = int(os.environ["SHARDS"])
jobs = [{"fold": fold, "shard": s} for fold in ["eval", "beyond_piano"] for s in range(shards)]
print("matrix=" + json.dumps(jobs))
print(f"shards={shards}")
PY
evaluate:
needs: plan
runs-on: ubuntu-latest
timeout-minutes: 350
strategy:
fail-fast: false
max-parallel: 12
matrix:
job: ${{ fromJSON(needs.plan.outputs.matrix) }}
env:
MATCHMAKER_DATA_DIR: ${{ github.workspace }}/benchmark-data
MATCHMAKER_DATA_BRANCH: 03b51262b9bce7993203044fa45c9be9dadebd34
OMP_NUM_THREADS: '1'
OPENBLAS_NUM_THREADS: '1'
MKL_NUM_THREADS: '1'
NUMEXPR_NUM_THREADS: '1'
NUMBA_NUM_THREADS: '1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: Install fixed environment
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
- 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
pip install --no-deps 'synctoolbox==1.3.2' 'libfmp==1.3.0'
- name: Run offline reference
run: |
python matchmaker_eval/run_offline.py --fold '${{ matrix.job.fold }}' \
--shard '${{ matrix.job.shard }}' --num-shards '${{ needs.plan.outputs.shards }}' \
--piece-timeout 2400 --output results/offline
- name: Record installed packages
if: always()
run: mkdir -p results/offline && pip freeze > results/offline/environment.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: offline-${{ matrix.job.fold }}-${{ matrix.job.shard }}
path: results/offline
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 "pymatchmaker @ git+https://github.com/pymatchmaker/matchmaker.git@v0.5.0"
pip install pyyaml pydantic-settings
- uses: actions/download-artifact@v4
with:
pattern: offline-*
path: results/shards
- name: Merge the shards
env:
SHARDS: ${{ needs.plan.outputs.shards }}
run: |
python - <<'PY'
import os
import shutil
import sys
from pathlib import Path

sys.path.insert(0, 'matchmaker_eval')
from merge_shards import merge

output = Path('results/offline-reference')
output.mkdir(parents=True, exist_ok=True)
for fold in ['eval', 'beyond_piano']:
key = 'offline-' + fold
stage = Path('results/staging') / key
for i in range(int(os.environ['SHARDS'])):
shutil.copytree(Path('results/shards') / f'{key}-{i}', stage / str(i))
merge(stage, output / key)
shutil.copytree('results/shards', output / 'raw-shards')
PY
- uses: actions/upload-artifact@v4
with:
name: benchmark-results-offline
path: results/offline-reference
retention-days: 90
Loading
Loading