Skip to content
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

Simple LHA benchmark workflow #227

Merged
merged 16 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
44 changes: 44 additions & 0 deletions .github/workflows/lha_bot.yml
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# A single CI script with github workflow.
name: LHA Benchmarks

on:
push:
branches:
- master
pull_request:
types:
- closed
- ready_for_review
- review_requested
pull_request_review:
types:
- submitted

jobs:
lhabench:
name: LHA paper Benchmarks
runs-on: ubuntu-latest
container:
image: ghcr.io/n3pdf/bench-evol:v2
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
with:
# tags needed for dynamic versioning
fetch-depth: 0
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
installer-parallel: true
- name: Install project
run: |
poetry install --no-interaction --with test -E mark -E box
- name: Install task runner
run: pip install poethepoet
- name: Run benchmark
run: |
poe lha_sv
alecandido marked this conversation as resolved.
Show resolved Hide resolved
51 changes: 38 additions & 13 deletions benchmarks/lha_paper_bench.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
Benchmark to :cite:`Giele:2002hx` (LO + NLO) and :cite:`Dittmar:2005ed` (NNLO).
"""
import argparse
from math import nan

import numpy as np
from banana import register
from banana.data import cartesian_product

from eko.interpolation import lambertgrid
from ekomark.benchmark.runner import Runner
Expand Down Expand Up @@ -248,15 +248,40 @@ def run_lha(self, theory_updates):


if __name__ == "__main__":
# Benchmark to LHA
obj = BenchmarkFFNS_polarized()
# obj = BenchmarkFFNS()
# obj.benchmark_plain(1)
obj.benchmark_sv(1)

# # VFNS benchmarks with LHA settings
# programs = ["LHA", "pegasus", "apfel"]
# for p in programs:
# obj = BenchmarkRunner(p)
# # obj.benchmark_plain(2)
# obj.benchmark_sv(2)
parser = argparse.ArgumentParser(
prog="LHA_benchmark",
description="EKO benchmark with LHA settings",
)
parser.add_argument(
"-o", "--pto", help="QCD perturbative order 0=LO, ... ", type=int, default=2
)
parser.add_argument(
"-e",
"--external",
help="External program to benchmark against (only for VFNS)",
default="LHA",
)
parser.add_argument(
"-s",
"--use_sv",
help="Run Scale Variations (only for VFNS)",
action="store_true",
)
parser.add_argument(
"-f", "--use_ffns", help="Run FFNS evolution", action="store_true"
)
parser.add_argument(
"-p", "--use_pol", help="Run Polarized evolution", action="store_true"
)
args = parser.parse_args()
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved

if args.use_ffns:
obj = BenchmarkFFNS()
elif args.use_pol:
obj = BenchmarkFFNS_polarized()
else:
obj = BenchmarkRunner(args.external)
if args.use_sv:
obj.benchmark_sv(args.pto)
else:
obj.benchmark_plain(args.pto)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ lint = "pylint src/**/*.py -E"
lint-warnings = "pylint src/**/*.py --exit-zero"
sandbox = "python benchmarks/sandbox.py"
lha = "python benchmarks/lha_paper_bench.py"
lha_bot = "python benchmarks/lha_paper_bench.py -s -o 2"
nav = "ekonav --config benchmarks/banana.yaml"
navigator = "ekonav --config benchmarks/banana.yaml"
docs = { "shell" = "cd doc; make html" }
Expand Down