forked from mosaicml/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (56 loc) · 2.64 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
55
56
57
58
59
60
61
62
63
64
65
66
67
# ================================================================
# Help
# ================================================================
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("make %-8s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
.PHONY: help
help: ## Print this help message
@echo "Here are the available commands:"
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
# ================================================================
# Main targets
# ================================================================
.PHONY: style
style: ## Apply autoformating and run style checks via pre-commit
pre-commit run --all-files
.PHONY: lint
lint: ## Apply autoformating and run style checks via pre-commit
@echo "================================ Linting BERT examples"
bash scripts/lint_subdirectory.sh bert
@echo "================================ Linting Resnet CIFAR examples"
bash scripts/lint_subdirectory.sh resnet_cifar
@echo "================================ Linting DeepLab examples"
bash scripts/lint_subdirectory.sh deeplab
@echo "================================ Linting LLM examples"
bash scripts/lint_subdirectory.sh llm
@echo "================================ Linting ResNet ImageNet examples"
bash scripts/lint_subdirectory.sh resnet_imagenet
@echo "================================ Linting Stable Diffusion Finetuning examples"
bash scripts/lint_subdirectory.sh stable_diffusion
@echo "================================ Linting Stable Diffusion Dreambooth examples"
bash scripts/lint_subdirectory.sh stable_diffusion_dreamboth
# we don't test the BERT examples since there are no tests yet...
.PHONY: test
test: ## Run all the tests
@echo "================================ Testing BERT examples"
bash scripts/test_subdirectory.sh bert
@echo "================================ Testing ResNet CIFAR examples"
bash scripts/test_subdirectory.sh resnet_cifar
@echo "================================ Testing DeepLab examples"
bash scripts/test_subdirectory.sh deeplab
@echo "================================ Testing LLM examples"
bash scripts/test_subdirectory.sh llm
@echo "================================ Testing ResNet ImageNet examples"
bash scripts/test_subdirectory.sh resnet_imagenet
@echo "================================ Testing Stable Diffusion Finetuning examples"
bash scripts/test_subdirectory.sh stable_diffusion
@echo "================================ Testing Stable Diffusion Dreambooth examples"
bash scripts/test_subdirectory.sh stable_diffusion_dreambooth