Skip to content

Commit

Permalink
Merge branch 'sima/main' into sima/develop_pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael Sevenier committed Mar 10, 2022
2 parents f892d5f + fc3f8be commit 379039c
Show file tree
Hide file tree
Showing 499 changed files with 25,291 additions and 10,568 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cc_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ concurrency:

jobs:
cc-reviewers:
if: github.repository == 'apache/tvm'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ping_reviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency:

jobs:
ping:
if: github.repository == 'apache/tvm'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/tag_teams.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# GH actions.
# We use it to cover windows and mac builds
# Jenkins is still the primary CI

name: Teams

on:
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
pull_request_target:
types: [opened, reopened, edited, ready_for_review, labeled]
issues:
types: [opened, edited, reopened, labeled]

concurrency:
group: Teams-${{ github.event.pull_request.number }}-${{ github.event.issue.number }}
cancel-in-progress: true

jobs:
tag-teams:
if: github.repository == 'apache/tvm'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Tag people from relevant teams
env:
PR: ${{ toJson(github.event.pull_request) }}
ISSUE: ${{ toJson(github.event.issue) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eux
python tests/scripts/github_tag_teams.py || echo failed
1 change: 1 addition & 0 deletions .github/workflows/update_last_successful_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ concurrency:

jobs:
update-last-successful-branch:
if: github.repository == 'apache/tvm'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,8 @@ _docs/
jvm/target
.config/configstore/
.ci-py-scripts/

# Generated Hexagon files
src/runtime/hexagon/rpc/hexagon_rpc.h
src/runtime/hexagon/rpc/hexagon_rpc_skel.c
src/runtime/hexagon/rpc/hexagon_rpc_stub.c
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ endif()
tvm_option(USE_CUDA "Build with CUDA" OFF)
tvm_option(USE_OPENCL "Build with OpenCL" OFF)
tvm_option(USE_VULKAN "Build with Vulkan" OFF)


# Whether to use spirv-tools.and SPIRV-Headers from Khronos github or gitlab.
#
# Possible values:
# - OFF: not to use
# - /path/to/install: path to your khronis spirv-tools and SPIRV-Headers installation directory
#
tvm_option(USE_KHRONOS_SPIRV "Whether to use spirv-tools.and SPIRV-Headers from Khronos github or gitlab" OFF)
tvm_option(USE_SPIRV_KHR_INTEGER_DOT_PRODUCT "whether enable SPIRV_KHR_DOT_PRODUCT" OFF)
tvm_option(USE_METAL "Build with Metal" OFF)
tvm_option(USE_ROCM "Build with ROCM" OFF)
tvm_option(ROCM_PATH "The path to rocm" /opt/rocm)
Expand All @@ -38,6 +48,7 @@ tvm_option(USE_LLVM "Build with LLVM, can be set to specific llvm-config path" O
tvm_option(USE_STACKVM_RUNTIME "Include stackvm into the runtime" OFF)
tvm_option(USE_GRAPH_EXECUTOR "Build with tiny graph executor" ON)
tvm_option(USE_GRAPH_EXECUTOR_CUDA_GRAPH "Build with tiny graph executor with CUDA Graph for GPUs" OFF)
tvm_option(USE_AOT_EXECUTOR "Build with AOT executor" ON)
tvm_option(USE_PROFILER "Build profiler for the VM and graph executor" ON)
tvm_option(USE_OPENMP "Build with OpenMP thread pool implementation" OFF)
tvm_option(USE_RELAY_DEBUG "Building Relay in debug mode..." OFF)
Expand Down Expand Up @@ -78,6 +89,7 @@ tvm_option(USE_MIOPEN "Build with ROCM:MIOpen" OFF)
tvm_option(USE_ROCBLAS "Build with ROCM:RoCBLAS" OFF)
tvm_option(USE_SORT "Build with sort support" ON)
tvm_option(USE_NNPACK "Build with nnpack support" OFF)
tvm_option(USE_LIBTORCH "Build with libtorch support" OFF)
tvm_option(USE_RANDOM "Build with random support" ON)
tvm_option(USE_MICRO_STANDALONE_RUNTIME "Build with micro.standalone_runtime support" OFF)
tvm_option(USE_CPP_RPC "Build CPP RPC" OFF)
Expand Down Expand Up @@ -395,6 +407,13 @@ if(USE_PROFILER)
list(APPEND RUNTIME_SRCS ${RUNTIME_VM_PROFILER_SRCS})
endif(USE_PROFILER)

if(USE_AOT_EXECUTOR)
message(STATUS "Build with AOT Executor support...")
file(GLOB RUNTIME_AOT_EXECUTOR_SRCS src/runtime/aot_executor/*.cc)
list(APPEND RUNTIME_SRCS ${RUNTIME_AOT_EXECUTOR_SRCS})

endif(USE_AOT_EXECUTOR)

# Enable ctest if gtest is available
if(USE_GTEST)
# Check env var for backward compatibility. A better way to specify package
Expand Down Expand Up @@ -447,6 +466,7 @@ include(cmake/modules/contrib/Posit.cmake)
include(cmake/modules/contrib/MicroStandaloneRuntime.cmake)
include(cmake/modules/contrib/Sort.cmake)
include(cmake/modules/contrib/NNPack.cmake)
include(cmake/modules/contrib/LibTorch.cmake)
include(cmake/modules/contrib/HybridDump.cmake)
include(cmake/modules/contrib/TFLite.cmake)
include(cmake/modules/contrib/TF_TVMDSOOP.cmake)
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ We do encourage everyone to work anything they are interested in.
- [Thierry Moreau](https://github.com/tmoreau89) (PMC): @tmoreau89 - vta
- [Kazutaka Morita](https://github.com/kazum): @kazum - frontends, opencl
- [Trevor Morris](https://github.com/trevor-m): @trevor-m - byoc, compiler
- [Leandro Nunes](https://github.com/leandron): @leandron - tvmc
- [Leandro Nunes](https://github.com/leandron) (PMC): @leandron - tvmc
- [Lily Orth-Smith](https://github.com/electriclilies): @electriclilies - relay
- [Krzysztof Parzyszek](https://github.com/kparzysz-quic): @kparzysz-quic - hexagon, llvm
- [Andrew Reusch](https://github.com/areusch): (PMC) @areusch - runtime, microTVM
- [Jared Roesch](https://github.com/jroesch) (PMC): @jroesch - relay
Expand Down Expand Up @@ -107,7 +108,7 @@ We do encourage everyone to work anything they are interested in.
- [Manupa Karunaratne](https://github.com/manupa-arm): @manupa-arm
- [Marisa Kirisame](https://github.com/MarisaKirisame): @MarisaKirisame
- [Tristan Konolige](https://github.com/tkonolige): @tkonolige
- [Ruihang Lai](https://github.com/MasterJH5574): @MasterJH5574
- [Ruihang Lai](https://github.com/MasterJH5574): @MasterJH5574
- [Wuwei Lin](https://github.com/vinx13): @vinx13
- [Andrew Liu](https://github.com/hypercubestart): @hypercubestart
- [Henry Liu](https://github.com/optima2005): @optima2005
Expand Down
110 changes: 92 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils

// NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
ci_lint = "tlcpack/ci-lint:v0.68"
ci_gpu = "tlcpack/ci-gpu:v0.81"
ci_cpu = "tlcpack/ci-cpu:v0.81"
ci_wasm = "tlcpack/ci-wasm:v0.71"
ci_i386 = "tlcpack/ci-i386:v0.74"
ci_qemu = "tlcpack/ci-qemu:v0.10"
ci_arm = "tlcpack/ci-arm:v0.07"
ci_hexagon = "tlcpack/ci-hexagon:v0.01"
ci_lint = 'tlcpack/ci-lint:v0.68'
ci_gpu = 'tlcpack/ci-gpu:v0.81'
ci_cpu = 'tlcpack/ci-cpu:v0.81'
ci_wasm = 'tlcpack/ci-wasm:v0.71'
ci_i386 = 'tlcpack/ci-i386:v0.74'
ci_qemu = 'tlcpack/ci-qemu:v0.10'
ci_arm = 'tlcpack/ci-arm:v0.07'
ci_hexagon = 'tlcpack/ci-hexagon:v0.01'
// <--- End of regex-scanned config.

// Parameters to allow overriding (in Jenkins UI), the images
Expand Down Expand Up @@ -105,6 +105,21 @@ def init_git() {
}
}

def should_skip_slow_tests(pr_number) {
withCredentials([string(
credentialsId: 'tvm-bot-jenkins-reader',
variable: 'GITHUB_TOKEN',
)]) {
// Exit code of 1 means run slow tests, exit code of 0 means skip slow tests
result = sh (
returnStatus: true,
script: "./tests/scripts/should_run_slow_tests.py --pr '${pr_number}'",
label: 'Check if CI should run slow tests',
)
}
return result == 0
}

def cancel_previous_build() {
// cancel previous build if it is not on main.
if (env.BRANCH_NAME != 'main') {
Expand All @@ -117,6 +132,18 @@ def cancel_previous_build() {
}

def should_skip_ci(pr_number) {
if (!env.BRANCH_NAME.startsWith('PR-')) {
// never skip CI on build sourced from a branch
return false
}
glob_skip_ci_code = sh (
returnStatus: true,
script: "./tests/scripts/git_skip_ci_globs.py",
label: 'Check if CI should be skipped due to changed files',
)
if (glob_skip_ci_code == 0) {
return true
}
withCredentials([string(
credentialsId: 'tvm-bot-jenkins-reader',
variable: 'TOKEN',
Expand All @@ -128,10 +155,18 @@ def should_skip_ci(pr_number) {
script: "./tests/scripts/git_skip_ci.py --pr '${pr_number}'",
label: 'Check if CI should be skipped',
)
}
}
return git_skip_ci_code == 0
}

// skips builds from branch indexing; sourced from https://www.jvt.me/posts/2020/02/23/jenkins-multibranch-skip-branch-index/
// execute this before anything else, including requesting any time on an agent
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
currentBuild.result = 'ABORTED' // optional, gives a better hint to the user that it's been skipped, rather than the default which shows it's successful
return
}

cancel_previous_build()

stage('Prepare') {
Expand Down Expand Up @@ -169,6 +204,7 @@ stage('Sanity Check') {
label: 'Check for docs only changes',
)
skip_ci = should_skip_ci(env.CHANGE_ID)
skip_slow_tests = should_skip_slow_tests(env.CHANGE_ID)
sh (
script: "${docker_run} ${ci_lint} ./tests/scripts/task_lint.sh",
label: 'Run lint',
Expand All @@ -178,6 +214,7 @@ stage('Sanity Check') {
}
}


// Run make. First try to do an incremental make from a previous workspace in hope to
// accelerate the compilation. If something is wrong, clean the workspace and then
// build from scratch.
Expand Down Expand Up @@ -238,13 +275,13 @@ def python_unittest(image) {
def fsim_test(image) {
sh (
script: "${docker_run} ${image} ./tests/scripts/task_python_vta_fsim.sh",
label: 'Run VTA tests in FSIM ',
label: 'Run VTA tests in FSIM',
)
}

def cmake_build(image, path, make_flag) {
sh (
script: "${docker_run} ${image} ./tests/scripts/task_build.sh ${path} ${make_flag}",
script: "${docker_run} ${image} ./tests/scripts/task_build.py --num-executors ${CI_NUM_EXECUTORS} --sccache-bucket tvm-sccache-prod",
label: 'Run cmake build',
)
}
Expand All @@ -257,6 +294,9 @@ def cpp_unittest(image) {
}

stage('Build') {
environment {
SKIP_SLOW_TESTS = "${skip_slow_tests}"
}
parallel 'BUILD: GPU': {
if (!skip_ci) {
node('GPUBUILD') {
Expand Down Expand Up @@ -287,7 +327,7 @@ stage('Build') {
ci_setup(ci_cpu)
// sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh"
// TODO(@jroesch): need to resolve CI issue will turn back on in follow up patch
sh (script: "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh", label: "Rust build and test")
sh (script: "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh", label: 'Rust build and test')
}
}
}
Expand Down Expand Up @@ -402,6 +442,10 @@ stage('Build') {
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon.sh",
label: 'Run Hexagon tests',
)
sh (
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_python_hexagon_simulator.sh",
label: 'Run Hexagon tests on simulator',
)
} finally {
junit 'build/pytest-results/*.xml'
}
Expand All @@ -414,6 +458,9 @@ stage('Build') {
}

stage('Test') {
environment {
SKIP_SLOW_TESTS = "${skip_slow_tests}"
}
parallel 'unittest: GPU': {
if (!skip_ci && is_docs_only_build != 1) {
node('TensorCore') {
Expand Down Expand Up @@ -471,7 +518,7 @@ stage('Test') {
'unittest: CPU': {
if (!skip_ci && is_docs_only_build != 1) {
node('CPU') {
ws(per_exec_ws("tvm/ut-python-cpu")) {
ws(per_exec_ws('tvm/ut-python-cpu')) {
try {
init_git()
unpack_lib('cpu', tvm_multilib_tsim)
Expand All @@ -481,7 +528,7 @@ stage('Test') {
fsim_test(ci_cpu)
sh (
script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh",
label: "Run VTA tests in TSIM",
label: 'Run VTA tests in TSIM',
)
}
} finally {
Expand Down Expand Up @@ -532,6 +579,10 @@ stage('Test') {
script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh",
label: 'Run test_arm_compute_lib test',
)
sh (
script: "${docker_run} ${ci_arm} ./tests/scripts/task_python_topi.sh",
label: 'Run TOPI tests',
)
// sh "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh"
}
} finally {
Expand Down Expand Up @@ -566,7 +617,7 @@ stage('Test') {
Utils.markStageSkippedForConditional('topi: GPU')
}
},
'frontend: GPU': {
'frontend: GPU 1': {
if (!skip_ci && is_docs_only_build != 1) {
node('GPU') {
ws(per_exec_ws('tvm/frontend-python-gpu')) {
Expand All @@ -576,8 +627,31 @@ stage('Test') {
timeout(time: max_time, unit: 'MINUTES') {
ci_setup(ci_gpu)
sh (
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh",
label: 'Run Python frontend tests',
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh 1",
label: 'Run Python frontend tests (shard 1)',
)
}
} finally {
junit 'build/pytest-results/*.xml'
}
}
}
} else {
Utils.markStageSkippedForConditional('frontend: GPU 1')
}
},
'frontend: GPU 2': {
if (!skip_ci && is_docs_only_build != 1) {
node('GPU') {
ws(per_exec_ws('tvm/frontend-python-gpu')) {
try {
init_git()
unpack_lib('gpu', tvm_multilib)
timeout(time: max_time, unit: 'MINUTES') {
ci_setup(ci_gpu)
sh (
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh 2",
label: 'Run Python frontend tests (shard 2)',
)
}
} finally {
Expand All @@ -586,7 +660,7 @@ stage('Test') {
}
}
} else {
Utils.markStageSkippedForConditional('frontend: GPU')
Utils.markStageSkippedForConditional('frontend: GPU 2')
}
},
'frontend: CPU': {
Expand Down
Loading

0 comments on commit 379039c

Please sign in to comment.