forked from DeepWok/mase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (64 loc) · 1.74 KB
/
Makefile
File metadata and controls
78 lines (64 loc) · 1.74 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
local ?= 0
GPU_AVAILABLE := $(shell command -v nvidia-smi 2> /dev/null)
# * Check if a GPU is available
ifeq ($(GPU_AVAILABLE),)
PLATFORM := cpu
else
PLATFORM := gpu
endif
# * Set docker image according to local flag
# * If local is set, should run locally built image
# * Otherwise pull from dockerhub
ifeq ($(local), 1)
img = "mase-ubuntu2204:latest"
else
img = "deepwok/mase-docker-$(PLATFORM):latest"
endif
# * Check if running on a mac to set user path
ifeq ($(shell uname),Darwin)
USER_PREFIX=Users
else
USER_PREFIX=home
endif
coverage=test/
sw_test_dir = test/
NUM_WORKERS ?= 1
# Make sure the repo is up to date
sync:
git submodule sync
git submodule update --init --recursive
# Build Docker container
build-docker:
if [ $(local) -eq 1 ]; then \
if [ ! -d Docker ]; then \
git clone git@github.com:jianyicheng/mase-docker.git Docker; \
fi; \
docker build -f Docker/Dockerfile-$(PLATFORM) --tag mase-ubuntu2204 Docker; \
else \
docker pull $(img); \
fi
shell:
docker run -it --shm-size 256m \
--hostname mase-ubuntu2204 \
-w /workspace \
-v /$(USER_PREFIX)/$(shell whoami)/.gitconfig:/root/.gitconfig \
-v /$(USER_PREFIX)/$(shell whoami)/.ssh:/root/.ssh \
-v /$(USER_PREFIX)/$(shell whoami)/.mase:/root/.mase:z \
$(img) /bin/bash
test-sw:
pytest --log-level=DEBUG --verbose \
-n $(NUM_WORKERS) \
-m "not large" \
--cov=src/chop/ --cov-report=html \
--html=report.html --self-contained-html \
--junitxml=software_report.xml \
--profile --profile-svg \
$(sw_test_dir)
test-all: test-sw
mkdir -p ./tmp
(cd tmp; python3 ../scripts/test-torch-mlir.py || exit 1)
build:
bash scripts/build-llvm.sh || exit 1
clean:
rm -rf llvm
rm -rf tmp mase_output