Make cmaes a bit faster #182
Workflow file for this run
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: Run kurobako benchmark | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/benchmarks.yml' | |
- 'cmaes/**.py' | |
- 'benchmark/*.py' | |
- 'benchmark/runner.sh' | |
- 'requirements-bench.txt' | |
jobs: | |
benchmark-rastrigin: | |
name: Run kurobako benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
- run: pip install -U pip setuptools | |
- run: python setup.py develop | |
- run: pip install --progress-bar off -r requirements-bench.txt | |
- run: pip install --progress-bar off -U git+https://github.com/sile/kurobako-py | |
- run: pip install --progress-bar off -U git+https://github.com/optuna/optuna.git | |
- name: Cache kurobako CLI | |
id: cache-kurobako | |
uses: actions/cache@v3 | |
with: | |
path: ./kurobako | |
key: kurobako-0-2-9 | |
- name: Download kurobako CLI | |
if: steps.cache-kurobako.outputs.cache-hit != 'true' | |
run: | | |
curl -L https://github.com/sile/kurobako/releases/download/0.2.9/kurobako-0.2.9.linux-amd64 -o kurobako | |
chmod +x kurobako | |
./kurobako -h | |
- name: Run benchmark of Rastrigin function | |
env: | |
KUROBAKO: ./kurobako | |
DIM: 2 | |
REPEATS: 10 | |
BUDGET: 2500 | |
run: ./benchmark/runner.sh rastrigin ./kurobako-report.json | |
- name: Plot kurobako result | |
uses: c-bata/github-actions-kurobako/plot@v3 | |
id: kurobako-plot | |
with: | |
report-json-path: './kurobako-report.json' | |
- name: Generate kurobako markdown report | |
run: cat ./kurobako-report.json | ./kurobako report > ./kurobako-report.md | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | |
- run: gcloud info | |
- run: gcloud config set project ${{ secrets.GCP_PROJECT_ID }} | |
- run: gsutil cp ${{ steps.kurobako-plot.outputs.image-path }} gs://cmaes-gh-benchmark/${{ github.repository }}/rastrigin-${{ github.sha }}.png | |
- name: Comment to a pull request | |
uses: c-bata/github-actions-kurobako@v2 | |
with: | |
report-md-path: './kurobako-report.md' | |
public-image-url: https://storage.googleapis.com/cmaes-gh-benchmark/${{ github.repository }}/rastrigin-${{ github.sha }}.png | |
title: 'Benchmark of Rastrigin function' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: mv ./kurobako-report.json ./kurobako-report-rastrigin.json | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: kurobako-report | |
path: kurobako-report-rastrigin.json |