-
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**: Can now replay a full tuning run from Proto-X. This is used to see how each step of tuning would have done without query timeouts and without Boot enabled. **Demo**: The image shows the data of a replayed run of TPC-H SF0.01 without Boot enabled during tuning. For each step of tuning, the replay shows the # of queries executed during the original run (which may be < 22 if the workload timed out), the # of queries that timed out during the original run, and whether the workload timed out. It also shows this same information about the replay. You can see that the replayed times are always >= the original times, which makes sense. Whenever the original run is "22,0,False" (i.e. 22 executed, 0 timed out, workload didn't time out), the replayed time matches closely. ![Screenshot 2024-04-27 at 14 49 15](https://github.com/cmu-db/dbgym/assets/20631215/dbf87c34-4340-4d46-b91b-61f3fefa69ef) **Details**: * Migrated the pipeline which pickles actions (DBMS configuration changes) while tuning and replays actions during replay to get the DBMS into the correct state. * Related to the above, modified the pipeline to store both the best per-query knobs found during `execute_variations()` as well as all per-query knob variations tried. We can either replay the best variation or all variations. This is especially useful if the workload timed out in the original run, in which case the "best" variation is a misnomer as it is simply an arbitrary variation. * Made Proto-X log additional information while tuning about the # of executed queries, # of timed out queries, and whether the workload timed out. During replay, all this information may now be utilized. * Fixed a bug where `reset()` was overwriting the logged replay information for a step, leading to a mismatch between the dumped `action.pkl` file (which contains the DBMS configuration state) and the `run.raw.csv` file (which contains the runtime information of the workload during that state). * Refactored all symlinks to have the `.link` extension to fix a subtle bug where a replay would overwrite the `output.log` file of the original run. * Standardized whether the page cache is dumped during tuning and replay (it's now not dumped in either case). * Made CLI options for the time to run the RL agent and whether Boot is enabled more fine-grained such that these values can differ between HPO and tune.
- Loading branch information
1 parent
523ceae
commit 3aecdd1
Showing
35 changed files
with
1,186 additions
and
640 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
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
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 @@ | ||
#!/bin/bash | ||
host=$(hostname) | ||
|
||
if [ "$host" == "dev4" ]; then | ||
export PGDATA_PARENT_DPATH=/mnt/nvme1n1/phw2/dbgym_tmp/ | ||
elif [ "$host" == "dev6" ]; then | ||
export PGDATA_PARENT_DPATH=/mnt/nvme0n1/phw2/dbgym_tmp/ | ||
else | ||
echo "Did not recognize host \"$host\"" | ||
exit 1 | ||
fi |
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,33 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
SCALE_FACTOR=0.1 | ||
INTENDED_PGDATA_HARDWARE=ssd | ||
. ./experiments/load_per_machine_envvars.sh | ||
echo $PGDATA_PARENT_DPATH | ||
|
||
# space for testing. uncomment this to run individual commands from the script (copy pasting is harder because there are envvars) | ||
# python3 task.py --no-startup-check tune protox agent hpo tpch --scale-factor $SCALE_FACTOR --num-samples 4 --max-concurrent 4 --workload-timeout 100 --query-timeout 15 --tune-duration-during-hpo 0.1 --intended-pgdata-hardware $INTENDED_PGDATA_HARDWARE --pgdata-parent-dpath $PGDATA_PARENT_DPATH | ||
python3 task.py --no-startup-check tune protox agent tune tpch --scale-factor $SCALE_FACTOR --tune-duration-during-tune 0.2 | ||
python3 task.py --no-startup-check tune protox agent replay tpch --scale-factor $SCALE_FACTOR | ||
exit 0 | ||
|
||
# benchmark | ||
python3 task.py --no-startup-check benchmark tpch data $SCALE_FACTOR | ||
python3 task.py --no-startup-check benchmark tpch workload --scale-factor $SCALE_FACTOR | ||
|
||
# postgres | ||
python3 task.py --no-startup-check dbms postgres build | ||
python3 task.py --no-startup-check dbms postgres pgdata tpch --scale-factor $SCALE_FACTOR --intended-pgdata-hardware $INTENDED_PGDATA_HARDWARE --pgdata-parent-dpath $PGDATA_PARENT_DPATH | ||
|
||
exit 0 | ||
|
||
# embedding | ||
python3 task.py --no-startup-check tune protox embedding datagen tpch --scale-factor $SCALE_FACTOR --override-sample-limits "lineitem,32768" --intended-pgdata-hardware $INTENDED_PGDATA_HARDWARE --pgdata-parent-dpath $PGDATA_PARENT_DPATH # long datagen so that train doesn't crash | ||
python3 task.py --no-startup-check tune protox embedding train tpch --scale-factor $SCALE_FACTOR --iterations-per-epoch 1 --num-points-to-sample 1 --num-batches 1 --batch-size 64 --start-epoch 15 --num-samples 4 --train-max-concurrent 4 --num-curate 2 | ||
|
||
# agent | ||
python3 task.py --no-startup-check tune protox agent hpo tpch --scale-factor $SCALE_FACTOR --num-samples 4 --max-concurrent 4 --workload-timeout 100 --query-timeout 15 --tune-duration-during-hpo 1 --intended-pgdata-hardware $INTENDED_PGDATA_HARDWARE --pgdata-parent-dpath $PGDATA_PARENT_DPATH --build-space-good-for-boot | ||
python3 task.py --no-startup-check tune protox agent tune tpch --scale-factor $SCALE_FACTOR | ||
python3 task.py --no-startup-check tune protox agent replay tpch --scale-factor $SCALE_FACTOR |
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.