-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
46 lines (39 loc) · 1.62 KB
/
Dockerfile
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
FROM python:3.7
## Install TVM and related dependencies
# TVM Deps on apt
RUN apt update && apt install -y --no-install-recommends git libgtest-dev cmake wget unzip libtinfo-dev libz-dev \
libcurl4-openssl-dev libopenblas-dev g++ sudo python3-dev
# Manually add LLVM
RUN echo deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 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-8
# Build Gus's version of TVM
RUN cd /root && git clone https://github.com/gussmith23/tvm.git tvm --recursive
WORKDIR /root/tvm
RUN git fetch
RUN git checkout 5697bee696390d3826c1db983bc8112738293700
RUN git submodule sync && git submodule update
RUN echo 'set(USE_LLVM llvm-config-8)' >> config.cmake
RUN echo 'set(USE_RPC ON)' >> config.cmake
RUN echo 'set(USE_SORT ON)' >> config.cmake
RUN echo 'set(USE_GRAPH_RUNTIME ON)' >> config.cmake
RUN echo 'set(USE_BLAS openblas)' >> config.cmake
RUN echo 'set(CMAKE_CXX_STANDARD 14)' >> config.cmake
RUN echo 'set(CMAKE_CXX_STANDARD_REQUIRED ON)' >> config.cmake
RUN echo 'set(CMAKE_CXX_EXTENSIONS OFF)' >> config.cmake
#RUN echo 'set(CMAKE_BUILD_TYPE Debug)' >> config.cmake
RUN bash -c \
"mkdir -p build && \
cd build && \
cmake .. && \
make -j2"
ENV PYTHONPATH=/root/tvm/python:/root/tvm/topi/python:${PYTHONPATH}
# Set up Python
RUN pip3 install --upgrade pip
COPY ./requirements.txt ./requirements.txt
RUN pip3 install -r requirements.txt
## Set up example script
WORKDIR /root
COPY ./3la-ir-example.py ./3la-ir-example.py
CMD ["python3", "3la-ir-example.py"]