-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.cpu_base
40 lines (36 loc) · 1.48 KB
/
Dockerfile.cpu_base
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
FROM python:3.8-bullseye
ARG TVM_HASH
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles
# Install deps
RUN apt update && apt install -y --no-install-recommends git libgtest-dev cmake wget unzip libtinfo-dev libz-dev \
libcurl4-openssl-dev g++ sudo python3-dev antlr4 && \
pip install --upgrade pip && pip install pylint==1.9.4 six numpy pytest cython decorator scipy tornado \
typed-ast pytest mypy orderedset antlr4-python3-runtime attrs requests "Pillow<7" packaging
# LLVM
RUN echo deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-12 main \
>> /etc/apt/sources.list.d/llvm.list && \
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - && \
apt-get update && apt-get install -y llvm-12
# Build TVM
RUN cd /usr && \
git clone https://github.com/apache/incubator-tvm.git tvm --recursive && \
cd /usr/tvm && \
git checkout $TVM_HASH && \
echo $TVM_HASH > GIT_SHA && \
rm -rf .git
WORKDIR /usr/tvm
RUN bash -c \
"echo set\(USE_LLVM llvm-config-12\) >> 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_GRAPH_RUNTIME_DEBUG ON\) >> config.cmake && \
echo set\(USE_ANTLR ON\) >> config.cmake && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j2"
ENV PYTHONPATH=/usr/tvm/python:/usr/tvm/topi/python:${PYTHONPATH}
WORKDIR /root
CMD ["bash"]