-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (46 loc) · 1.63 KB
/
Copy pathMakefile
File metadata and controls
61 lines (46 loc) · 1.63 KB
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
.PHONY: install train quantize-all bench-all evaluate-all report pipeline test test-int lint format typecheck clean
PY ?= .venv/bin/python
PIP ?= .venv/bin/pip
EXPLORER ?= .venv/bin/quant-explorer
install:
$(PIP) install --index-url https://download.pytorch.org/whl/cpu torch==2.2.2 torchvision==0.17.2
$(PIP) install -e ".[dev]"
train:
$(EXPLORER) train --epochs 5 --batch-size 128
quantize-all:
$(EXPLORER) quantize --config dynamic_int8
$(EXPLORER) quantize --config static_int8_per_tensor
$(EXPLORER) quantize --config static_int8_per_channel
bench-all:
$(EXPLORER) bench --config fp32_baseline
$(EXPLORER) bench --config dynamic_int8
$(EXPLORER) bench --config static_int8_per_tensor
$(EXPLORER) bench --config static_int8_per_channel
evaluate-all:
$(EXPLORER) evaluate --config fp32_baseline
$(EXPLORER) evaluate --config dynamic_int8
$(EXPLORER) evaluate --config static_int8_per_tensor
$(EXPLORER) evaluate --config static_int8_per_channel
report:
$(EXPLORER) report
pipeline: train quantize-all bench-all evaluate-all report
pipeline-tiny:
$(EXPLORER) pipeline --tiny
test:
$(PY) -m pytest tests/unit
test-int:
RUN_INTEGRATION=1 $(PY) -m pytest tests/integration
lint:
$(PY) -m ruff check src tests
$(PY) -m black --check src tests
format:
$(PY) -m ruff check --fix src tests
$(PY) -m black src tests
typecheck:
$(PY) -m mypy src/quant_explorer
clean:
rm -rf data/cifar-10-batches-py data/cifar-10-python.tar.gz
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type d -name .mypy_cache -exec rm -rf {} +
find . -type d -name .pytest_cache -exec rm -rf {} +
find . -type d -name .ruff_cache -exec rm -rf {} +