diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md index a1c1facb7e1b..0ad9424c1b5d 100644 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -19,4 +19,3 @@ Include the title of the document (e.g. "Getting Started with TVM"), and the typ If an RFC/discuss post exists, link it here. Otherwise, specify what actions should be taken to provide additional clarity/readability/reproducibility to the document. Include code snippets from the previous documentation if applicable. - diff --git a/Jenkinsfile b/Jenkinsfile index fa1629205080..62f5f3ac554f 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -148,11 +148,17 @@ stage('Prepare') { } } + stage("Sanity Check") { timeout(time: max_time, unit: 'MINUTES') { node('CPU') { ws(per_exec_ws("tvm/sanity")) { init_git() + def docs = sh (returnStatus: true, script: ''' + ./git_changed_status.sh + ''' + ) + echo "Git committer email: ${docs}" sh "${docker_run} ${ci_lint} ./tests/scripts/task_lint.sh" } } @@ -218,19 +224,21 @@ stage('Build') { node('CPU') { ws(per_exec_ws("tvm/build-cpu")) { init_git() - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh" - make(ci_cpu, 'build', '-j2') - pack_lib('cpu', tvm_multilib_tsim) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_ci_setup.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_unittest.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_fsim.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh" - // 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 "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh" - junit "build/pytest-results/*.xml" + if (docs == 0 ) { + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh" + make(ci_cpu, 'build', '-j2') + pack_lib('cpu', tvm_multilib_tsim) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_ci_setup.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_unittest.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_fsim.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh" + // 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 "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh" + junit "build/pytest-results/*.xml" + } } } } @@ -239,11 +247,13 @@ stage('Build') { node('CPU') { ws(per_exec_ws("tvm/build-wasm")) { init_git() - sh "${docker_run} ${ci_wasm} ./tests/scripts/task_config_build_wasm.sh" - make(ci_wasm, 'build', '-j2') - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_wasm} ./tests/scripts/task_ci_setup.sh" - sh "${docker_run} ${ci_wasm} ./tests/scripts/task_web_wasm.sh" + if (docs == 0 ) { + sh "${docker_run} ${ci_wasm} ./tests/scripts/task_config_build_wasm.sh" + make(ci_wasm, 'build', '-j2') + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_wasm} ./tests/scripts/task_ci_setup.sh" + sh "${docker_run} ${ci_wasm} ./tests/scripts/task_web_wasm.sh" + } } } } @@ -252,9 +262,15 @@ stage('Build') { node('CPU') { ws(per_exec_ws("tvm/build-i386")) { init_git() - sh "${docker_run} ${ci_i386} ./tests/scripts/task_config_build_i386.sh" - make(ci_i386, 'build', '-j2') - pack_lib('i386', tvm_multilib_tsim) + def docs = sh (returnStatus: true, script: ''' + git diff-tree origin/main --no-commit-id --name-only -r HEAD | grep -v -q docs/ + ''' + ) + if (docs == 0 ) { + sh "${docker_run} ${ci_i386} ./tests/scripts/task_config_build_i386.sh" + make(ci_i386, 'build', '-j2') + pack_lib('i386', tvm_multilib_tsim) + } } } }, @@ -262,9 +278,11 @@ stage('Build') { node('ARM') { ws(per_exec_ws("tvm/build-arm")) { init_git() - sh "${docker_run} ${ci_arm} ./tests/scripts/task_config_build_arm.sh" - make(ci_arm, 'build', '-j4') - pack_lib('arm', tvm_multilib) + if (docs == 0 ) { + sh "${docker_run} ${ci_arm} ./tests/scripts/task_config_build_arm.sh" + make(ci_arm, 'build', '-j4') + pack_lib('arm', tvm_multilib) + } } } }, @@ -272,12 +290,18 @@ stage('Build') { node('CPU') { ws(per_exec_ws("tvm/build-qemu")) { init_git() - sh "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh" - make(ci_qemu, 'build', '-j2') - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_qemu} ./tests/scripts/task_ci_setup.sh" - sh "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh" - junit "build/pytest-results/*.xml" + def docs = sh (returnStatus: true, script: ''' + git diff-tree origin/main --no-commit-id --name-only -r HEAD | grep -v -q docs/ + ''' + ) + if (docs == 0 ) { + sh "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh" + make(ci_qemu, 'build', '-j2') + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_qemu} ./tests/scripts/task_ci_setup.sh" + sh "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh" + junit "build/pytest-results/*.xml" + } } } } @@ -289,13 +313,19 @@ stage('Unit Test') { node('TensorCore') { ws(per_exec_ws("tvm/ut-python-gpu")) { init_git() - unpack_lib('gpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_ci_setup.sh" - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_sphinx_precheck.sh" - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh" - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh" - junit "build/pytest-results/*.xml" + def docs = sh (returnStatus: true, script: ''' + git diff-tree origin/main --no-commit-id --name-only -r HEAD | grep -v -q docs/ + ''' + ) + if (docs == 0 ) { + unpack_lib('gpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_ci_setup.sh" + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_sphinx_precheck.sh" + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh" + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh" + junit "build/pytest-results/*.xml" + } } } } @@ -304,13 +334,19 @@ stage('Unit Test') { node('CPU') { ws(per_exec_ws("tvm/ut-python-i386")) { init_git() - unpack_lib('i386', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_i386} ./tests/scripts/task_ci_setup.sh" - sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_unittest.sh" - sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration.sh" - sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_vta_fsim.sh" - junit "build/pytest-results/*.xml" + def docs = sh (returnStatus: true, script: ''' + git diff-tree origin/main --no-commit-id --name-only -r HEAD | grep -v -q docs/ + ''' + ) + if (docs == 0 ) { + unpack_lib('i386', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_i386} ./tests/scripts/task_ci_setup.sh" + sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_unittest.sh" + sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration.sh" + sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_vta_fsim.sh" + junit "build/pytest-results/*.xml" + } } } } @@ -319,13 +355,19 @@ stage('Unit Test') { node('ARM') { ws(per_exec_ws("tvm/ut-python-arm")) { init_git() + def docs = sh (returnStatus: true, script: ''' + git diff-tree origin/main --no-commit-id --name-only -r HEAD | grep -v -q docs/ + ''' + ) + if (docs == 0 ) { unpack_lib('arm', tvm_multilib) timeout(time: max_time, unit: 'MINUTES') { sh "${docker_run} ${ci_arm} ./tests/scripts/task_ci_setup.sh" sh "${docker_run} ${ci_arm} ./tests/scripts/task_python_unittest.sh" sh "${docker_run} ${ci_arm} ./tests/scripts/task_python_arm_compute_library.sh" junit "build/pytest-results/*.xml" - // sh "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh" + // sh "${docker_run} ${ci_arm} ./tests/scripts/task_python_integration.sh" + } } } } @@ -334,10 +376,16 @@ stage('Unit Test') { node('GPU') { ws(per_exec_ws("tvm/ut-java")) { init_git() - unpack_lib('gpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_ci_setup.sh" - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh" + def docs = sh (returnStatus: true, script: ''' + git diff-tree origin/main --no-commit-id --name-only -r HEAD | grep -v -q docs/ + ''' + ) + if (docs == 0 ) { + unpack_lib('gpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_ci_setup.sh" + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh" + } } } } diff --git a/docker/install/ubuntu_install_vitis_ai_packages_ci.sh b/docker/install/ubuntu_install_vitis_ai_packages_ci.sh index 25c214068cd0..f6f270a07a83 100644 --- a/docker/install/ubuntu_install_vitis_ai_packages_ci.sh +++ b/docker/install/ubuntu_install_vitis_ai_packages_ci.sh @@ -6,9 +6,9 @@ # 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 diff --git a/docs/ts.s b/docs/ts.s new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/docs/tsf.txt b/docs/tsf.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/git_changed_status.sh b/git_changed_status.sh new file mode 100755 index 000000000000..df0b529c6d22 --- /dev/null +++ b/git_changed_status.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# 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. + +DOCS_DIR=0 +OTHER_DIR=0 +DOC_DIR="\docs" + +changed_files=`git diff --no-commit-id --name-only -r origin/main` + +for file in $changed_files; do + if grep -q "$DOC_DIR" <<< "$file"; then + DOCS_DIR=1 + else + OTHER_DIR=1 + fi +done + +if [[ ($DOCS_DIR -eq !$OTHER_DIR) || ($OTHER_DIR -eq 1) ]]; then + exit 1 +else + exit 0 +fi