-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Summary**: Integrated [Boot](https://github.com/lmwnshn/boot) to accelerate the HPO and tuning loops of Proto-X **Demo**: On TPC-H SF10, using Boot (image 1), Proto-X finds a configuration with a "Best Seen Metric" of 69.67s after ~1hr of tuning. Without Boot (image 2), Proto-X only finds a configuration with a "Best Seen Metric" of 103.10s after ~1hr of tuning. Note that "Best Seen Metric" refers to the total runtime of the last run of all 22 queries TPC-H. "Best Metric" is set to "Best Seen Metric" whenever a run has no timed-out queries. Both runs used the same hyperparameters and the same per-query timeout. ![Screenshot 2024-04-15 at 10 52 17](https://github.com/cmu-db/dbgym/assets/20631215/dbe093f2-739d-4198-be7c-b314df356bd4) ![Screenshot 2024-04-15 at 10 54 26](https://github.com/cmu-db/dbgym/assets/20631215/bd909c1f-b5cd-40d6-96cc-720930a2be91) **Details**: * Boot is automatically installed when running `postgres build`. * Redis (needed by Boot) is automatically started when Boot is enabled. This Redis does not conflict with the Redis instance used by Ray. * Boot can be toggled on and off with the CLI arg `--enable-boot-during-[hpo|tune]`. Boot is enabled _separately_ for HPO and for tuning. * Boot can be configured with a .yaml file passed in through the CLI. * Currently, the results from Boot being enabled show the *estimated runtime* of the TPC-H workload, not the actual runtime. Thus, the results should be taken with a grain of salt. A future PR will resolve this. * Boot could potentially be even more effective if the per-query timeout was also decreased to reflect how Boot accelerates queries. This may be investigated in the future. * Currently, Boot's entire intelligent cache is cleared every time the configuration changes. A future PR will implement logic to selectively clear parts of the cache when the configuration changes.
- Loading branch information
1 parent
f2bf298
commit 523ceae
Showing
19 changed files
with
452 additions
and
273 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
dbgym_workspace_path: ../dbgym_workspace | ||
boot_redis_port: 6379 | ||
ray_gcs_port: 6380 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,30 +2,40 @@ | |
|
||
set -euxo pipefail | ||
|
||
REPO_REAL_DPATH="$1" | ||
REPO_REAL_PARENT_DPATH="$1" | ||
|
||
# download and make postgres with boot | ||
mkdir -p "${REPO_REAL_DPATH}" | ||
cd "${REPO_REAL_DPATH}" | ||
# download and make postgres from the boot repository | ||
mkdir -p "${REPO_REAL_PARENT_DPATH}" | ||
cd "${REPO_REAL_PARENT_DPATH}" | ||
git clone [email protected]:lmwnshn/boot.git --single-branch --branch boot --depth 1 | ||
cd ./boot | ||
./cmudb/build/configure.sh release "${REPO_REAL_DPATH}/boot/build/postgres" | ||
./cmudb/build/configure.sh release "${REPO_REAL_PARENT_DPATH}/boot/build/postgres" | ||
make clean | ||
make install-world-bin -j4 | ||
cd ../ | ||
|
||
# download and make bytejack | ||
cd ./cmudb/extension/bytejack_rs/ | ||
cargo build --release | ||
cbindgen . -o target/bytejack_rs.h --lang c | ||
cd "${REPO_REAL_PARENT_DPATH}/boot" | ||
|
||
cd ./cmudb/extension/bytejack/ | ||
make clean | ||
make install -j | ||
cd "${REPO_REAL_PARENT_DPATH}/boot" | ||
|
||
# download and make hypopg | ||
git clone [email protected]:HypoPG/hypopg.git | ||
cd ./hypopg | ||
PG_CONFIG=../boot/build/postgres/bin/pg_config make install | ||
cd ../ | ||
PG_CONFIG="${REPO_REAL_PARENT_DPATH}/boot/build/postgres/bin/pg_config" make install | ||
cd "${REPO_REAL_PARENT_DPATH}/boot" | ||
|
||
# download and make pg_hint_plan | ||
# we need -L to follow links | ||
curl -L https://github.com/ossc-db/pg_hint_plan/archive/refs/tags/REL15_1_5_1.tar.gz -o REL15_1_5_1.tar.gz | ||
tar -xzf REL15_1_5_1.tar.gz | ||
rm REL15_1_5_1.tar.gz | ||
cd ./pg_hint_plan-REL15_1_5_1 | ||
PATH="${REPO_REAL_DPATH}/boot/build/postgres/bin:$PATH" make | ||
PATH="${REPO_REAL_DPATH}/boot/build/postgres/bin:$PATH" make install | ||
cp ./pg_hint_plan.so ${REPO_REAL_DPATH}/boot/build/postgres/lib | ||
PATH="${REPO_REAL_PARENT_DPATH}/boot/build/postgres/bin:$PATH" make | ||
PATH="${REPO_REAL_PARENT_DPATH}/boot/build/postgres/bin:$PATH" make install | ||
cp ./pg_hint_plan.so ${REPO_REAL_PARENT_DPATH}/boot/build/postgres/lib |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Macro accelerator | ||
intelligent_cache: true | ||
|
||
# Micro accelerator | ||
early_stop: true | ||
seq_sample: true | ||
seq_sample_pct: 50 | ||
seq_sample_seed: 15721 | ||
mu_hyp_opt: 0.01 | ||
mu_hyp_time: 100000 | ||
mu_hyp_stdev: 1.0 |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ flex | |
libreadline-dev | ||
rpm | ||
zlib1g-dev | ||
cbindgen | ||
redis-server | ||
redis-tools |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,3 +123,4 @@ Werkzeug==3.0.1 | |
wrapt==1.14.1 | ||
zipp==3.17.0 | ||
ssd_checker==1.0.3 | ||
redis==5.0.3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
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
Oops, something went wrong.