From 1209bea4e01ae0196d6cfd3fcb4701eac4e2c5a2 Mon Sep 17 00:00:00 2001 From: Deathn0t Date: Tue, 12 Apr 2022 09:47:08 +0200 Subject: [PATCH] update readme and clean repo --- README.md | 126 +++++++++++++++++- experiments/local/plot.yaml | 65 --------- experiments/local/run-ackley-ambs-async.sh | 33 ----- experiments/local/run-ackley-ambs-sync.sh | 35 ----- experiments/local/run-ackley-dmbs-async.sh | 33 ----- experiments/local/run-ackley-dmbs-sync.sh | 35 ----- experiments/local/run-all.sh | 6 - .../local/run-hartmann6D-dmbs-async.sh | 34 ----- .../GPU Utilization.ipynb | 0 {experiments/thetagpu => test}/test-mpi.py | 0 10 files changed, 121 insertions(+), 246 deletions(-) delete mode 100644 experiments/local/plot.yaml delete mode 100755 experiments/local/run-ackley-ambs-async.sh delete mode 100755 experiments/local/run-ackley-ambs-sync.sh delete mode 100755 experiments/local/run-ackley-dmbs-async.sh delete mode 100755 experiments/local/run-ackley-dmbs-sync.sh delete mode 100755 experiments/local/run-all.sh delete mode 100755 experiments/local/run-hartmann6D-dmbs-async.sh rename {experiments/thetagpu => notebooks}/GPU Utilization.ipynb (100%) rename {experiments/thetagpu => test}/test-mpi.py (100%) diff --git a/README.md b/README.md index e4f3b5f..b47460a 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,135 @@ # Scaling Bayesian Optimization +The code is available at [Scalable-BO GitHub repo](https://github.com/deephyper/scalable-bo). + +This project is used to experiment the *Asynchronous Distributed Bayesian optimization* (ADBO) algorithm at HPC scale. ADBO advantages are: + +* derivative-free optimization +* parallel evaluations of black-box functions +* asynchronous communication between agents +* no congestion in the optimization queue + +## Environment information + +The experiments were executed on the [Theta/ThetaGPU](https://www.alcf.anl.gov/alcf-resources/theta) supercomputers at the Argonne Leadership Computing Facility (ALCF). The environment used is based on available MPI implementations at the facility and a Conda environment for Python packages. The main Python dependencies of this project are `deephyper/deephyper` and `deephyper/scikit-optimize` with the following commits: + +* `deephyper/deephyper`: `(b027148046d811e466c65cfc969bfdf85eeb7c49)` +* `deephyper-scikit-optimize`: `(c272896c4e3f75ebd3b09b092180f5ef5b12692e)` + ## Installations -### For Theta +On all the systems of the Argonne Leadership Computing Facility (ALCF) we used the `/lus/grand/projects` filesystem. Start by cloning this repository: ```console +git clone https://github.com/deephyper/scalable-bo.git +cd scalable-bo/ mkdir build -cd build +cd build/ +``` + +Then move to the sub-section corresponding to your environment. + +### For MacOSX + +Install the Xcode command line tools: + +```console +xcode-select --install +``` + +Then check your current platform (`x86_64/arm64`) and move to the corresponding sub-section: + +```console +python -c "import platform; print(platform.platform());" +``` + +#### For MacOSX (arm64) + +If your architecture is `arm64` download MiniForge and install it: + +```console +wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh +chmod +x Miniforge3-MacOSX-arm64.sh +sh Miniforge3-MacOSX-arm64.sh +``` + +After installing Miniforge clone the DeepHyper and DeepHyper/Scikit-Optimize repos and install them: + +```console +git clone https://github.com/deephyper/deephyper.git +cd deephyper/ +git checkout b027148046d811e466c65cfc969bfdf85eeb7c49 +conda env create -f install/environment.macOS.arm64.yml +cd .. +conda activate dh-arm +git clone https://github.com/deephyper/scikit-optimize.git +cd scikit-optimize/ +git checkout c272896c4e3f75ebd3b09b092180f5ef5b12692e +pip install -e . +``` + +Install OpenMPI and `mpi4py`: + +```console +conda install openmpi +pip install mpi4py +``` + +### For Theta (ALCF) + +From the `scalable-bo/build` folder, execute the following commands: + +```console ../install/theta.sh ``` -### For ThetaGPU +### For ThetaGPU (ALCF) + +From the `scalable-bo/build` folder, execute the following commands: ```console -mkdir build -cd build ../install/thetagpu.sh ``` + +## Organization of the repository + +... + +## Experiments + +- [ ] explain how the experiments are executed (python entry point, scripts) +- [ ] explain how results are presented + +In general experiments are launched with an MPI executable and the `src/scalbo/exp.py` script with a command such as: + +```console +mpirun -np 8 python -m scalbo.exp --problem ackley \ + --search DMBS \ + --timeout 20 \ + --acq-func qUCB \ + --strategy qUCB \ + --random-state 42 \ + --log-dir output \ + --verbose 1 +``` + +where we execute the Ackley benchmark (`problem`) with the distributed search (`DMBS`) for 20 seconds (`timeout`) with the qUCB acquisition function strategy (`acq-func` and `strategy`) with random state 42 (`random-state`), verbose mode active (`verbose`) and results are saved in the `output` (`log-dir`) directory. + +### Single Node + +```console +cd experiments/local/ +``` + +### For Theta (ALCF) + +```console +cd experiments/theta/jobs/ +``` + +### For ThetaGPU (ALCF) + +```console +cd experiments/thetagpu/jobs/ +``` + diff --git a/experiments/local/plot.yaml b/experiments/local/plot.yaml deleted file mode 100644 index 71223d3..0000000 --- a/experiments/local/plot.yaml +++ /dev/null @@ -1,65 +0,0 @@ -data-root: /Users/romainegele/Documents/Argonne/scalable-bo/experiments/local/output -figures-root: /Users/romainegele/Documents/Argonne/scalable-bo/experiments/local/output/figures -show: False -experiments: - # ackley - 1-centralized-async-liar-boltzmann-qUCB: - title: "Centralized Async - Liar/Boltzmann/qUCB" - t_max: 30 - data: - ackley-ambs-async-UCB-cl_max-1-8-30-42: - label: "liar" - color: "grey" - linestyle: "-" - ackley-ambs-async-UCB-boltzmann-1-8-30-42: - label: "boltzmann" - color: "cyan" - linestyle: "-" - ackley-ambs-async-qUCB-qUCB-1-8-30-42: - label: "qUCB" - color: "orange" - linestyle: "-" - # 2-centralized-boltzman-sync-vs-async: - # title: "Centralized Boltzmann - Sync VS Async" - # t_max: 30 - # data: - # ackley-ambs-sync-boltzmann-1-8-30-42: - # label: "sync" - # color: "cyan" - # linestyle: "-" - # ackley-ambs-async-boltzmann-1-8-30-42: - # label: "async" - # color: "orange" - # linestyle: "-" - # 3-1-distributed-boltzmann-ambs-async: - # title: "Scaling Centralized Async" - # t_max: 30 - # data: - # ackley-ambs-async-boltzmann-1-8-30-42: - # label: "8" - # color: "navy" - # linestyle: "-" - # # 3-2-distributed-boltzmann-ambs-sync: - # # title: "Scaling Centralized Sync" - # # t_max: 30 - # # data: - # # ackley-ambs-sync-boltzmann-1-8-30-42: - # # label: "8" - # # color: "navy" - # # linestyle: "-" - # 3-3-distributed-boltzmann-dmbs-sync: - # title: "Scaling Distributed Sync" - # t_max: 30 - # data: - # ackley-dmbs-sync-boltzmann-1-8-30-42: - # label: "8" - # color: "navy" - # linestyle: "-" - # 3-4-distributed-boltzmann-dmbs-async: - # title: "Scaling Distributed Async" - # t_max: 30 - # data: - # ackley-dmbs-async-boltzmann-1-8-30-42: - # label: "8" - # color: "navy" - # linestyle: "-" \ No newline at end of file diff --git a/experiments/local/run-ackley-ambs-async.sh b/experiments/local/run-ackley-ambs-async.sh deleted file mode 100755 index 0ee59df..0000000 --- a/experiments/local/run-ackley-ambs-async.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# export RANDOM_STATES=(42 2022 1451 8317 213 7607 4978 1516 2335 3366) -export STRATEGIES=("cl_max") -export timeout=30 -export RANDOM_STATES=(42) -export PROBLEMS=("ackley") -export acq_func="UCB" - -# AMBS + Liar Strategy -for strategy in ${STRATEGIES[@]}; do - for random_state in ${RANDOM_STATES[@]}; do - for problem in ${PROBLEMS[@]}; do - export log_dir="output/$problem-ambs-async-$acq_func-$strategy-1-8-$timeout-$random_state"; - echo "Running: mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search AMBS \ - --timeout $timeout \ - --acq-func $acq_func \ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1"; - mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search AMBS \ - --timeout $timeout \ - --acq-func $acq_func \ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1 - done - done -done \ No newline at end of file diff --git a/experiments/local/run-ackley-ambs-sync.sh b/experiments/local/run-ackley-ambs-sync.sh deleted file mode 100755 index 13c86bd..0000000 --- a/experiments/local/run-ackley-ambs-sync.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# export RANDOM_STATES=(42 2022 1451 8317 213 7607 4978 1516 2335 3366) -export STRATEGIES=("cl_max") -export timeout=30 -export RANDOM_STATES=(42) -export PROBLEMS=("ackley") -export acq_func="UCB" - -# AMBS + Liar Strategy -for strategy in ${STRATEGIES[@]}; do - for random_state in ${RANDOM_STATES[@]}; do - for problem in ${PROBLEMS[@]}; do - export log_dir="output/$problem-ambs-sync-$acq_func-$strategy-1-8-$timeout-$random_state"; - echo "Running: mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search AMBS \ - --timeout $timeout \ - --acq-func $acq_func \ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1 \ - --sync 1"; - mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search AMBS \ - --timeout $timeout \ - --acq-func $acq_func \ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1 \ - --sync 1 - done - done -done \ No newline at end of file diff --git a/experiments/local/run-ackley-dmbs-async.sh b/experiments/local/run-ackley-dmbs-async.sh deleted file mode 100755 index d09ea51..0000000 --- a/experiments/local/run-ackley-dmbs-async.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# export RANDOM_STATES=(42 2022 1451 8317 213 7607 4978 1516 2335 3366) -export PROBLEMS=("ackley") -export STRATEGIES=("boltzmann") -export timeout=30 -export RANDOM_STATES=(42) -export acq_func="qUCB" - -# AMBS + Liar Strategy -for strategy in ${STRATEGIES[@]}; do - for random_state in ${RANDOM_STATES[@]}; do - for problem in ${PROBLEMS[@]}; do - export log_dir="output/$problem-dmbs-async-$acq_func-$strategy-1-8-$timeout-$random_state"; - echo "Running: mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search DMBS \ - --timeout $timeout \ - --acq-func $acq_func \ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1"; - mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search DMBS \ - --timeout $timeout \ - --acq-func $acq_func \ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1 - done - done -done \ No newline at end of file diff --git a/experiments/local/run-ackley-dmbs-sync.sh b/experiments/local/run-ackley-dmbs-sync.sh deleted file mode 100755 index 74fd18f..0000000 --- a/experiments/local/run-ackley-dmbs-sync.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# export RANDOM_STATES=(42 2022 1451 8317 213 7607 4978 1516 2335 3366) -export PROBLEMS=("ackley") -export STRATEGIES=("boltzmann") -export timeout=30 -export RANDOM_STATES=(42) -export acq_func="qUCB" - -# AMBS + Liar Strategy -for strategy in ${LIAR_STRATEGIES[@]}; do - for random_state in ${RANDOM_STATES[@]}; do - for problem in ${PROBLEMS[@]}; do - export log_dir="output/$problem-dmbs-sync-$acq_func-$strategy-1-8-$timeout-$random_state"; - echo "Running: mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search DMBS \ - --timeout $timeout \ - --acq-func $acq_func\ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1 \ - --sync 1"; - mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search DMBS \ - --timeout $timeout \ - --acq-func $acq_func\ - --strategy $strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1 \ - --sync 1 - done - done -done \ No newline at end of file diff --git a/experiments/local/run-all.sh b/experiments/local/run-all.sh deleted file mode 100755 index 7fe67c7..0000000 --- a/experiments/local/run-all.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -./run-ackley-ambs-async.sh -./run-ackley-ambs-sync.sh -./run-ackley-dmbs-async.sh -./run-ackley-dmbs-sync.sh \ No newline at end of file diff --git a/experiments/local/run-hartmann6D-dmbs-async.sh b/experiments/local/run-hartmann6D-dmbs-async.sh deleted file mode 100755 index 46da7ef..0000000 --- a/experiments/local/run-hartmann6D-dmbs-async.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# export timeout=5 -# export RANDOM_STATES=(42 2022 1451 8317 213 7607 4978 1516 2335 3366) -# export PROBLEMS=("ackley") -export LIAR_STRATEGIES=("boltzmann") - -export timeout=30 -export RANDOM_STATES=(42) -export PROBLEMS=("hartmann6D") -# export LIAR_STRATEGIES=("topk") - -# AMBS + Liar Strategy -for liar_strategy in ${LIAR_STRATEGIES[@]}; do - for random_state in ${RANDOM_STATES[@]}; do - for problem in ${PROBLEMS[@]}; do - export log_dir="output/$problem-dmbs-async-$liar_strategy-1-8-$timeout-$random_state"; - echo "Running: mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search DMBS \ - --timeout $timeout \ - --liar-strategy $liar_strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1"; - mpirun -np 8 python -m scalbo.exp --problem $problem \ - --search DMBS \ - --timeout $timeout \ - --liar-strategy $liar_strategy \ - --random-state $random_state \ - --log-dir $log_dir \ - --verbose 1 - done - done -done \ No newline at end of file diff --git a/experiments/thetagpu/GPU Utilization.ipynb b/notebooks/GPU Utilization.ipynb similarity index 100% rename from experiments/thetagpu/GPU Utilization.ipynb rename to notebooks/GPU Utilization.ipynb diff --git a/experiments/thetagpu/test-mpi.py b/test/test-mpi.py similarity index 100% rename from experiments/thetagpu/test-mpi.py rename to test/test-mpi.py