-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
139 lines (122 loc) · 2.97 KB
/
Copy pathDockerfile
File metadata and controls
139 lines (122 loc) · 2.97 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
FROM ubuntu:16.04
LABEL Lini Mestar <liniMestar@gmail.com>
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean && apt-get update && apt-get install -y \
build-essential \
checkinstall \
libreadline-gplv2-dev \
libncursesw5-dev \
libssl-dev \
libsqlite3-dev \
libgdbm-dev \
libc6-dev \
libbz2-dev \
zlib1g-dev \
openssl \
libffi-dev \
libjpeg-dev \
python3-dev \
python3-setuptools \
python3-pip \
wget \
gcc && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /tmp/Python37; \
cd /tmp/Python37; \
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz; \
tar xvf Python-3.7.4.tar.xz; \
cd /tmp/Python37/Python-3.7.4; \
./configure; \
make install; \
cd /; \
rm -rf /tmp/Python37
RUN \
apt-get -y update && \
apt-get install -y \
python-pip \
python-dev \
python-tk \
python-setuptools \
gcc \
libtinfo-dev \
zlib1g-dev \
build-essential \
cmake \
curl \
wget \
ocl-icd-opencl-dev \
libxml2-dev \
libopencv-dev \
nvidia-361-dev \
libsm6 \
libxrender1 \
libfontconfig1 \
git \
python-opencv \
pkg-config \
software-properties-common \
autoconf \
automake \
libtool \
ocaml \
protobuf-compiler \
libprotobuf-dev \
libssl-dev \
libopenblas-dev \
libcurl4-openssl-dev
RUN \
pip3 install --upgrade \
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl && \
pip3 install -U \
decorator \
antlr4-python3-runtime \
attrs \
numpy \
scipy \
scikit-learn \
sklearn \
torch \
torchvision \
plotly \
tensorflow==1.15 \
keras \
h5py \
matplotlib \
onnx==1.5.0 \
onnxruntime==1.0.0 \
future \
opencv-python \
ipdb && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /app && cd /app
ENV LD_LIBRARY_PATH /opt/sgxsdk/lib64:${LD_LIBRARY_PATH}
ENV TVM_HOME=/app/tvm
ENV PYTHONPATH=$TVM_HOME/python:$TVM_HOME/topi/python:$TVM_HOME/nnvm/python
ADD Quantization_PJ2 /app/Quantization_PJ2
RUN mv /app/Quantization_PJ2/utils_py37_x86_linux /app/Quantization_PJ2/utils
ADD incubator-tvm /app/tvm
RUN cd /app/Quantization_PJ2 && \
sh patch.sh && \
cd $TVM_HOME && \
cp cmake/config.cmake .
ENV LLVM_LINK=clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04
RUN \
cd $TVM_HOME && \
wget http://releases.llvm.org/9.0.0/$LLVM_LINK.tar.xz && \
tar xvf $LLVM_LINK.tar.xz
RUN \
cd $TVM_HOME && \
sed -i.bak '121d' config.cmake && \
sed -i.bak '121 i\
set(USE_LLVM /app/tvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/llvm-config)' config.cmake && \
echo set\(USE_RPC ON\) >> config.cmake && \
echo set\(USE_SORT ON\) >> config.cmake && \
echo set\(USE_GRAPH_RUNTIME ON\) >> config.cmake && \
echo set\(USE_BLAS openblas\) >> config.cmake
RUN \
cd $TVM_HOME && \
mkdir build && \
cd build && \
cmake .. && \
make -j4
WORKDIR /src