Sign inSign up

gaunab/bencher

By gaunab

Updated about 1 month ago

Docker image for the bencher project. See https://github.com/LeoIV/bencher

Image
0

3.0K

gaunab/bencher repository overview

Docker Build

Docker Container

The Docker container can be pulled from the Docker Hub or built locally. It contains all benchmarks and dependencies and exposes the benchmark server via port 50051.

We give an exemplary usage of the Docker container in the bencherclient repository.

pwd # /path/to/bencher
docker build -t bencher .
# always keep the container running, can be stopped with docker stop <container-id>
docker run -p 50051:50051 --restart always -d gaunab/bencher:latest

or

docker pull gaunab/bencher:latest
# always keep the container running, can be stopped with docker stop <container-id>
docker run -p 50051:50051 --restart always -d gaunab/bencher:latest

Apptainer / Singularity Container

You can build an Apptainer container from the Docker image:

Bootstrap: docker
From: gaunab/bencher:latest
Namespace:
Stage: build

%environment
    export LANG=C.UTF-8
    export PATH="/root/.local/bin:$PATH"

%post
    cd /opt
    git clone your-repo
    cd your-repo
    pip install bencherscaffold # you'll need bencherscaffold to call bencher
    pip install your-dependencies

%startscript
    bash -c "/docker-entrypoint.sh"

%runscript
    bash -c "your-command-to-run-your-app"

This will create an Apptainer container with the Docker image gaunab/bencher:latest and the repository your-repo with the dependencies your-dependencies installed.

Usage

Starting the instance
apptainer build container.sif your-apptainer-file
Start the Apptainer instance

This starts all the benchmarks in the container (as defined in the startscript of the Apptainer file).

apptainer instance start container.sif your-instance-name
Run your command that depends on the benchmarks

This runs your command in the instance your-instance-name as defined in the runscript of the Apptainer file.

apptainer run instance://your-instance-name
Evaluating a benchmark

We show how to run all benchmarks in the bencherclient repository. You don't need to use this repository, it is mainly used to test the benchmarks. The general setup to evaluate a benchmark is as follows. First, install the bencherscaffold package:

pip install git+https://github.com/LeoIV/BencherScaffold

Then, you can use the following code to evaluate a benchmark:

from bencherscaffold.client import BencherClient
from bencherscaffold.protoclasses.bencher_pb2 import Value, ValueType

# Create a client to communicate with the Bencher server
# By default, it connects to 127.0.0.1:50051
client = BencherClient()

# Create a list of values to evaluate
values = [Value(type=ValueType.CONTINUOUS, value=0.5) for _ in range(180)]
# The benchmark name is the name of the benchmark you want to evaluate
benchmark_name = 'lasso-dna'

# Evaluate the benchmark with the given values
# This will send the values to the server and return the result
# If the server is not running, it will raise an error
result = client.evaluate_point(
    benchmark_name=benchmark_name,
    point=values,
)
print(f"Result: {result}")
Available Benchmarks

The following benchmarks are available:

Benchmark Name# DimensionsTypeSource(s)Noisy
lasso-dna180continuous1,2
lasso-simple60continuous1
lasso-medium100continuous1
lasso-high300continuous1,2
lasso-hard1000continuous1,2
lasso-leukemia7129continuous1
lasso-rcv147236continuous1,3
lasso-diabetes8continuous1
lasso-breastcancer10continuous1
mopta08124continuous4,2
maxsat6060binary5,6
maxsat125125binary6
robotpushing14continuous7
lunarlander12continuous7
rover60continuous7
mujoco-ant888continuous8,2
mujoco-hopper33continuous8,2
mujoco-walker102continuous8,2
mujoco-halfcheetah102continuous8,2
mujoco-swimmer16continuous8,2
mujoco-humanoid6392continuous8,2
svm388continuous4,2,9
svmmixed53mixed5,6
pestcontrol25categorical10,11
bbob-sphereanycontinuous12,13
bbob-ellipsoidanycontinuous12,13
bbob-rastriginanycontinuous12,13
bbob-buecherastriginanycontinuous12,13
bbob-linearslopeanycontinuous12,13
bbob-attractivesectoranycontinuous12,13
bbob-stepellipsoidanycontinuous12,13
bbob-rosenbrockanycontinuous12,13
bbob-rosenbrockrotatedanycontinuous12,13
bbob-ellipsoidrotatedanycontinuous12,13
bbob-discusanycontinuous12,13
bbob-bentcigaranycontinuous12,13
bbob-sharpridgeanycontinuous12,13
bbob-differentpowersanycontinuous12,13
bbob-rastriginrotatedanycontinuous12,13
bbob-weierstrassanycontinuous12,13
bbob-schaffers10anycontinuous12,13
bbob-schaffers1000anycontinuous12,13
bbob-griewankrosenbrockanycontinuous12,13
bbob-schwefelanycontinuous12,13
bbob-gallagher101anycontinuous12,13
bbob-gallagher21anycontinuous12,13
bbob-katsuuraanycontinuous12,13
bbob-lunacekbirastriginanycontinuous12,13
pbo-onemaxanybinary12
pbo-leadingonesanybinary12
pbo-linearanybinary12
pbo-onemaxdummy1anybinary12
pbo-onemaxdummy2anybinary12
pbo-onemaxneutralityanybinary12
pbo-onemaxepistasisanybinary12
pbo-onemaxruggedness1anybinary12
pbo-onemaxruggedness2anybinary12
pbo-onemaxruggedness3anybinary12
pbo-leadingonesdummy1anybinary12
pbo-leadingonesdummy2anybinary12
pbo-leadingonesneutralityanybinary12
pbo-leadingonesepistasisanybinary12
pbo-leadingonesruggedness1anybinary12
pbo-leadingonesruggedness2anybinary12
pbo-leadingonesruggedness3anybinary12
pbo-labsanybinary12
pbo-isingringanybinary12
pbo-isingtorusanybinary12
pbo-isingtriangularanybinary12
pbo-misanybinary12
pbo-nqueensanybinary12
pbo-concatenatedtrapanybinary12
pbo-nklandscapesanybinary12
graph-maxcut2000800binary12
graph-maxcut2001800binary12
graph-maxcut2002800binary12
graph-maxcut2003800binary12
graph-maxcut2004800binary12
graph-maxcoverage2100800binary12
graph-maxcoverage2101800binary12

Footnotes

  1. LassoBench ( Šehić Kenan, Gramfort Alexandre, Salmon Joseph and Nardi Luigi, "LassoBench: A High-Dimensional Hyperparameter Optimization Benchmark Suite for Lasso", AutoML conference, 2022.) 2 3 4 5 6 7 8 9

  2. BAxUS Leonard Papenmeier, Luigi Nardi, and Matthias Poloczek, "Increasing the Scope as You Learn: Adaptive Bayesian Optimization in Nested Subspaces", NeurIPS 2022 2 3 4 5 6 7 8 9 10 11

  3. The LassoBench paper states 19,959 features, but the number of features in the RCV1 dataset is 47,236.

  4. SAASBO David Eriksson and Martin Jankowiak, "High-dimensional Bayesian optimization with sparse axis-aligned subspaces", UAI 2021 2

  5. BODi Aryan Deshwal, Sebastian Ament, Maximilian Balandat, Eytan Bakshy, Janardhan Rao Doppa, and David Eriksson, "Bayesian Optimization over High-Dimensional Combinatorial Spaces via Dictionary-based Embeddings", AISTATS 2023 2

  6. Bounce Leonard Papenmeier, Luigi Nardi and Matthias Poloczek, "Bounce: Reliable High-Dimensional Bayesian Optimization for Combinatorial and Mixed Spaces", NeurIPS 2023 2 3

  7. TurBO ( David Eriksson, Michael Pearce, Jacob Gardner, Ryan D Turner and Matthias Poloczek, "Scalable Global Optimization via Local Bayesian Optimization." NeurIPS 2019) 2 3

  8. LA-MCTS Linnan Wang, Rodrigo Fonseca, and Yuandong Tian, "Learning Search Space Partition for Black-box Optimization using Monte Carlo Tree Search", NeurIPS 2020 2 3 4 5 6

  9. The SVM benchmark is not included in the repository and was obtained by corresponding with the authors of the paper.

  10. Oh, Changyong, et al. "Combinatorial bayesian optimization using the graph cartesian product." Advances in Neural Information Processing Systems 32 (2019).

  11. Each category has 5 possible values. The benchmark expects an integer between 0 and 4 for each category.

  12. de Nobel, Jacob, et al. "Iohexperimenter: Benchmarking platform for iterative optimization heuristics." Evolutionary Computation 32.3 (2024): 205-210. 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

  13. Hansen, Nikolaus, et al. "COCO: A platform for comparing continuous optimizers in a black-box setting." Optimization Methods and Software 36.1 (2021): 114-144. 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Tag summary

Content type

Image

Digest

sha256:b3b2e3f1b

Size

2.5 GB

Last updated

about 1 month ago

docker pull gaunab/bencher