Skip to content

Commit

Permalink
MLFlow DB export now only includes the last metric values
Browse files Browse the repository at this point in the history
drastically decreases result query times
  • Loading branch information
Cortys committed Feb 24, 2022
1 parent c5d2a8f commit ac52eaa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions evaluate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mlflow_migrate
Submodule mlflow_migrate updated from 68d76b to 6d7375
7 changes: 6 additions & 1 deletion src/usgoc/run_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac52eaa

Please sign in to comment.