-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (38 loc) · 1.42 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
MODEL=$(shell yq '.defaults[1].model' config/config.yaml)
BUCKET=$(shell poetry run dvc remote list | sed 's/.*s3:\/\/\(.*\)\//\1/')
install:
poetry install
poetry run aim init
poetry run pre-commit install --hook-type pre-push --hook-type post-checkout --hook-type pre-commit
generate_config:
# Write hydra config to params.yaml to be loaded by dvc when running pipeline
poetry run python3 src/train.py -c all > params.yaml
repro: generate_config
SHELL=/bin/bash poetry run dvc repro src/dvc.yaml
repro_with_hopt: generate_config
yq -i '.stages.hyperparameter_tuning.frozen=False' src/dvc.yaml
SHELL=/bin/bash poetry run dvc repro src/dvc.yaml
yq -i '.stages.hyperparameter_tuning.frozen=True' src/dvc.yaml
run_exp: generate_config
# TODO: How to run with more than one parameter changed
SHELL=/bin/bash poetry run dvc exp run -S config/model/$(MODEL).yaml:$(EXPERIMENT) src/dvc.yaml
aim_ui:
poetry run aim up
dvc_pull:
poetry run dvc pull
dvc_push:
poetry run dvc push
upload_aim_db:
$(eval NAME=$(shell poetry run aim runs upload $(BUCKET) | sed 's/.*\(aim.*.zip\)./\1/'))
echo $(NAME) > .aim_backup_name
git add .aim_backup_name
merge_aim_db_with_remote:
aws s3 cp s3://$(BUCKET)/$(shell cat .aim_backup_name) aim_db.zip
mkdir -p aim_backup
unzip aim_db.zip -d aim_backup/.aim
rm aim_db.zip
poetry run python3 copy_aim_runs.py
rm -rf aim_backup
clean_backups:
# Remove all backups
echo "NOT IMPLEMENTED"