Skip to content

Commit e33c747

Browse files
Merge branch 'main' into virtual-device-rep-functions
2 parents 2da2aee + 6f9c806 commit e33c747

File tree

186 files changed

+10896
-1640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+10896
-1640
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,4 @@ conda/pkg
247247
_docs/
248248
jvm/target
249249
.config/configstore/
250+
.ci-py-scripts/

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ include_directories(SYSTEM ${PICOJSON_PATH})
110110
set(TVM_LINKER_LIBS "")
111111
set(TVM_RUNTIME_LINKER_LIBS "")
112112

113+
114+
# Check if this is being run on its own or as a subdirectory for another project
115+
# If we update to CMake 2.21+, we can use PROJECT_IS_TOP_LEVEL instead
116+
get_directory_property(IS_SUBPROJECT PARENT_DIRECTORY)
117+
118+
if(NOT IS_SUBPROJECT AND NOT DEFINED "${CMAKE_EXPORT_COMPILE_COMMANDS}")
119+
# If not set manually, change the default to ON
120+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
121+
endif()
122+
113123
# Generic compilation options
114124
if(MSVC)
115125
add_definitions(-DWIN32_LEAN_AND_MEAN)

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ We do encourage everyone to work anything they are interested in.
3737
- [Zhi Chen](https://github.com/zhiics) (PMC): @zhiics - relay, quantization, pass manager
3838
- [Siyuan Feng](https://github.com/Hzfengsy): @Hzfengsy - tir
3939
- [Josh Fromm](https://github.com/jwfromm): @jwfromm - frontends, quantization, topi
40+
- [Bohan Hou](https://github.com/spectrometerHBH): @spectrometerHBH - tir, arith, tvm-script
4041
- [Yuwei Hu](https://github.com/Huyuwei): @Huyuwei - topi, frontends
4142
- [Nick Hynes](https://github.com/nhynes): @nhynes: - sgx, rust
4243
- [Animesh Jain](https://github.com/anijain2305): @anijain2305 - quantization, relay

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
4646

4747
// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
4848
ci_lint = "tlcpack/ci-lint:v0.67"
49-
ci_gpu = "tlcpack/ci-gpu:v0.78"
49+
ci_gpu = "tlcpack/ci-gpu:v0.79"
5050
ci_cpu = "tlcpack/ci-cpu:v0.79"
5151
ci_wasm = "tlcpack/ci-wasm:v0.71"
5252
ci_i386 = "tlcpack/ci-i386:v0.74"

cmake/modules/contrib/CMSISNN.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
if(USE_CMSISNN)
19+
add_definitions(-DTVM_USE_CMSISNN)
1920
message(STATUS "Build with CMSIS-NN support")
2021
tvm_file_glob(GLOB RELAY_CONTRIB_CMSISNN_SRCS src/relay/backend/contrib/cmsisnn/*.cc)
2122
list(APPEND COMPILER_SRCS ${RELAY_CONTRIB_CMSISNN_SRCS})

cmake/modules/contrib/EthosU.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
if(USE_ETHOSU)
1919
tvm_file_glob(GLOB COMPILER_ETHOSU_SRCS
2020
src/relay/backend/contrib/ethosu/*
21-
src/contrib/ethosu/cascader/*)
21+
src/contrib/ethosu/cascader/*
22+
src/contrib/ethosu/cascader/parts/*)
2223
list(APPEND COMPILER_SRCS ${COMPILER_ETHOSU_SRCS})
2324
else()
2425
# Keeping just utils.cc because it has Object definitions
2526
# used by python side
2627
tvm_file_glob(GLOB COMPILER_ETHOSU_SRCS
27-
src/relay/backend/contrib/ethosu/utils.cc)
28+
src/relay/backend/contrib/ethosu/utils.cc
29+
src/contrib/ethosu/cascader/*
30+
src/contrib/ethosu/cascader/parts/*)
2831
list(APPEND COMPILER_SRCS ${COMPILER_ETHOSU_SRCS})
2932
endif(USE_ETHOSU)

docker/Dockerfile.ci_gpu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ RUN bash /install/ubuntu_install_vulkan.sh
9090
COPY install/ubuntu_install_paddle.sh /install/ubuntu_install_paddle.sh
9191
RUN bash /install/ubuntu_install_paddle.sh
9292

93+
# OneFlow deps
94+
COPY install/ubuntu_install_oneflow.sh /install/ubuntu_install_oneflow.sh
95+
RUN bash /install/ubuntu_install_oneflow.sh
96+
9397
# Rust env (build early; takes a while)
9498
COPY install/ubuntu_install_rust.sh /install/ubuntu_install_rust.sh
9599
RUN bash /install/ubuntu_install_rust.sh

docker/Dockerfile.ci_qemu

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ COPY install/ubuntu_init_zephyr_project.sh /install/ubuntu_init_zephyr_project.s
6565
RUN bash /install/ubuntu_install_zephyr.sh
6666
ENV ZEPHYR_BASE=/opt/zephyrproject/zephyr
6767

68+
# FreeRTOS deps
69+
COPY install/ubuntu_install_freertos.sh /install/ubuntu_install_freertos.sh
70+
RUN bash /install/ubuntu_install_freertos.sh
71+
6872
# Arduino deps
6973
# NOTE: override Arduino directories so packages are installed in a
7074
# CI-accessible location.
@@ -77,3 +81,14 @@ RUN bash /install/ubuntu_install_arduino.sh
7781
# Install ONNX
7882
COPY install/ubuntu_install_onnx.sh /install/ubuntu_install_onnx.sh
7983
RUN bash /install/ubuntu_install_onnx.sh
84+
85+
# Arm(R) Ethos(TM)-U NPU driver
86+
COPY install/ubuntu_install_ethosu_driver_stack.sh /install/ubuntu_install_ethosu_driver_stack.sh
87+
RUN bash /install/ubuntu_install_ethosu_driver_stack.sh
88+
89+
# Install Vela compiler
90+
COPY install/ubuntu_install_vela.sh /install/ubuntu_install_vela.sh
91+
RUN bash /install/ubuntu_install_vela.sh
92+
93+
# Update PATH
94+
ENV PATH /opt/arm/gcc-arm-none-eabi/bin:/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4:$PATH

docker/install/ubuntu_install_caffe.sh

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,36 @@ set -o pipefail
2222

2323
apt-get update --fix-missing
2424

25-
# The precompiled caffe dependents on tzdata.
26-
# While installing tzdata in docker, we need set the time zone manually,
27-
# which will cause the container to hang during installation.
28-
# So in order to avoid manually selecting the time zone, set as following:
29-
export DEBIAN_FRONTEND=noninteractive
30-
apt-get install -y tzdata
25+
# Install dependencies
26+
apt-get install -y --no-install-recommends libboost-filesystem-dev libboost-python-dev \
27+
libboost-system-dev libboost-thread-dev libboost-regex-dev protobuf-compiler \
28+
libprotobuf-dev libhdf5-serial-dev libopenblas-dev libgflags-dev libgoogle-glog-dev
3129

32-
apt-get install caffe-cpu -y
30+
# install python packages
31+
pip install "numpy" "protobuf" "scikit-image" "six"
3332

34-
pip3 install --upgrade scikit-image
33+
# Build the Caffe and the python wrapper
34+
echo "Downloading Caffe"
35+
CAFFE_HOME="/opt/caffe"
36+
git clone --branch=ssd --depth 1 https://github.com/weiliu89/caffe /caffe_src
37+
cd /caffe_src
38+
39+
echo "Building Caffe"
40+
mkdir /caffe_src/build && cd /caffe_src/build
41+
cmake .. -DCMAKE_INSTALL_PREFIX=${CAFFE_HOME} -DCMAKE_BUILD_TYPE=Release -DCPU_ONLY=1 \
42+
-Dpython_version=3 -DUSE_OPENCV=OFF -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF -DBUILD_docs=OFF -DBLAS=open
43+
make all -j$(expr $(nproc) - 1)
44+
make pycaffe -j$(expr $(nproc) - 1)
45+
make test -j$(expr $(nproc) - 1)
46+
make runtest -j$(expr $(nproc) - 1)
47+
make pytest -j$(expr $(nproc) - 1)
48+
49+
echo "Installing Caffe to /opt/caffe"
50+
make install
51+
52+
echo "Removing build directory"
53+
cd / && rm -rf /caffe_src
54+
55+
PYCAFFE_ROOT=${CAFFE_HOME}/python
56+
echo "${CAFFE_HOME}/lib" >> /etc/ld.so.conf.d/caffe.conf && ldconfig
57+
ln -s ${PYCAFFE_ROOT}/caffe /usr/local/lib/python3.6/dist-packages/caffe
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
set -e
20+
set -u
21+
set -o pipefail
22+
set -x
23+
24+
FREERTOS_VERSION=202112.00
25+
FREERTOS_HASH=4c8d033b60ebca2ca94313e30136bfa24a174d5d7a79d60610d049846f3e6a17c23c91c6e7cfc88370c9512ea4def20461ce139673f633b366e5dc730d08724b
26+
FREERTOS_PATH=/opt/freertos
27+
28+
tmpdir=$(mktemp -d)
29+
30+
cleanup()
31+
{
32+
rm -rf "$tmpdir"
33+
}
34+
35+
trap cleanup 0
36+
37+
archive_dir=FreeRTOSv${FREERTOS_VERSION}
38+
archive_file=${archive_dir}.zip
39+
archive_url=https://github.com/FreeRTOS/FreeRTOS/releases/download/${FREERTOS_VERSION}/${archive_file}
40+
41+
cd ${tmpdir}
42+
curl -sL "${archive_url}" -o "${archive_file}"
43+
echo ${FREERTOS_HASH} ${archive_file} | sha512sum -c
44+
unzip -q "${archive_file}" -d "${FREERTOS_PATH}"

0 commit comments

Comments
 (0)