-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
102 lines (77 loc) · 1.99 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Best practices for makefiles
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
# Allow overriding which extras are installed (defaults to none)
VENV_ARGS ?=
# ============ #
# Installation #
# ============ #
.PHONY: install
install: .venv xdsl/.venv
.venv:
uv sync ${VENV_ARGS}
xdsl/.venv:
cd xdsl && VENV_EXTRAS="" make venv
# ===== #
# ASV #
# ===== #
.PHONY: asv
asv: .venv xdsl/.venv
uv run asv run --show-stderr
.PHONY: history
history: .venv xdsl/.venv
uv run asv run main~5..main
.PHONY: html
html:
uv run asv publish
.PHONY: preview
preview: html
uv run asv preview
.PHONY: clean-local-asv
clean-local-asv: .asv
rm -rf .asv/html .asv/results/$(shell hostname)
.PHONY: clean-asv
clean-asv: clean-local-asv
rm -rf .asv/results/github-action
# ========= #
# Profiling #
# ========= #
## Generate profile data from benchmarks
profiles:
mkdir -p profiles
.PHONY: clean-profiles
clean-profiles:
rm -rf profiles
.PHONY: timeit_end_to_end
timeit_end_to_end:
uv run python3 benchmarks/end_to_end.py timeit
.PHONY: snakeviz_end_to_end
snakeviz_end_to_end:
uv run python3 benchmarks/end_to_end.py -t time_end_to_end_opt__constant_folding snakeviz
.PHONY: flameprof_end_to_end
flameprof_end_to_end:
uv run python3 benchmarks/end_to_end.py -t time_end_to_end_opt__constant_folding flameprof
.PHONY: viztracer_end_to_end
viztracer_end_to_end:
uv run python3 benchmarks/end_to_end.py -t time_end_to_end_opt__constant_folding viztracer
## Profile command line directly
.PHONY: viztracer
viztracer_xdsl_opt: .venv xdsl/.venv profiles
uv run viztracer -o profiles/empty_program.json \
xdsl-opt xdsl/tests/xdsl_opt/empty_program.mlir
uv run vizviewer profiles/empty_program.json
# ========= #
# Developer #
# ========= #
.PHONY: lint
lint: .venv
uv run ruff check benchmarks/ --fix --show-fixes --exit-non-zero-on-fix
.PHONY: format
format:
uv run ruff format benchmarks/
.PHONY: types
types:
uv run mypy src
uv run mypy benchmarks --scripts-are-modules
.PHONY: check
check: lint format types