From ac52eaaaf8b6bd48e3b53b3f10fc930a4913bd6e Mon Sep 17 00:00:00 2001 From: Clemens Damke Date: Thu, 24 Feb 2022 19:05:09 +0100 Subject: [PATCH] MLFlow DB export now only includes the last metric values drastically decreases result query times --- evaluate.sh | 6 ++++-- mlflow_migrate | 2 +- src/usgoc/run_evaluation.py | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/evaluate.sh b/evaluate.sh index 4b65074..8d6f7fc 100755 --- a/evaluate.sh +++ b/evaluate.sh @@ -20,13 +20,15 @@ docker exec -it $USER $CUDA_ENV --workdir /app/src $CONTAINER_ID python3 ./usgoc # | grep --line-buffered -vE \ # "BaseCollectiveExecutor::StartAbort|IteratorGetNext|Shape/|Shape_[0-9]+/" +succ=$? + if [ ! -z "$NO_EXPORT" ]; then echo "No MLFLow DB export." -elif [ $? -eq 0 ]; then +elif [ $succ -eq 0 ]; then echo "Pruning MLFLow db..." EXPERIMENT_NAME=${EXPERIMENT_NAME:-$(cat EXPERIMENT_NAME)} docker exec -it $USER --workdir /app $CONTAINER_ID mlflow gc --backend-store-uri file:./mlruns - docker exec -it $USER -e EXPERIMENT_NAME=$EXPERIMENT_NAME --workdir /app $CONTAINER_ID mlflow_migrate/sqlite_migrate.sh + docker exec -it $USER -e EXPERIMENT_NAME=$EXPERIMENT_NAME -e ONLY_LAST_METRIC=1 --workdir /app $CONTAINER_ID mlflow_migrate/sqlite_migrate.sh else echo "Evaluation failed." exit 1 diff --git a/mlflow_migrate b/mlflow_migrate index 68d76b9..6d73756 160000 --- a/mlflow_migrate +++ b/mlflow_migrate @@ -1 +1 @@ -Subproject commit 68d76b9a97622d391e0b0539dd126efc9f492b98 +Subproject commit 6d737561adc4f41f72d9a2489a87fe67fc433183 diff --git a/src/usgoc/run_evaluation.py b/src/usgoc/run_evaluation.py index 73a0702..37d8f2a 100644 --- a/src/usgoc/run_evaluation.py +++ b/src/usgoc/run_evaluation.py @@ -43,11 +43,16 @@ @click.option("--yes", "-y", is_flag=True, default=False) @click.option("--export", "-e", is_flag=True, default=False) @click.option("--confusion-matrices", is_flag=True, default=False) +@click.option("--nop", is_flag=True, default=False) def evaluate( model, convert_mode, limit_id, fold=None, repeat=None, override=False, dry=False, tuner_convert_mode=None, tuner_limit_id=None, - suffix="", yes=False, export=False, confusion_matrices=False): + suffix="", yes=False, export=False, confusion_matrices=False, nop=False): + if nop: + print("NO OP: No evaluation done.") + return + if export: print("Starting export of winning models.") f = ee.export_best