-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
60 lines (43 loc) · 1.49 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
#
# Copyright (C) 2024, Northwestern University and Argonne National Laboratory
# See COPYRIGHT notice in top-level directory.
#
check_PROGRAMS = mnist_main.py
MNIST_URL = https://raw.githubusercontent.com/pytorch/examples/main/mnist/main.py
TESTMPIRUN = $(shell dirname ${CC})/mpirun
all:
mnist_main.py:
@curl -Ls $(MNIST_URL) -o $@
@patch -st $@ < mnist.patch
MNIST_DATA_URL = https://yann.lecun.com/exdb/mnist
MNIST_DATASETS = train-images-idx3-ubyte \
train-labels-idx1-ubyte \
t10k-images-idx3-ubyte \
t10k-labels-idx1-ubyte
MNIST_DATASETS_GZ = $(MNIST_DATASETS:=.gz)
train-images-idx3-ubyte:
@curl -LOsf $(MNIST_DATA_URL)/[email protected]
@gunzip [email protected]
train-labels-idx1-ubyte:
@curl -LOsf $(MNIST_DATA_URL)/[email protected]
@gunzip [email protected]
t10k-images-idx3-ubyte:
@curl -LOsf $(MNIST_DATA_URL)/[email protected]
@gunzip [email protected]
t10k-labels-idx1-ubyte:
@curl -LOsf $(MNIST_DATA_URL)/[email protected]
@gunzip [email protected]
mnist_images.nc: $(MNIST_DATASETS)
@python create_mnist_netcdf.py
ptests check: mnist_main.py
@echo "======================================================================"
@echo " examples/MNIST: Parallel testing on 4 MPI processes"
@echo "======================================================================"
@${TESTMPIRUN} -n 4 python mnist_main.py --batch-size 4 --test-batch-size 2 --epochs 3 --input-file mnist_images.nc
@echo ""
clean:
rm -f mnist_main.py
rm -f $(MNIST_DATASETS)
rm -f $(MNIST_DATASETS_GZ)
rm -rf __pycache__
.PHONY: all check ptests clean