-
Notifications
You must be signed in to change notification settings - Fork 227
/
Makefile
45 lines (36 loc) · 1.75 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
# Arcane incantation to print all the other targets, from https://stackoverflow.com/a/26339924
help:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
# Install exact Python and CUDA versions
conda-update:
conda env update --prune -f environment.yml
echo "!!!RUN THE conda activate COMMAND ABOVE RIGHT NOW!!!"
# Compile and install exact pip packages
pip-tools:
pip install pip-tools==6.13.0 setuptools==67.7.2
pip-compile requirements/prod.in && pip-compile requirements/dev.in
pip-sync requirements/prod.txt requirements/dev.txt
# Compile and install the requirements for local linting (optional)
pip-tools-lint:
pip install pip-tools==6.13.0 setuptools==67.7.2
pip-compile requirements/prod.in && pip-compile requirements/dev.in && pip-compile requirements/dev-lint.in
pip-sync requirements/prod.txt requirements/dev.txt requirements/dev-lint.txt
# Bump versions of transitive dependencies
pip-tools-upgrade:
pip install pip-tools==6.13.0 setuptools==67.7.2
pip-compile --upgrade requirements/prod.in && pip-compile --upgrade requirements/dev.in && pip-compile --upgrade requirements/dev-lint.in
# Example training command
train-mnist-cnn-ddp:
python training/run_experiment.py --max_epochs=10 --gpus=-1 --accelerator=ddp --num_workers=20 --data_class=MNIST --model_class=CNN
# Lint
lint:
tasks/lint.sh
# Test notebooks in source repo
test-notebooks:
tasks/notebook_test.sh $(SELECT_BY)
# Test all lab notebooks from the folder for provided lab InDeX
test-labs-up-to:
cd lab$(IDX) && ./.notebook_test.sh
# Test only the notebooks for the provided lab InDeX
test-lab:
cd lab$(IDX) && ./.notebook_test.sh $(IDX)