This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
104 lines (92 loc) · 1.9 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
103
104
SHELL := /bin/bash
DOCKER := podman
NPROC := $(shell nproc)
ifdef NOCONTAINERS
CONTAINERS_ARG := --no-containers
endif
ifdef DRYRUN
DRYRUN_ARG := --dry-run
endif
all: predict-all weave-all typecheck-all csv
build:
$(MAKE) build -C DeepTyper
$(MAKE) build -C LambdaNet
ifndef NOGPU
$(MAKE) build -C InCoder
endif
$(MAKE) build -C src/weaver
predict-all:
@echo "### Type prediction"
@for m in DeepTyper LambdaNet ; do \
$(MAKE) predict MODEL=$$m ; \
done
ifndef NOGPU
@$(MAKE) predict MODEL=InCoder
endif
predict:
ifndef MODEL
@echo "Undefined variable: MODEL"
@exit 1
else
@for d in $$(ls data/original); do \
python3 src/migrate_dataset/main.py \
$(CONTAINERS_ARG) \
$(DRYRUN_ARG) \
--directory data \
--dataset $$d \
--model $(MODEL) \
--predict ; \
done
endif
weave-all:
@echo "### Type weaving"
@for m in DeepTyper LambdaNet ; do \
$(MAKE) weave MODEL=$$m ; \
done
weave:
ifndef MODEL
@echo "Undefined variable: MODEL"
@exit 1
else
@for d in $$(ls data/original); do \
python3 src/migrate_dataset/main.py \
$(CONTAINERS_ARG) \
$(DRYRUN_ARG) \
--workers $(NPROC) \
--directory data \
--dataset $$d \
--model $(MODEL) \
--weave baseline ; \
done
endif
typecheck-all:
@echo "### Type checking"
@for m in DeepTyper LambdaNet InCoder ; do \
$(MAKE) typecheck MODEL=$$m ; \
done
typecheck:
ifndef MODEL
@echo "Undefined variable: MODEL"
@exit 1
else
@for d in $$(ls data/original); do \
python3 src/migrate_dataset/main.py \
$(CONTAINERS_ARG) \
$(DRYRUN_ARG) \
--workers $(NPROC) \
--directory data \
--dataset $$d \
--model $(MODEL) \
--emit-declaration \
--typecheck baseline ; \
done
endif
csv:
ifndef DRYRUN
@echo "### Generating CSVs"
@python3 src/summarize_results.py \
$(CONTAINERS_ARG) \
--workers $(NPROC) \
--data data
endif
.PHONY: build all predict-all predict weave-all weave typecheck-all typecheck csv