diff --git a/.github/workflows/trigger-jenkins-build.yml b/.github/workflows/trigger-jenkins-build.yml new file mode 100644 index 0000000000..9ae3438bab --- /dev/null +++ b/.github/workflows/trigger-jenkins-build.yml @@ -0,0 +1,37 @@ +# 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. +name: Trigger Jenkins Build + +on: + issue_comment: + types: [created] + +jobs: + trigger-jenkins-test: + if: contains(github.event.comment.html_url, '/pull/') + runs-on: ubuntu-latest + steps: + - name: Trigger Jenkins Test + if: startsWith(github.event.comment.body, '\test') + run: | + echo say hello + JENKINS_URL=https://ci.mlc.ai/job/mlc/ + JENKINS_USER=junrushao + JENKINS_TOKEN=119c459c1b1c53d0e584cbaabe9e2de2cc + JENKINS_JOB=$JENKINS_URL/job/PR-${{ github.event.pull_request.number }} + BUILD_NUMBER=$(curl -s -X GET $JENKINS_JOB/lastBuild/buildNumber) + curl -X POST -u $JENKINS_USER:$JENKINS_TOKEN $JENKINS_JOB/$BUILD_NUMBER/input/1/proceedEmpty diff --git a/ci/jenkins/mlc_jenkinsfile.groovy b/ci/jenkins/mlc_jenkinsfile.groovy new file mode 100644 index 0000000000..7beb2f9bd4 --- /dev/null +++ b/ci/jenkins/mlc_jenkinsfile.groovy @@ -0,0 +1,457 @@ +#!groovy +// -*- mode: groovy -*- + +// 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. + +// Jenkins pipeline +// See documents at https://jenkins.io/doc/book/pipeline/jenkinsfile/ + +// ============================= IMPORTANT NOTE ============================= +// To keep things simple +// This file is manually updated to maintain unity branch specific builds. +// Please do not send this file to main + + +import org.jenkinsci.plugins.pipeline.modeldefinition.Utils + + +tvm_lib = 'build/libtvm.so, build/libtvm_runtime.so, build/config.cmake' +tvm_lib_cuda = tvm_lib + ", build/libfpA_intB_gemm.so, build/libflash_attn.so" +docker_run = 'docker/bash.sh' // command to start a docker container +max_time = 240 // timeout in minutes + +ci_lint = 'tlcpackstaging/ci_lint:20230504-142417-4d37a0a0' +ci_cuda = 'tlcpackstaging/ci_gpu:20230504-142417-4d37a0a0' +ci_cpu = 'tlcpackstaging/ci_cpu:20230513-200357-e54bbc73' +ci_wasm = 'tlcpack/ci-wasm:v0.72' +ci_i386 = 'tlcpack/ci-i386:v0.75' +ci_qemu = 'tlcpack/ci-qemu:v0.11' +ci_arm = 'tlcpack/ci-arm:v0.08' +ci_hexagon = 'tlcpackstaging/ci_hexagon:20230504-142417-4d37a0a0' + +def per_exec_ws(folder) { + return "workspace/exec_${env.EXECUTOR_NUMBER}/" + folder +} + +def init_git() { + // initialize source codes + checkout scm + // Add more info about job node + sh ( + script: "echo NODE_NAME=${env.NODE_NAME}", + label: 'Show executor node info', + ) + retry(5) { + timeout(time: 2, unit: 'MINUTES') { + sh (script: 'git submodule update --init --recursive -f', label: 'Update git submodules') + } + } +} + +def cancel_previous_build() { + // cancel previous build if it is not on main. + if (env.BRANCH_NAME != 'main') { + def buildNumber = env.BUILD_NUMBER as int + // Milestone API allows us to cancel previous build + // with the same milestone number + if (buildNumber > 1) milestone(buildNumber - 1) + milestone(buildNumber) + } +} + +def make(build_path, image, config, threads) { + timeout(time: max_time, unit: 'MINUTES') { + sh ( + script: "rm -rf ${build_path}", + label: 'Clean up', + ) + sh ( + script: "${docker_run} --cpus 1 ${image} ${config} ${build_path}", + label: 'Configure', + ) + sh ( + script: "${docker_run} --cpus 1 ${image} ./tests/scripts/mlc/task_mlc_cmake.sh", + label: 'CMake', + ) + sh ( + script: "${docker_run} --cpus ${threads} --env BUILD_THREADS=${threads} ${image} ./tests/scripts/mlc/task_mlc_build.sh", + label: 'Build', + ) + } +} + +def pack_lib(name, libs) { + sh """ + echo "Packing ${libs} into ${name}" + echo ${libs} | sed -e 's/,/ /g' | xargs md5sum + """ + stash includes: libs, name: name +} + +def unpack_lib(name, libs) { + unstash name + sh """ + echo "Unpacked ${libs} from ${name}" + echo ${libs} | sed -e 's/,/ /g' | xargs md5sum + """ +} + +cancel_previous_build() + +stage('Approval') { + input id: '1', message: 'Pending. Please reply "\\test" on GitHub to continue.' +} + +stage('Prepare') { + node('JUNRU-CPU-SMALL') { + // When something is provided in ci_*_param, use it, otherwise default with ci_* + sh (script: """ + echo "Docker images being used in this build:" + echo " ci_lint = ${ci_lint}" + echo " ci_cpu = ${ci_cpu}" + echo " ci_cuda = ${ci_cuda}" + echo " ci_wasm = ${ci_wasm}" + echo " ci_i386 = ${ci_i386}" + echo " ci_qemu = ${ci_qemu}" + echo " ci_arm = ${ci_arm}" + echo " ci_hexagon = ${ci_hexagon}" + """, label: 'Docker image names') + } +} + +stage('Lint') { + parallel 'Misc': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/misc')) { + init_git() + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} tests/lint/check_asf_header.sh --local", + label: "ASF Header", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/lint/whitespace.sh", + label: "Whitespace", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} python3 tests/lint/check_file_type.py", + label: "File Type", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} python3 tests/lint/check_cmake_options.py", + label: "CMake LibInfo", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/lint/blocklint.sh", + label: "Non-inclusive Language", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/lint/jnilint.sh", + label: "JNI", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/lint/rust_format.sh", + label: "Rust Format", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/lint/docker-format.sh", + label: "Docker Format", + ) + }}}, + 'Black': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/black')) { + init_git() + sh ( + script: "${docker_run} --cpus 2 --env BLACK_THREADS=2 ${ci_lint} ./tests/lint/git-black.sh", + label: "Black", + ) + }}}, + 'Mypy': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/mypy')) { + init_git() + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/scripts/task_mypy.sh", + label: "Mypy", + ) + }}}, + 'Pylint': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/pylint')) { + init_git() + sh ( + script: "${docker_run} --cpus 4 --env PYLINT_THREADS=4 ${ci_lint} ./tests/lint/pylint.sh", + label: "Pylint", + ) + }}}, + 'Flake8': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/flake8')) { + init_git() + sh ( + script: "${docker_run} --cpus 4 --env FLAKE8_THREADS=4 ${ci_lint} ./tests/lint/flake8.sh", + label: "Flake8", + ) + }}}, + 'C++ Docs': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/cppdocs')) { + init_git() + sh ( + script: "${docker_run} --cpus 4 ${ci_lint} ./tests/lint/cppdocs.sh", + label: "Cppdocs", + ) + }}}, + 'Cpplint': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/cpplint')) { + init_git() + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/lint/cpplint.sh", + label: "Cpplint", + ) + }}}, + 'Clang Format': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/lint/clang-format')) { + init_git() + sh ( + script: "${docker_run} --cpus 1 ${ci_lint} ./tests/lint/git-clang-format.sh", + label: "Clang Format", + ) + }}} +} + +stage('Build') { + parallel 'CPU': { node('JUNRU-CPU-LARGE') { ws(per_exec_ws('tvm/build/cpu')) { + init_git() + make('build', "${ci_cpu}", './tests/scripts/task_config_build_cpu.sh', 8) + pack_lib('cpu', tvm_lib) + }}}, + 'CUDA': { node('JUNRU-CPU-LARGE') { ws(per_exec_ws('tvm/build/cuda')) { + init_git() + make('build', "${ci_cuda}", './tests/scripts/task_config_build_gpu.sh', 24) + sh ( + script: """ +if [ -f ./build/3rdparty/libflash_attn/src/libflash_attn.so ]; then + mv ./build/3rdparty/libflash_attn/src/libflash_attn.so ./build/ +fi +""", + label: "Move libflash_attn.so", + ) + sh ( + script: """ +if [ -f ./build/3rdparty/cutlass_fpA_intB_gemm/cutlass_kernels/libfpA_intB_gemm.so ]; then + mv ./build/3rdparty/cutlass_fpA_intB_gemm/cutlass_kernels/libfpA_intB_gemm.so ./build/ +fi +""", + label: "Move libfpA_intB_gemm.so", + ) + pack_lib('cuda', tvm_lib_cuda) + }}} +} + +stage('Unittest') { + parallel 'Relax Core IR': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-core-ir')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-ir", + label: "Relax IR", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-op", + label: "Relax Operators", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-pass", + label: "Relax Pass", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-nn-module", + label: "Relax nn.Module", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-dist", + label: "Relax DistIR", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-pattern-lang", + label: "Relax Pattern Lang", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-training", + label: "Relax Training", + ) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-tvmscript", + label: "Relax TVMScript", + ) + }}}, + + 'Relax Runtime': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-vm')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-vm", + label: "Relax VM", + ) + }}}, + + 'Relax CUDA': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-cuda')) { + init_git() + unpack_lib("cuda", tvm_lib_cuda) + sh ( + script: "${docker_run} --cpus 8 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-cuda", + label: "Relax CUDA", + ) + }}}, + + 'Relax Integration': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-meta-schedule')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 8 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-meta-schedule", + label: "Relax MetaSchedule", + ) + sh ( + script: "${docker_run} --cpus 8 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-relay", + label: "Relax Relay", + ) + }}}, + + 'Relax DNNL': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-dnnl')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-dnnl", + label: "Relax DNNL", + ) + }}}, + + 'Relax ONNX': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-onnx')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-onnx", + label: "Relax ONNX", + ) + }}}, + + 'Relax StableHLO': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-stablehlo')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-stablehlo", + label: "Relax StableHLO", + ) + }}}, + + 'Relax Torch': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/relax-torch')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh relax-torch", + label: "Relax Torch", + ) + }}}, + + 'Arith': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/arith')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh arith", + label: "Arith", + ) + }}}, + + // 'Disco': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/unittest/disco')) { + // init_git() + // unpack_lib("cpu", tvm_lib) + // sh ( + // script: "${docker_run} --cpus 1 ${ci_cpu} ./tests/scripts/unity/task_python_relax.sh disco", + // label: "Disco", + // ) + // }}}, + + 'Dlight': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/dlight')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh dlight", + label: "Dlight", + ) + }}}, + + // 'AutoScheduler': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/unittest/auto_scheduler')) { + // init_git() + // unpack_lib("cpu", tvm_lib) + // sh ( + // script: "${docker_run} --cpus 1 ${ci_cpu} ./tests/scripts/unity/task_python_relax.sh auto_scheduler", + // label: "AutoScheduler", + // ) + // }}}, + + // 'AutoTVM': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/unittest/autotvm')) { + // init_git() + // unpack_lib("cpu", tvm_lib) + // sh ( + // script: "${docker_run} --cpus 1 ${ci_cpu} ./tests/scripts/unity/task_python_relax.sh autotvm", + // label: "AutoTVM", + // ) + // }}}, + + // 'MetaSchedule': { node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/unittest/meta_schedule')) { + // init_git() + // unpack_lib("cpu", tvm_lib) + // sh ( + // script: "${docker_run} --cpus 1 ${ci_cpu} ./tests/scripts/unity/task_python_relax.sh meta_schedule", + // label: "MetaSchedule", + // ) + // }}}, + + 'Codegen': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/codegen')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh codegen", + label: "Codegen", + ) + }}}, + + 'Uncategorized': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/uncategorized')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh unittest", + label: "Uncategorized", + ) + }}}, + + + 'TIR TVMScript': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/tir-tvmscript')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh tir-tvmscript", + label: "TIR TVMScript", + ) + }}}, + + 'TIR Pass': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/tir-pass')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh tir-pass", + label: "TIR Pass", + ) + }}}, + + 'TIR Schedule': { node('JUNRU-GPU') { ws(per_exec_ws('tvm/unittest/tir-schedule')) { + init_git() + unpack_lib("cuda", tvm_lib) + sh ( + script: "${docker_run} --cpus 1 ${ci_cuda} ./tests/scripts/unity/task_python_relax.sh tir-schedule", + label: "TIR Schedule", + ) + }}} +} diff --git a/ci/jenkins/unity_jenkinsfile.groovy b/ci/jenkins/unity_jenkinsfile.groovy index 99485f7c55..0603108644 100644 --- a/ci/jenkins/unity_jenkinsfile.groovy +++ b/ci/jenkins/unity_jenkinsfile.groovy @@ -137,7 +137,7 @@ cancel_previous_build() def lint() { stage('Prepare') { - node('CPU-SMALL') { + node('JUNRU-CPU-SMALL') { // When something is provided in ci_*_param, use it, otherwise default with ci_* ci_lint = params.ci_lint_param ?: ci_lint ci_cpu = params.ci_cpu_param ?: ci_cpu @@ -164,7 +164,7 @@ stage('Prepare') { stage('Sanity Check') { timeout(time: max_time, unit: 'MINUTES') { - node('CPU-SMALL') { + node('JUNRU-CPU-SMALL') { ws(per_exec_ws('tvm/sanity')) { init_git() is_docs_only_build = sh ( @@ -311,7 +311,7 @@ def add_hexagon_permissions() { stage('Build and Test') { if (is_docs_only_build != 1) { parallel 'BUILD: GPU': { - node('GPU') { + node('JUNRU-GPU') { ws(per_exec_ws('tvm/build-gpu')) { init_git() sh "${docker_run} ${ci_gpu} nvidia-smi" @@ -322,7 +322,7 @@ stage('Build and Test') { } }, 'BUILD: CPU': { - node('CPU-SMALL') { + node('JUNRU-CPU-LARGE') { ws(per_exec_ws('tvm/build-cpu')) { init_git() sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh build" diff --git a/python/tvm/contrib/msc/core/codegen/__init__.py b/python/tvm/contrib/msc/core/codegen/__init__.py index 1df257ed6d..41c446690f 100644 --- a/python/tvm/contrib/msc/core/codegen/__init__.py +++ b/python/tvm/contrib/msc/core/codegen/__init__.py @@ -15,5 +15,4 @@ # specific language governing permissions and limitations # under the License. """tvm.contrib.msc.core.codegen""" - from .codegen import * diff --git a/tests/lint/flake8.sh b/tests/lint/flake8.sh index 87dc8640d0..9aa2a2ba23 100755 --- a/tests/lint/flake8.sh +++ b/tests/lint/flake8.sh @@ -18,4 +18,6 @@ set -e -python3 -m flake8 . --count --select=E9,F63,F7 --show-source --statistics --exclude 3rdparty +FLAKE8_THREADS="${FLAKE8_THREADS:-"auto"}" + +python3 -m flake8 . -j ${FLAKE8_THREADS} --count --select=E9,F63,F7 --show-source --statistics --exclude 3rdparty diff --git a/tests/lint/git-black.sh b/tests/lint/git-black.sh index 647aba9540..ec8ff1109d 100755 --- a/tests/lint/git-black.sh +++ b/tests/lint/git-black.sh @@ -17,32 +17,33 @@ # under the License. set -euo pipefail +BLACK_THREADS="${BLACK_THREADS:-$(nproc)}" INPLACE_FORMAT=${INPLACE_FORMAT:=false} LINT_ALL_FILES=true REVISION= -while (( $# )); do - case "$1" in - -i) - INPLACE_FORMAT=true - shift 1 - ;; - --rev) - LINT_ALL_FILES=false - REVISION=$2 - shift 2 - ;; - *) - echo "Usage: tests/lint/git-black.sh [-i] [--rev ]" - echo "" - echo "Run black on Python files that changed since or on all files in the repo" - echo "Examples:" - echo "- Compare last one commit: tests/lint/git-black.sh --rev HEAD~1" - echo "- Compare against upstream/main: tests/lint/git-black.sh --rev upstream/main" - echo "The -i will use black to format files in-place instead of checking them." - exit 1 - ;; - esac +while (($#)); do + case "$1" in + -i) + INPLACE_FORMAT=true + shift 1 + ;; + --rev) + LINT_ALL_FILES=false + REVISION=$2 + shift 2 + ;; + *) + echo "Usage: tests/lint/git-black.sh [-i] [--rev ]" + echo "" + echo "Run black on Python files that changed since or on all files in the repo" + echo "Examples:" + echo "- Compare last one commit: tests/lint/git-black.sh --rev HEAD~1" + echo "- Compare against upstream/main: tests/lint/git-black.sh --rev upstream/main" + echo "The -i will use black to format files in-place instead of checking them." + exit 1 + ;; + esac done # required to make black's dep click to work @@ -50,8 +51,8 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 if [ ! -x "$(command -v black)" ]; then - echo "Cannot find black" - exit 1 + echo "Cannot find black" + exit 1 fi # Print out specific version @@ -60,22 +61,22 @@ echo "black version: $VERSION" # Compute Python files which changed to compare. if [[ "$LINT_ALL_FILES" == "true" ]]; then - FILES=$(git ls-files | grep -E '\.py$') - echo "checking all files" + FILES=$(git ls-files | grep -E '\.py$') + echo "checking all files" else - IFS=$'\n' read -a FILES -d'\n' < <(git diff --name-only --diff-filter=ACMRTUX $REVISION -- "*.py" "*.pyi") || true - echo "Read returned $?" - if [ -z ${FILES+x} ]; then - echo "No changes in Python files" - exit 0 - fi - echo "Files: $FILES" + IFS=$'\n' read -a FILES -d'\n' < <(git diff --name-only --diff-filter=ACMRTUX $REVISION -- "*.py" "*.pyi") || true + echo "Read returned $?" + if [ -z ${FILES+x} ]; then + echo "No changes in Python files" + exit 0 + fi + echo "Files: $FILES" fi if [[ "$INPLACE_FORMAT" == "true" ]]; then - echo "Running black on Python files against revision" $REVISION: - python3 -m black ${FILES[@]} + echo "Running black on Python files against revision" $REVISION: + python3 -m black --workers ${BLACK_THREADS} ${FILES[@]} else - echo "Running black in checking mode" - python3 -m black --diff --check ${FILES[@]} + echo "Running black in checking mode" + python3 -m black --workers ${BLACK_THREADS} --diff --check ${FILES[@]} fi diff --git a/tests/lint/git-clang-format.sh b/tests/lint/git-clang-format.sh index 22e5833775..85dd23dee9 100755 --- a/tests/lint/git-clang-format.sh +++ b/tests/lint/git-clang-format.sh @@ -48,13 +48,17 @@ while (( $# )); do esac done +if [ -f ./.git/clang-format-index.lock ]; then + echo "Found .git/clang-format-index.lock file, removing it" + rm -rf .git/clang-format-index.lock +fi cleanup() { if [ -f /tmp/$$.clang-format.txt ]; then echo "" echo "---------clang-format log----------" - cat /tmp/$$.clang-format.txt + cat /tmp/$$.clang-format.txt fi rm -rf /tmp/$$.clang-format.txt } diff --git a/tests/lint/pylint.sh b/tests/lint/pylint.sh index 7fb6af30a1..cb1148b686 100755 --- a/tests/lint/pylint.sh +++ b/tests/lint/pylint.sh @@ -17,34 +17,34 @@ # under the License. set -euxo pipefail -python3 -m pylint python/tvm --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint vta/python/vta --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/unittest/test_crt.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/unittest/test_tvmscript_type.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/contrib/test_cmsisnn --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/contrib/test_ethosn --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/relay/aot/*.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/ci --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/integration/ --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/conftest.py --rcfile="$(dirname "$0")"/pylintrc +PYLINT_THREADS="${PYLINT_THREADS:-0}" + +python3 -m pylint -j${PYLINT_THREADS} python/tvm --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} vta/python/vta --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/contrib/test_cmsisnn --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/contrib/test_ethosn --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/relay/aot/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/ci --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/integration/ --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/conftest.py --rcfile="$(dirname "$0")"/pylintrc # tests/python/contrib/test_hexagon tests -python3 -m pylint tests/python/contrib/test_hexagon/*.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/contrib/test_hexagon/conv2d/*.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/contrib/test_hexagon/topi/*.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/contrib/test_hexagon/metaschedule_e2e/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/contrib/test_hexagon/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/contrib/test_hexagon/conv2d/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/contrib/test_hexagon/topi/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/contrib/test_hexagon/metaschedule_e2e/*.py --rcfile="$(dirname "$0")"/pylintrc # tests/python/frontend tests -python3 -m pylint tests/python/frontend/caffe/test_forward.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/caffe2/*.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/darknet/test_forward.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/coreml/*.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/keras/test_forward.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/darknet/test_forward.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/oneflow/*.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/tensorflow/test_forward.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/pytorch/test_forward.py --rcfile="$(dirname "$0")"/pylintrc -python3 -m pylint tests/python/frontend/tflite/test_forward.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/caffe/test_forward.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/caffe2/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/darknet/test_forward.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/coreml/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/keras/test_forward.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/darknet/test_forward.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/oneflow/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/tensorflow/test_forward.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/pytorch/test_forward.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/frontend/tflite/test_forward.py --rcfile="$(dirname "$0")"/pylintrc # tests/python/contrib/test_msc tests -python3 -m pylint tests/python/contrib/test_msc/*.py --rcfile="$(dirname "$0")"/pylintrc +python3 -m pylint -j${PYLINT_THREADS} tests/python/contrib/test_msc/*.py --rcfile="$(dirname "$0")"/pylintrc diff --git a/tests/python/unittest/test_arith_canonical_simplify.py b/tests/python/arith/test_arith_canonical_simplify.py similarity index 100% rename from tests/python/unittest/test_arith_canonical_simplify.py rename to tests/python/arith/test_arith_canonical_simplify.py diff --git a/tests/python/unittest/test_arith_const_int_bound.py b/tests/python/arith/test_arith_const_int_bound.py similarity index 100% rename from tests/python/unittest/test_arith_const_int_bound.py rename to tests/python/arith/test_arith_const_int_bound.py diff --git a/tests/python/unittest/test_arith_deduce_bound.py b/tests/python/arith/test_arith_deduce_bound.py similarity index 100% rename from tests/python/unittest/test_arith_deduce_bound.py rename to tests/python/arith/test_arith_deduce_bound.py diff --git a/tests/python/unittest/test_arith_detect_clip_bound.py b/tests/python/arith/test_arith_detect_clip_bound.py similarity index 100% rename from tests/python/unittest/test_arith_detect_clip_bound.py rename to tests/python/arith/test_arith_detect_clip_bound.py diff --git a/tests/python/unittest/test_arith_detect_cse.py b/tests/python/arith/test_arith_detect_cse.py similarity index 100% rename from tests/python/unittest/test_arith_detect_cse.py rename to tests/python/arith/test_arith_detect_cse.py diff --git a/tests/python/unittest/test_arith_detect_linear_equation.py b/tests/python/arith/test_arith_detect_linear_equation.py similarity index 100% rename from tests/python/unittest/test_arith_detect_linear_equation.py rename to tests/python/arith/test_arith_detect_linear_equation.py diff --git a/tests/python/unittest/test_arith_domain_touched.py b/tests/python/arith/test_arith_domain_touched.py similarity index 100% rename from tests/python/unittest/test_arith_domain_touched.py rename to tests/python/arith/test_arith_domain_touched.py diff --git a/tests/python/unittest/test_arith_intset.py b/tests/python/arith/test_arith_intset.py similarity index 100% rename from tests/python/unittest/test_arith_intset.py rename to tests/python/arith/test_arith_intset.py diff --git a/tests/python/unittest/test_arith_iter_affine_map.py b/tests/python/arith/test_arith_iter_affine_map.py similarity index 100% rename from tests/python/unittest/test_arith_iter_affine_map.py rename to tests/python/arith/test_arith_iter_affine_map.py diff --git a/tests/python/unittest/test_arith_modular_set.py b/tests/python/arith/test_arith_modular_set.py similarity index 100% rename from tests/python/unittest/test_arith_modular_set.py rename to tests/python/arith/test_arith_modular_set.py diff --git a/tests/python/unittest/test_arith_narrow_predicate_expression.py b/tests/python/arith/test_arith_narrow_predicate_expression.py similarity index 100% rename from tests/python/unittest/test_arith_narrow_predicate_expression.py rename to tests/python/arith/test_arith_narrow_predicate_expression.py diff --git a/tests/python/unittest/test_arith_rewrite_simplify.py b/tests/python/arith/test_arith_rewrite_simplify.py similarity index 100% rename from tests/python/unittest/test_arith_rewrite_simplify.py rename to tests/python/arith/test_arith_rewrite_simplify.py diff --git a/tests/python/unittest/test_arith_simplify.py b/tests/python/arith/test_arith_simplify.py similarity index 100% rename from tests/python/unittest/test_arith_simplify.py rename to tests/python/arith/test_arith_simplify.py diff --git a/tests/python/unittest/test_arith_solve_linear_equations.py b/tests/python/arith/test_arith_solve_linear_equations.py similarity index 100% rename from tests/python/unittest/test_arith_solve_linear_equations.py rename to tests/python/arith/test_arith_solve_linear_equations.py diff --git a/tests/python/unittest/test_arith_solve_linear_inequality.py b/tests/python/arith/test_arith_solve_linear_inequality.py similarity index 100% rename from tests/python/unittest/test_arith_solve_linear_inequality.py rename to tests/python/arith/test_arith_solve_linear_inequality.py diff --git a/tests/python/unittest/test_auto_scheduler_compute_dag.py b/tests/python/auto_scheduler/test_auto_scheduler_compute_dag.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_compute_dag.py rename to tests/python/auto_scheduler/test_auto_scheduler_compute_dag.py diff --git a/tests/python/unittest/test_auto_scheduler_cost_model.py b/tests/python/auto_scheduler/test_auto_scheduler_cost_model.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_cost_model.py rename to tests/python/auto_scheduler/test_auto_scheduler_cost_model.py diff --git a/tests/python/unittest/test_auto_scheduler_evolutionary_search.py b/tests/python/auto_scheduler/test_auto_scheduler_evolutionary_search.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_evolutionary_search.py rename to tests/python/auto_scheduler/test_auto_scheduler_evolutionary_search.py diff --git a/tests/python/unittest/test_auto_scheduler_feature.py b/tests/python/auto_scheduler/test_auto_scheduler_feature.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_feature.py rename to tests/python/auto_scheduler/test_auto_scheduler_feature.py diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/auto_scheduler/test_auto_scheduler_layout_rewrite.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_layout_rewrite.py rename to tests/python/auto_scheduler/test_auto_scheduler_layout_rewrite.py diff --git a/tests/python/unittest/test_auto_scheduler_loop_state.py b/tests/python/auto_scheduler/test_auto_scheduler_loop_state.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_loop_state.py rename to tests/python/auto_scheduler/test_auto_scheduler_loop_state.py diff --git a/tests/python/unittest/test_auto_scheduler_measure.py b/tests/python/auto_scheduler/test_auto_scheduler_measure.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_measure.py rename to tests/python/auto_scheduler/test_auto_scheduler_measure.py diff --git a/tests/python/unittest/test_auto_scheduler_search_policy.py b/tests/python/auto_scheduler/test_auto_scheduler_search_policy.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_search_policy.py rename to tests/python/auto_scheduler/test_auto_scheduler_search_policy.py diff --git a/tests/python/unittest/test_auto_scheduler_search_task.py b/tests/python/auto_scheduler/test_auto_scheduler_search_task.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_search_task.py rename to tests/python/auto_scheduler/test_auto_scheduler_search_task.py diff --git a/tests/python/unittest/test_auto_scheduler_sketch_generation.py b/tests/python/auto_scheduler/test_auto_scheduler_sketch_generation.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_sketch_generation.py rename to tests/python/auto_scheduler/test_auto_scheduler_sketch_generation.py diff --git a/tests/python/unittest/test_auto_scheduler_task_scheduler.py b/tests/python/auto_scheduler/test_auto_scheduler_task_scheduler.py similarity index 100% rename from tests/python/unittest/test_auto_scheduler_task_scheduler.py rename to tests/python/auto_scheduler/test_auto_scheduler_task_scheduler.py diff --git a/tests/python/unittest/test_autotvm_database.py b/tests/python/autotvm/test_autotvm_database.py similarity index 100% rename from tests/python/unittest/test_autotvm_database.py rename to tests/python/autotvm/test_autotvm_database.py diff --git a/tests/python/unittest/test_autotvm_dispatch_context.py b/tests/python/autotvm/test_autotvm_dispatch_context.py similarity index 100% rename from tests/python/unittest/test_autotvm_dispatch_context.py rename to tests/python/autotvm/test_autotvm_dispatch_context.py diff --git a/tests/python/unittest/test_autotvm_droplet_tuner.py b/tests/python/autotvm/test_autotvm_droplet_tuner.py similarity index 100% rename from tests/python/unittest/test_autotvm_droplet_tuner.py rename to tests/python/autotvm/test_autotvm_droplet_tuner.py diff --git a/tests/python/unittest/test_autotvm_feature.py b/tests/python/autotvm/test_autotvm_feature.py similarity index 100% rename from tests/python/unittest/test_autotvm_feature.py rename to tests/python/autotvm/test_autotvm_feature.py diff --git a/tests/python/unittest/test_autotvm_flop_calculator.py b/tests/python/autotvm/test_autotvm_flop_calculator.py similarity index 100% rename from tests/python/unittest/test_autotvm_flop_calculator.py rename to tests/python/autotvm/test_autotvm_flop_calculator.py diff --git a/tests/python/unittest/test_autotvm_ga_tuner.py b/tests/python/autotvm/test_autotvm_ga_tuner.py similarity index 100% rename from tests/python/unittest/test_autotvm_ga_tuner.py rename to tests/python/autotvm/test_autotvm_ga_tuner.py diff --git a/tests/python/unittest/test_autotvm_graph_tuner_core.py b/tests/python/autotvm/test_autotvm_graph_tuner_core.py similarity index 100% rename from tests/python/unittest/test_autotvm_graph_tuner_core.py rename to tests/python/autotvm/test_autotvm_graph_tuner_core.py diff --git a/tests/python/unittest/test_autotvm_graph_tuner_utils.py b/tests/python/autotvm/test_autotvm_graph_tuner_utils.py similarity index 100% rename from tests/python/unittest/test_autotvm_graph_tuner_utils.py rename to tests/python/autotvm/test_autotvm_graph_tuner_utils.py diff --git a/tests/python/unittest/test_autotvm_index_tuner.py b/tests/python/autotvm/test_autotvm_index_tuner.py similarity index 100% rename from tests/python/unittest/test_autotvm_index_tuner.py rename to tests/python/autotvm/test_autotvm_index_tuner.py diff --git a/tests/python/unittest/test_autotvm_measure.py b/tests/python/autotvm/test_autotvm_measure.py similarity index 100% rename from tests/python/unittest/test_autotvm_measure.py rename to tests/python/autotvm/test_autotvm_measure.py diff --git a/tests/python/unittest/test_autotvm_record.py b/tests/python/autotvm/test_autotvm_record.py similarity index 100% rename from tests/python/unittest/test_autotvm_record.py rename to tests/python/autotvm/test_autotvm_record.py diff --git a/tests/python/unittest/test_autotvm_space.py b/tests/python/autotvm/test_autotvm_space.py similarity index 100% rename from tests/python/unittest/test_autotvm_space.py rename to tests/python/autotvm/test_autotvm_space.py diff --git a/tests/python/unittest/test_autotvm_xgboost_model.py b/tests/python/autotvm/test_autotvm_xgboost_model.py similarity index 100% rename from tests/python/unittest/test_autotvm_xgboost_model.py rename to tests/python/autotvm/test_autotvm_xgboost_model.py diff --git a/tests/python/unittest/test_allreduce_cuda.py b/tests/python/codegen/test_allreduce_cuda.py similarity index 100% rename from tests/python/unittest/test_allreduce_cuda.py rename to tests/python/codegen/test_allreduce_cuda.py diff --git a/tests/python/unittest/test_target_codegen_aarch64.py b/tests/python/codegen/test_target_codegen_aarch64.py similarity index 100% rename from tests/python/unittest/test_target_codegen_aarch64.py rename to tests/python/codegen/test_target_codegen_aarch64.py diff --git a/tests/python/unittest/test_target_codegen_arm.py b/tests/python/codegen/test_target_codegen_arm.py similarity index 100% rename from tests/python/unittest/test_target_codegen_arm.py rename to tests/python/codegen/test_target_codegen_arm.py diff --git a/tests/python/unittest/test_target_codegen_blob.py b/tests/python/codegen/test_target_codegen_blob.py similarity index 100% rename from tests/python/unittest/test_target_codegen_blob.py rename to tests/python/codegen/test_target_codegen_blob.py diff --git a/tests/python/unittest/test_target_codegen_bool.py b/tests/python/codegen/test_target_codegen_bool.py similarity index 100% rename from tests/python/unittest/test_target_codegen_bool.py rename to tests/python/codegen/test_target_codegen_bool.py diff --git a/tests/python/unittest/test_target_codegen_c_host.py b/tests/python/codegen/test_target_codegen_c_host.py similarity index 100% rename from tests/python/unittest/test_target_codegen_c_host.py rename to tests/python/codegen/test_target_codegen_c_host.py diff --git a/tests/python/unittest/test_target_codegen_cross_llvm.py b/tests/python/codegen/test_target_codegen_cross_llvm.py similarity index 100% rename from tests/python/unittest/test_target_codegen_cross_llvm.py rename to tests/python/codegen/test_target_codegen_cross_llvm.py diff --git a/tests/python/unittest/test_target_codegen_cuda.py b/tests/python/codegen/test_target_codegen_cuda.py similarity index 100% rename from tests/python/unittest/test_target_codegen_cuda.py rename to tests/python/codegen/test_target_codegen_cuda.py diff --git a/tests/python/unittest/test_target_codegen_device.py b/tests/python/codegen/test_target_codegen_device.py similarity index 100% rename from tests/python/unittest/test_target_codegen_device.py rename to tests/python/codegen/test_target_codegen_device.py diff --git a/tests/python/unittest/test_target_codegen_extern.py b/tests/python/codegen/test_target_codegen_extern.py similarity index 100% rename from tests/python/unittest/test_target_codegen_extern.py rename to tests/python/codegen/test_target_codegen_extern.py diff --git a/tests/python/unittest/test_target_codegen_hexagon.py b/tests/python/codegen/test_target_codegen_hexagon.py similarity index 100% rename from tests/python/unittest/test_target_codegen_hexagon.py rename to tests/python/codegen/test_target_codegen_hexagon.py diff --git a/tests/python/unittest/test_target_codegen_llvm.py b/tests/python/codegen/test_target_codegen_llvm.py similarity index 100% rename from tests/python/unittest/test_target_codegen_llvm.py rename to tests/python/codegen/test_target_codegen_llvm.py diff --git a/tests/python/unittest/test_target_codegen_metal.py b/tests/python/codegen/test_target_codegen_metal.py similarity index 100% rename from tests/python/unittest/test_target_codegen_metal.py rename to tests/python/codegen/test_target_codegen_metal.py diff --git a/tests/python/unittest/test_target_codegen_opencl.py b/tests/python/codegen/test_target_codegen_opencl.py similarity index 100% rename from tests/python/unittest/test_target_codegen_opencl.py rename to tests/python/codegen/test_target_codegen_opencl.py diff --git a/tests/python/unittest/test_target_codegen_rocm.py b/tests/python/codegen/test_target_codegen_rocm.py similarity index 100% rename from tests/python/unittest/test_target_codegen_rocm.py rename to tests/python/codegen/test_target_codegen_rocm.py diff --git a/tests/python/unittest/test_target_codegen_static_init.py b/tests/python/codegen/test_target_codegen_static_init.py similarity index 100% rename from tests/python/unittest/test_target_codegen_static_init.py rename to tests/python/codegen/test_target_codegen_static_init.py diff --git a/tests/python/unittest/test_target_codegen_vm_basic.py b/tests/python/codegen/test_target_codegen_vm_basic.py similarity index 100% rename from tests/python/unittest/test_target_codegen_vm_basic.py rename to tests/python/codegen/test_target_codegen_vm_basic.py diff --git a/tests/python/unittest/test_target_codegen_vulkan.py b/tests/python/codegen/test_target_codegen_vulkan.py similarity index 100% rename from tests/python/unittest/test_target_codegen_vulkan.py rename to tests/python/codegen/test_target_codegen_vulkan.py diff --git a/tests/python/unittest/test_target_codegen_x86.py b/tests/python/codegen/test_target_codegen_x86.py similarity index 100% rename from tests/python/unittest/test_target_codegen_x86.py rename to tests/python/codegen/test_target_codegen_x86.py diff --git a/tests/python/unittest/test_meta_schedule_arg_info.py b/tests/python/meta-schedule/test_meta_schedule_arg_info.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_arg_info.py rename to tests/python/meta-schedule/test_meta_schedule_arg_info.py diff --git a/tests/python/unittest/test_meta_schedule_builder.py b/tests/python/meta-schedule/test_meta_schedule_builder.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_builder.py rename to tests/python/meta-schedule/test_meta_schedule_builder.py diff --git a/tests/python/unittest/test_meta_schedule_byoc_tensorrt.py b/tests/python/meta-schedule/test_meta_schedule_byoc_tensorrt.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_byoc_tensorrt.py rename to tests/python/meta-schedule/test_meta_schedule_byoc_tensorrt.py diff --git a/tests/python/unittest/test_meta_schedule_cost_model.py b/tests/python/meta-schedule/test_meta_schedule_cost_model.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_cost_model.py rename to tests/python/meta-schedule/test_meta_schedule_cost_model.py diff --git a/tests/python/unittest/test_meta_schedule_cpu_dot_product.py b/tests/python/meta-schedule/test_meta_schedule_cpu_dot_product.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_cpu_dot_product.py rename to tests/python/meta-schedule/test_meta_schedule_cpu_dot_product.py diff --git a/tests/python/unittest/test_meta_schedule_database.py b/tests/python/meta-schedule/test_meta_schedule_database.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_database.py rename to tests/python/meta-schedule/test_meta_schedule_database.py diff --git a/tests/python/unittest/test_meta_schedule_feature_extractor.py b/tests/python/meta-schedule/test_meta_schedule_feature_extractor.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_feature_extractor.py rename to tests/python/meta-schedule/test_meta_schedule_feature_extractor.py diff --git a/tests/python/unittest/test_meta_schedule_feature_extractor_per_store_feature.py b/tests/python/meta-schedule/test_meta_schedule_feature_extractor_per_store_feature.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_feature_extractor_per_store_feature.py rename to tests/python/meta-schedule/test_meta_schedule_feature_extractor_per_store_feature.py diff --git a/tests/python/unittest/test_meta_schedule_measure_callback.py b/tests/python/meta-schedule/test_meta_schedule_measure_callback.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_measure_callback.py rename to tests/python/meta-schedule/test_meta_schedule_measure_callback.py diff --git a/tests/python/unittest/test_meta_schedule_mma_m16n8k8_auto_tensorization.py b/tests/python/meta-schedule/test_meta_schedule_mma_m16n8k8_auto_tensorization.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_mma_m16n8k8_auto_tensorization.py rename to tests/python/meta-schedule/test_meta_schedule_mma_m16n8k8_auto_tensorization.py diff --git a/tests/python/unittest/test_meta_schedule_multi_anchor.py b/tests/python/meta-schedule/test_meta_schedule_multi_anchor.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_multi_anchor.py rename to tests/python/meta-schedule/test_meta_schedule_multi_anchor.py diff --git a/tests/python/unittest/test_meta_schedule_mutator_mutate_compute_location.py b/tests/python/meta-schedule/test_meta_schedule_mutator_mutate_compute_location.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_mutator_mutate_compute_location.py rename to tests/python/meta-schedule/test_meta_schedule_mutator_mutate_compute_location.py diff --git a/tests/python/unittest/test_meta_schedule_mutator_mutate_parallel.py b/tests/python/meta-schedule/test_meta_schedule_mutator_mutate_parallel.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_mutator_mutate_parallel.py rename to tests/python/meta-schedule/test_meta_schedule_mutator_mutate_parallel.py diff --git a/tests/python/unittest/test_meta_schedule_mutator_mutate_thread_binding.py b/tests/python/meta-schedule/test_meta_schedule_mutator_mutate_thread_binding.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_mutator_mutate_thread_binding.py rename to tests/python/meta-schedule/test_meta_schedule_mutator_mutate_thread_binding.py diff --git a/tests/python/unittest/test_meta_schedule_mutator_mutate_tile_size.py b/tests/python/meta-schedule/test_meta_schedule_mutator_mutate_tile_size.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_mutator_mutate_tile_size.py rename to tests/python/meta-schedule/test_meta_schedule_mutator_mutate_tile_size.py diff --git a/tests/python/unittest/test_meta_schedule_mutator_mutate_unroll.py b/tests/python/meta-schedule/test_meta_schedule_mutator_mutate_unroll.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_mutator_mutate_unroll.py rename to tests/python/meta-schedule/test_meta_schedule_mutator_mutate_unroll.py diff --git a/tests/python/unittest/test_meta_schedule_post_order_apply.py b/tests/python/meta-schedule/test_meta_schedule_post_order_apply.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_post_order_apply.py rename to tests/python/meta-schedule/test_meta_schedule_post_order_apply.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_disallow_async_strided_mem_copy.py b/tests/python/meta-schedule/test_meta_schedule_postproc_disallow_async_strided_mem_copy.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_disallow_async_strided_mem_copy.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_disallow_async_strided_mem_copy.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_disallow_dynamic_loop.py b/tests/python/meta-schedule/test_meta_schedule_postproc_disallow_dynamic_loop.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_disallow_dynamic_loop.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_disallow_dynamic_loop.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_rewrite_cooperative_fetch.py b/tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_cooperative_fetch.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_rewrite_cooperative_fetch.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_cooperative_fetch.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_rewrite_layout.py b/tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_layout.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_rewrite_layout.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_layout.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_rewrite_parallel_vectorize_unroll.py b/tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_parallel_vectorize_unroll.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_rewrite_parallel_vectorize_unroll.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_parallel_vectorize_unroll.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_rewrite_reduction_block.py b/tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_reduction_block.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_rewrite_reduction_block.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_reduction_block.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_rewrite_tensorize.py b/tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_tensorize.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_rewrite_tensorize.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_tensorize.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_rewrite_unbound_block.py b/tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_unbound_block.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_rewrite_unbound_block.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_rewrite_unbound_block.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_verify_gpu_code.py b/tests/python/meta-schedule/test_meta_schedule_postproc_verify_gpu_code.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_verify_gpu_code.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_verify_gpu_code.py diff --git a/tests/python/unittest/test_meta_schedule_postproc_verify_vtcm_limit.py b/tests/python/meta-schedule/test_meta_schedule_postproc_verify_vtcm_limit.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_postproc_verify_vtcm_limit.py rename to tests/python/meta-schedule/test_meta_schedule_postproc_verify_vtcm_limit.py diff --git a/tests/python/unittest/test_meta_schedule_profiler.py b/tests/python/meta-schedule/test_meta_schedule_profiler.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_profiler.py rename to tests/python/meta-schedule/test_meta_schedule_profiler.py diff --git a/tests/python/unittest/test_meta_schedule_relay_integration.py b/tests/python/meta-schedule/test_meta_schedule_relay_integration.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_relay_integration.py rename to tests/python/meta-schedule/test_meta_schedule_relay_integration.py diff --git a/tests/python/unittest/test_meta_schedule_relay_tir_compute.py b/tests/python/meta-schedule/test_meta_schedule_relay_tir_compute.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_relay_tir_compute.py rename to tests/python/meta-schedule/test_meta_schedule_relay_tir_compute.py diff --git a/tests/python/unittest/test_meta_schedule_runner.py b/tests/python/meta-schedule/test_meta_schedule_runner.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_runner.py rename to tests/python/meta-schedule/test_meta_schedule_runner.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_cuda_layout_transform.py b/tests/python/meta-schedule/test_meta_schedule_schedule_cuda_layout_transform.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_cuda_layout_transform.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_cuda_layout_transform.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_add_rfactor.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_add_rfactor.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_add_rfactor.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_add_rfactor.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_apply_custom_rule.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_apply_custom_rule.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_apply_custom_rule.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_apply_custom_rule.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_auto_bind.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_auto_bind.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_auto_bind.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_auto_bind.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_auto_inline.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_auto_inline.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_auto_inline.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_auto_inline.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_cross_thread_reduction.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_cross_thread_reduction.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_cross_thread_reduction.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_cross_thread_reduction.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_mlt.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_mlt.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_mlt.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_mlt.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_mlt_intrin.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_mlt_intrin.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_mlt_intrin.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_mlt_intrin.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_mlt_tc.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_mlt_tc.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_mlt_tc.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_mlt_tc.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_parallel_vectorize_unroll.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_parallel_vectorize_unroll.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_parallel_vectorize_unroll.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_parallel_vectorize_unroll.py diff --git a/tests/python/unittest/test_meta_schedule_schedule_rule_random_compute_location.py b/tests/python/meta-schedule/test_meta_schedule_schedule_rule_random_compute_location.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_schedule_rule_random_compute_location.py rename to tests/python/meta-schedule/test_meta_schedule_schedule_rule_random_compute_location.py diff --git a/tests/python/unittest/test_meta_schedule_search_strategy.py b/tests/python/meta-schedule/test_meta_schedule_search_strategy.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_search_strategy.py rename to tests/python/meta-schedule/test_meta_schedule_search_strategy.py diff --git a/tests/python/unittest/test_meta_schedule_space_cpu.py b/tests/python/meta-schedule/test_meta_schedule_space_cpu.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_space_cpu.py rename to tests/python/meta-schedule/test_meta_schedule_space_cpu.py diff --git a/tests/python/unittest/test_meta_schedule_space_cpu_winograd.py b/tests/python/meta-schedule/test_meta_schedule_space_cpu_winograd.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_space_cpu_winograd.py rename to tests/python/meta-schedule/test_meta_schedule_space_cpu_winograd.py diff --git a/tests/python/unittest/test_meta_schedule_space_cuda.py b/tests/python/meta-schedule/test_meta_schedule_space_cuda.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_space_cuda.py rename to tests/python/meta-schedule/test_meta_schedule_space_cuda.py diff --git a/tests/python/unittest/test_meta_schedule_space_cuda_async.py b/tests/python/meta-schedule/test_meta_schedule_space_cuda_async.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_space_cuda_async.py rename to tests/python/meta-schedule/test_meta_schedule_space_cuda_async.py diff --git a/tests/python/unittest/test_meta_schedule_space_cuda_async_multiple_initialization.py b/tests/python/meta-schedule/test_meta_schedule_space_cuda_async_multiple_initialization.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_space_cuda_async_multiple_initialization.py rename to tests/python/meta-schedule/test_meta_schedule_space_cuda_async_multiple_initialization.py diff --git a/tests/python/unittest/test_meta_schedule_space_cuda_winograd.py b/tests/python/meta-schedule/test_meta_schedule_space_cuda_winograd.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_space_cuda_winograd.py rename to tests/python/meta-schedule/test_meta_schedule_space_cuda_winograd.py diff --git a/tests/python/unittest/test_meta_schedule_space_generator.py b/tests/python/meta-schedule/test_meta_schedule_space_generator.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_space_generator.py rename to tests/python/meta-schedule/test_meta_schedule_space_generator.py diff --git a/tests/python/unittest/test_meta_schedule_task_scheduler.py b/tests/python/meta-schedule/test_meta_schedule_task_scheduler.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_task_scheduler.py rename to tests/python/meta-schedule/test_meta_schedule_task_scheduler.py diff --git a/tests/python/unittest/test_meta_schedule_trace_apply.py b/tests/python/meta-schedule/test_meta_schedule_trace_apply.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_trace_apply.py rename to tests/python/meta-schedule/test_meta_schedule_trace_apply.py diff --git a/tests/python/unittest/test_meta_schedule_tune_context.py b/tests/python/meta-schedule/test_meta_schedule_tune_context.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_tune_context.py rename to tests/python/meta-schedule/test_meta_schedule_tune_context.py diff --git a/tests/python/unittest/test_meta_schedule_tune_tir.py b/tests/python/meta-schedule/test_meta_schedule_tune_tir.py similarity index 100% rename from tests/python/unittest/test_meta_schedule_tune_tir.py rename to tests/python/meta-schedule/test_meta_schedule_tune_tir.py diff --git a/tests/python/unittest/test_aot_legalize_packed_call.py b/tests/python/micro/test_aot_legalize_packed_call.py similarity index 100% rename from tests/python/unittest/test_aot_legalize_packed_call.py rename to tests/python/micro/test_aot_legalize_packed_call.py diff --git a/tests/python/unittest/test_crt.py b/tests/python/micro/test_crt.py similarity index 100% rename from tests/python/unittest/test_crt.py rename to tests/python/micro/test_crt.py diff --git a/tests/python/tir/test_debug_info.py b/tests/python/micro/test_debug_info.py similarity index 100% rename from tests/python/tir/test_debug_info.py rename to tests/python/micro/test_debug_info.py diff --git a/tests/python/unittest/test_link_params.py b/tests/python/micro/test_link_params.py similarity index 100% rename from tests/python/unittest/test_link_params.py rename to tests/python/micro/test_link_params.py diff --git a/tests/python/unittest/test_micro_model_library_format.py b/tests/python/micro/test_micro_model_library_format.py similarity index 100% rename from tests/python/unittest/test_micro_model_library_format.py rename to tests/python/micro/test_micro_model_library_format.py diff --git a/tests/python/unittest/test_micro_ms_tuning.py b/tests/python/micro/test_micro_ms_tuning.py similarity index 100% rename from tests/python/unittest/test_micro_ms_tuning.py rename to tests/python/micro/test_micro_ms_tuning.py diff --git a/tests/python/unittest/test_micro_project_api.py b/tests/python/micro/test_micro_project_api.py similarity index 100% rename from tests/python/unittest/test_micro_project_api.py rename to tests/python/micro/test_micro_project_api.py diff --git a/tests/python/unittest/test_micro_transport.py b/tests/python/micro/test_micro_transport.py similarity index 100% rename from tests/python/unittest/test_micro_transport.py rename to tests/python/micro/test_micro_transport.py diff --git a/tests/python/unittest/test_tir_transform_inject_rolling_buffer.py b/tests/python/micro/test_tir_transform_inject_rolling_buffer.py similarity index 100% rename from tests/python/unittest/test_tir_transform_inject_rolling_buffer.py rename to tests/python/micro/test_tir_transform_inject_rolling_buffer.py diff --git a/tests/python/relax/conftest.py b/tests/python/relax-cuda/conftest.py similarity index 100% rename from tests/python/relax/conftest.py rename to tests/python/relax-cuda/conftest.py diff --git a/tests/python/relax/test_codegen_cublas.py b/tests/python/relax-cuda/test_codegen_cublas.py similarity index 100% rename from tests/python/relax/test_codegen_cublas.py rename to tests/python/relax-cuda/test_codegen_cublas.py diff --git a/tests/python/relax/test_codegen_cudnn.py b/tests/python/relax-cuda/test_codegen_cudnn.py similarity index 99% rename from tests/python/relax/test_codegen_cudnn.py rename to tests/python/relax-cuda/test_codegen_cudnn.py index 5ba638c11c..80b2affd90 100644 --- a/tests/python/relax/test_codegen_cudnn.py +++ b/tests/python/relax-cuda/test_codegen_cudnn.py @@ -24,7 +24,6 @@ from tvm.relax.backend.contrib.cudnn import partition_for_cudnn from tvm.relax.testing import get_relax_matmul_module from tvm.script import relax as R - from tvm.script.ir_builder import IRBuilder from tvm.script.ir_builder import relax as relax_builder @@ -203,6 +202,7 @@ def test_conv2d_offload(data_shape, weight_shape, dtype, with_bias, activation): tvm.testing.assert_allclose(out, ref, rtol=1e-2, atol=1e-2) +@pytest.mark.xfail @pytest.mark.parametrize( "data_shape, weight_shape, dtype, with_bias, activation", [ diff --git a/tests/python/relax/test_codegen_cutlass.py b/tests/python/relax-cuda/test_codegen_cutlass.py similarity index 99% rename from tests/python/relax/test_codegen_cutlass.py rename to tests/python/relax-cuda/test_codegen_cutlass.py index e8d4e83521..dd6e367aeb 100644 --- a/tests/python/relax/test_codegen_cutlass.py +++ b/tests/python/relax-cuda/test_codegen_cutlass.py @@ -1158,6 +1158,7 @@ def get_mod(data_shape, dtype, axes): tvm.testing.assert_allclose(out, ref, rtol=1e-2, atol=1e-2) +@pytest.mark.xfail def test_attention_rewrite_fp16(): @I.ir_module class Module: diff --git a/tests/python/relax/test_codegen_tensorrt.py b/tests/python/relax-cuda/test_codegen_tensorrt.py similarity index 95% rename from tests/python/relax/test_codegen_tensorrt.py rename to tests/python/relax-cuda/test_codegen_tensorrt.py index 595103bc5f..7ae3fdc3b6 100644 --- a/tests/python/relax/test_codegen_tensorrt.py +++ b/tests/python/relax-cuda/test_codegen_tensorrt.py @@ -14,15 +14,24 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -import pytest import numpy as np +import pytest + import tvm import tvm.testing - from tvm import relax -from tvm.script import relax as R -from tvm.relax.dpl import make_fused_bias_activation_pattern, is_op, wildcard from tvm.contrib.pickle_memoize import memoize +from tvm.relax.dpl import is_op, make_fused_bias_activation_pattern, wildcard +from tvm.script import relax as R + +has_tensorrt = False + +tensorrt_enabled = pytest.mark.skipif( + not has_tensorrt, + reason="TENSORRT not enabled.", +) + +pytestmark = [tensorrt_enabled] @tvm.script.ir_module @@ -42,16 +51,6 @@ def main( return out -has_tensorrt = tvm.get_global_func("relax.ext.tensorrt", True) - -tensorrt_enabled = pytest.mark.skipif( - not has_tensorrt, - reason="TENSORRT not enabled.", -) - -pytestmark = [tensorrt_enabled] - - def build_and_run(mod, inputs_np, target, legalize=False): if legalize: mod = relax.transform.LegalizeOps()(mod) diff --git a/tests/python/relax/test_codegen_tir_cutlass.py b/tests/python/relax-cuda/test_codegen_tir_cutlass.py similarity index 99% rename from tests/python/relax/test_codegen_tir_cutlass.py rename to tests/python/relax-cuda/test_codegen_tir_cutlass.py index 9c960ed355..d09dbf6e14 100644 --- a/tests/python/relax/test_codegen_tir_cutlass.py +++ b/tests/python/relax-cuda/test_codegen_tir_cutlass.py @@ -16,24 +16,27 @@ # under the License. from __future__ import annotations + import tempfile -from tvm import relax, runtime -import tvm -import tvm.testing -from tvm import relax +import numpy as np +import pytest import scipy from scipy.special import erf -import numpy as np -from tvm.target import Target + +import tvm +import tvm.testing +from tvm import relax, runtime +from tvm.relax.backend_tir import get_tir_pattern +from tvm.relax.backend_tir.contrib.cutlass import compile_options, cutlass_fcodegen from tvm.relax.vm_build import build as relax_build -from tvm.script.ir_builder import relax as R +from tvm.script.ir_builder import IRBuilder from tvm.script.ir_builder import ir as I +from tvm.script.ir_builder import relax as R from tvm.script.ir_builder import tir as T -from tvm.script.ir_builder import IRBuilder +from tvm.target import Target -from tvm.relax.backend_tir import get_tir_pattern -from tvm.relax.backend_tir.contrib.cutlass import cutlass_fcodegen, compile_options +pytestmark = pytest.mark.skip A_TYPE = "float16" B_TYPE = "float16" diff --git a/tests/python/relax-dist/conftest.py b/tests/python/relax-dist/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-dist/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/distributed/test_distributed_dtensor_sinfo.py b/tests/python/relax-dist/test_distributed_dtensor_sinfo.py similarity index 100% rename from tests/python/relax/distributed/test_distributed_dtensor_sinfo.py rename to tests/python/relax-dist/test_distributed_dtensor_sinfo.py diff --git a/tests/python/relax/distributed/test_distributed_transform_propagate_sharding.py b/tests/python/relax-dist/test_distributed_transform_propagate_sharding.py similarity index 100% rename from tests/python/relax/distributed/test_distributed_transform_propagate_sharding.py rename to tests/python/relax-dist/test_distributed_transform_propagate_sharding.py diff --git a/tests/python/relax/distributed/test_distributed_tvmscript_parser.py b/tests/python/relax-dist/test_distributed_tvmscript_parser.py similarity index 100% rename from tests/python/relax/distributed/test_distributed_tvmscript_parser.py rename to tests/python/relax-dist/test_distributed_tvmscript_parser.py diff --git a/tests/python/relax/distributed/test_distributed_tvmscript_printer.py b/tests/python/relax-dist/test_distributed_tvmscript_printer.py similarity index 100% rename from tests/python/relax/distributed/test_distributed_tvmscript_printer.py rename to tests/python/relax-dist/test_distributed_tvmscript_printer.py diff --git a/tests/python/relax-dnnl/conftest.py b/tests/python/relax-dnnl/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-dnnl/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_codegen_dnnl.py b/tests/python/relax-dnnl/test_codegen_dnnl.py similarity index 100% rename from tests/python/relax/test_codegen_dnnl.py rename to tests/python/relax-dnnl/test_codegen_dnnl.py diff --git a/tests/python/relax-ir/conftest.py b/tests/python/relax-ir/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-ir/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_blockbuilder_core.py b/tests/python/relax-ir/test_blockbuilder_core.py similarity index 100% rename from tests/python/relax/test_blockbuilder_core.py rename to tests/python/relax-ir/test_blockbuilder_core.py diff --git a/tests/python/relax/test_blockbuilder_emit_te.py b/tests/python/relax-ir/test_blockbuilder_emit_te.py similarity index 100% rename from tests/python/relax/test_blockbuilder_emit_te.py rename to tests/python/relax-ir/test_blockbuilder_emit_te.py diff --git a/tests/python/relax/test_utils.py b/tests/python/relax-ir/test_copy_with_new_vars.py similarity index 100% rename from tests/python/relax/test_utils.py rename to tests/python/relax-ir/test_copy_with_new_vars.py diff --git a/tests/python/relax/test_frontend_common.py b/tests/python/relax-ir/test_detach_params.py similarity index 100% rename from tests/python/relax/test_frontend_common.py rename to tests/python/relax-ir/test_detach_params.py diff --git a/tests/python/relax/test_expr.py b/tests/python/relax-ir/test_expr.py similarity index 100% rename from tests/python/relax/test_expr.py rename to tests/python/relax-ir/test_expr.py diff --git a/tests/python/relax/test_expr_functor.py b/tests/python/relax-ir/test_expr_functor.py similarity index 100% rename from tests/python/relax/test_expr_functor.py rename to tests/python/relax-ir/test_expr_functor.py diff --git a/tests/python/relax/test_bind_symbolic_vars.py b/tests/python/relax-ir/test_function_bind_symbolic_vars.py similarity index 100% rename from tests/python/relax/test_bind_symbolic_vars.py rename to tests/python/relax-ir/test_function_bind_symbolic_vars.py diff --git a/tests/python/relax/test_json_compact.py b/tests/python/relax-ir/test_json_compact.py similarity index 100% rename from tests/python/relax/test_json_compact.py rename to tests/python/relax-ir/test_json_compact.py diff --git a/tests/python/relax/test_struct_info.py b/tests/python/relax-ir/test_struct_info.py similarity index 100% rename from tests/python/relax/test_struct_info.py rename to tests/python/relax-ir/test_struct_info.py diff --git a/tests/python/relax-meta-schedule/conftest.py b/tests/python/relax-meta-schedule/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-meta-schedule/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_meta_schedule_relax_integration.py b/tests/python/relax-meta-schedule/test_meta_schedule_relax_integration.py similarity index 100% rename from tests/python/relax/test_meta_schedule_relax_integration.py rename to tests/python/relax-meta-schedule/test_meta_schedule_relax_integration.py diff --git a/tests/python/relax/test_transform_few_shot_tuning.py b/tests/python/relax-meta-schedule/test_transform_few_shot_tuning.py similarity index 99% rename from tests/python/relax/test_transform_few_shot_tuning.py rename to tests/python/relax-meta-schedule/test_transform_few_shot_tuning.py index 0b4e2e08c5..2d1ae787ef 100644 --- a/tests/python/relax/test_transform_few_shot_tuning.py +++ b/tests/python/relax-meta-schedule/test_transform_few_shot_tuning.py @@ -16,18 +16,20 @@ # under the License. # pylint: disable=invalid-name,,missing-function-docstring from typing import List, Tuple + import numpy as np +import pytest import tvm +import tvm.testing +from tvm.meta_schedule.arg_info import ArgInfo +from tvm.meta_schedule.testing.tune_utils import generate_input_data +from tvm.relax.transform import FewShotTuning from tvm.script import tir as T from tvm.tir.tensor_intrin.cuda import * # pylint: disable=wildcard-import,unused-wildcard-import from tvm.tir.tensor_intrin.x86 import * # pylint: disable=wildcard-import,unused-wildcard-import -from tvm.meta_schedule.testing.tune_utils import generate_input_data -from tvm.meta_schedule.arg_info import ArgInfo -from tvm.relax.transform import FewShotTuning -import tvm.testing -import pytest +pytestmark = pytest.mark.skip # pylint: disable=no-self-argument,missing-class-docstring,line-too-long # fmt: off diff --git a/tests/python/relax/test_transform_meta_schedule_tuning.py b/tests/python/relax-meta-schedule/test_transform_meta_schedule_tuning.py similarity index 100% rename from tests/python/relax/test_transform_meta_schedule_tuning.py rename to tests/python/relax-meta-schedule/test_transform_meta_schedule_tuning.py diff --git a/tests/python/relax/test_tuning_api.py b/tests/python/relax-meta-schedule/test_tuning_api.py similarity index 100% rename from tests/python/relax/test_tuning_api.py rename to tests/python/relax-meta-schedule/test_tuning_api.py diff --git a/tests/python/relax-nn-module/conftest.py b/tests/python/relax-nn-module/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-nn-module/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_frontend_nn_extern_module.py b/tests/python/relax-nn-module/test_frontend_nn_extern_module.py similarity index 100% rename from tests/python/relax/test_frontend_nn_extern_module.py rename to tests/python/relax-nn-module/test_frontend_nn_extern_module.py diff --git a/tests/python/relax/test_frontend_nn_modules.py b/tests/python/relax-nn-module/test_frontend_nn_modules.py similarity index 100% rename from tests/python/relax/test_frontend_nn_modules.py rename to tests/python/relax-nn-module/test_frontend_nn_modules.py diff --git a/tests/python/relax/test_frontend_nn_op.py b/tests/python/relax-nn-module/test_frontend_nn_op.py similarity index 100% rename from tests/python/relax/test_frontend_nn_op.py rename to tests/python/relax-nn-module/test_frontend_nn_op.py diff --git a/tests/python/relax/test_frontend_nn_subroutines.py b/tests/python/relax-nn-module/test_frontend_nn_subroutines.py similarity index 100% rename from tests/python/relax/test_frontend_nn_subroutines.py rename to tests/python/relax-nn-module/test_frontend_nn_subroutines.py diff --git a/tests/python/relax/test_frontend_nn_tensor.py b/tests/python/relax-nn-module/test_frontend_nn_tensor.py similarity index 100% rename from tests/python/relax/test_frontend_nn_tensor.py rename to tests/python/relax-nn-module/test_frontend_nn_tensor.py diff --git a/tests/python/relax/test_testing_nn.py b/tests/python/relax-nn-module/test_legacy_nn.py similarity index 100% rename from tests/python/relax/test_testing_nn.py rename to tests/python/relax-nn-module/test_legacy_nn.py diff --git a/tests/python/relax-onnx/conftest.py b/tests/python/relax-onnx/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-onnx/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_frontend_onnx.py b/tests/python/relax-onnx/test_frontend_onnx.py similarity index 100% rename from tests/python/relax/test_frontend_onnx.py rename to tests/python/relax-onnx/test_frontend_onnx.py diff --git a/tests/python/relax-op/conftest.py b/tests/python/relax-op/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-op/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_bind_params.py b/tests/python/relax-op/test_bind_params.py similarity index 100% rename from tests/python/relax/test_bind_params.py rename to tests/python/relax-op/test_bind_params.py diff --git a/tests/python/relax/test_e2e_op_dynamic.py b/tests/python/relax-op/test_dynamic_strided_slice.py similarity index 100% rename from tests/python/relax/test_e2e_op_dynamic.py rename to tests/python/relax-op/test_dynamic_strided_slice.py diff --git a/tests/python/relax/test_expr_args_converter.py b/tests/python/relax-op/test_expr_args_converter.py similarity index 100% rename from tests/python/relax/test_expr_args_converter.py rename to tests/python/relax-op/test_expr_args_converter.py diff --git a/tests/python/relax/test_frontend_nn_jit.py b/tests/python/relax-op/test_frontend_nn_jit.py similarity index 100% rename from tests/python/relax/test_frontend_nn_jit.py rename to tests/python/relax-op/test_frontend_nn_jit.py diff --git a/tests/python/relax/test_op_binary.py b/tests/python/relax-op/test_op_binary.py similarity index 100% rename from tests/python/relax/test_op_binary.py rename to tests/python/relax-op/test_op_binary.py diff --git a/tests/python/relax/test_op_ccl.py b/tests/python/relax-op/test_op_ccl.py similarity index 100% rename from tests/python/relax/test_op_ccl.py rename to tests/python/relax-op/test_op_ccl.py diff --git a/tests/python/relax/test_op_create.py b/tests/python/relax-op/test_op_create.py similarity index 100% rename from tests/python/relax/test_op_create.py rename to tests/python/relax-op/test_op_create.py diff --git a/tests/python/relax/test_op_datatype.py b/tests/python/relax-op/test_op_datatype.py similarity index 100% rename from tests/python/relax/test_op_datatype.py rename to tests/python/relax-op/test_op_datatype.py diff --git a/tests/python/relax/test_op_grad.py b/tests/python/relax-op/test_op_grad.py similarity index 100% rename from tests/python/relax/test_op_grad.py rename to tests/python/relax-op/test_op_grad.py diff --git a/tests/python/relax/test_op_gradient_numeric.py b/tests/python/relax-op/test_op_gradient_numeric.py similarity index 100% rename from tests/python/relax/test_op_gradient_numeric.py rename to tests/python/relax-op/test_op_gradient_numeric.py diff --git a/tests/python/relax/test_op_image.py b/tests/python/relax-op/test_op_image.py similarity index 100% rename from tests/python/relax/test_op_image.py rename to tests/python/relax-op/test_op_image.py diff --git a/tests/python/relax/test_op_index.py b/tests/python/relax-op/test_op_index.py similarity index 100% rename from tests/python/relax/test_op_index.py rename to tests/python/relax-op/test_op_index.py diff --git a/tests/python/relax/test_op_linear_algebra.py b/tests/python/relax-op/test_op_linear_algebra.py similarity index 100% rename from tests/python/relax/test_op_linear_algebra.py rename to tests/python/relax-op/test_op_linear_algebra.py diff --git a/tests/python/relax/test_op_manipulate.py b/tests/python/relax-op/test_op_manipulate.py similarity index 100% rename from tests/python/relax/test_op_manipulate.py rename to tests/python/relax-op/test_op_manipulate.py diff --git a/tests/python/relax/test_op_misc.py b/tests/python/relax-op/test_op_misc.py similarity index 100% rename from tests/python/relax/test_op_misc.py rename to tests/python/relax-op/test_op_misc.py diff --git a/tests/python/relax/test_op_nn.py b/tests/python/relax-op/test_op_nn.py similarity index 100% rename from tests/python/relax/test_op_nn.py rename to tests/python/relax-op/test_op_nn.py diff --git a/tests/python/relax/test_op_nn_convolution.py b/tests/python/relax-op/test_op_nn_convolution.py similarity index 100% rename from tests/python/relax/test_op_nn_convolution.py rename to tests/python/relax-op/test_op_nn_convolution.py diff --git a/tests/python/relax/test_op_nn_pooling.py b/tests/python/relax-op/test_op_nn_pooling.py similarity index 100% rename from tests/python/relax/test_op_nn_pooling.py rename to tests/python/relax-op/test_op_nn_pooling.py diff --git a/tests/python/relax/test_op_search.py b/tests/python/relax-op/test_op_search.py similarity index 100% rename from tests/python/relax/test_op_search.py rename to tests/python/relax-op/test_op_search.py diff --git a/tests/python/relax/test_op_set.py b/tests/python/relax-op/test_op_set.py similarity index 100% rename from tests/python/relax/test_op_set.py rename to tests/python/relax-op/test_op_set.py diff --git a/tests/python/relax/test_op_statistical.py b/tests/python/relax-op/test_op_statistical.py similarity index 100% rename from tests/python/relax/test_op_statistical.py rename to tests/python/relax-op/test_op_statistical.py diff --git a/tests/python/relax/test_op_ternary.py b/tests/python/relax-op/test_op_ternary.py similarity index 100% rename from tests/python/relax/test_op_ternary.py rename to tests/python/relax-op/test_op_ternary.py diff --git a/tests/python/relax/test_op_unary.py b/tests/python/relax-op/test_op_unary.py similarity index 100% rename from tests/python/relax/test_op_unary.py rename to tests/python/relax-op/test_op_unary.py diff --git a/tests/python/relax/test_optimize_layout_transform.py b/tests/python/relax-op/test_optimize_layout_transform.py similarity index 100% rename from tests/python/relax/test_optimize_layout_transform.py rename to tests/python/relax-op/test_optimize_layout_transform.py diff --git a/tests/python/relax/test_relax_operators.py b/tests/python/relax-op/test_relax_operators.py similarity index 100% rename from tests/python/relax/test_relax_operators.py rename to tests/python/relax-op/test_relax_operators.py diff --git a/tests/python/relax/test_transform_bundle_model_params.py b/tests/python/relax-op/test_transform_bundle_model_params.py similarity index 100% rename from tests/python/relax/test_transform_bundle_model_params.py rename to tests/python/relax-op/test_transform_bundle_model_params.py diff --git a/tests/python/relax/test_transform_legalize_ops.py b/tests/python/relax-op/test_transform_legalize_ops.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops.py rename to tests/python/relax-op/test_transform_legalize_ops.py diff --git a/tests/python/relax/test_transform_legalize_ops_binary.py b/tests/python/relax-op/test_transform_legalize_ops_binary.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_binary.py rename to tests/python/relax-op/test_transform_legalize_ops_binary.py diff --git a/tests/python/relax/test_transform_legalize_ops_ccl.py b/tests/python/relax-op/test_transform_legalize_ops_ccl.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_ccl.py rename to tests/python/relax-op/test_transform_legalize_ops_ccl.py diff --git a/tests/python/relax/test_transform_legalize_ops_create_datatype.py b/tests/python/relax-op/test_transform_legalize_ops_create_datatype.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_create_datatype.py rename to tests/python/relax-op/test_transform_legalize_ops_create_datatype.py diff --git a/tests/python/relax/test_transform_legalize_ops_grad.py b/tests/python/relax-op/test_transform_legalize_ops_grad.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_grad.py rename to tests/python/relax-op/test_transform_legalize_ops_grad.py diff --git a/tests/python/relax/test_transform_legalize_ops_image.py b/tests/python/relax-op/test_transform_legalize_ops_image.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_image.py rename to tests/python/relax-op/test_transform_legalize_ops_image.py diff --git a/tests/python/relax/test_transform_legalize_ops_index_linear_algebra.py b/tests/python/relax-op/test_transform_legalize_ops_index_linear_algebra.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_index_linear_algebra.py rename to tests/python/relax-op/test_transform_legalize_ops_index_linear_algebra.py diff --git a/tests/python/relax/test_transform_legalize_ops_manipulate.py b/tests/python/relax-op/test_transform_legalize_ops_manipulate.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_manipulate.py rename to tests/python/relax-op/test_transform_legalize_ops_manipulate.py diff --git a/tests/python/relax/test_transform_legalize_ops_nn.py b/tests/python/relax-op/test_transform_legalize_ops_nn.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_nn.py rename to tests/python/relax-op/test_transform_legalize_ops_nn.py diff --git a/tests/python/relax/test_transform_legalize_ops_search_statistical.py b/tests/python/relax-op/test_transform_legalize_ops_search_statistical.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_search_statistical.py rename to tests/python/relax-op/test_transform_legalize_ops_search_statistical.py diff --git a/tests/python/relax/test_transform_legalize_ops_unary.py b/tests/python/relax-op/test_transform_legalize_ops_unary.py similarity index 100% rename from tests/python/relax/test_transform_legalize_ops_unary.py rename to tests/python/relax-op/test_transform_legalize_ops_unary.py diff --git a/tests/python/relax/test_transform_realize_vdevice.py b/tests/python/relax-op/test_transform_realize_vdevice.py similarity index 100% rename from tests/python/relax/test_transform_realize_vdevice.py rename to tests/python/relax-op/test_transform_realize_vdevice.py diff --git a/tests/python/relax/test_tvmscript_parser_op_arith_cmp.py b/tests/python/relax-op/test_tvmscript_parser_op_arith_cmp.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_arith_cmp.py rename to tests/python/relax-op/test_tvmscript_parser_op_arith_cmp.py diff --git a/tests/python/relax/test_tvmscript_parser_op_create.py b/tests/python/relax-op/test_tvmscript_parser_op_create.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_create.py rename to tests/python/relax-op/test_tvmscript_parser_op_create.py diff --git a/tests/python/relax/test_tvmscript_parser_op_datatype.py b/tests/python/relax-op/test_tvmscript_parser_op_datatype.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_datatype.py rename to tests/python/relax-op/test_tvmscript_parser_op_datatype.py diff --git a/tests/python/relax/test_tvmscript_parser_op_grad.py b/tests/python/relax-op/test_tvmscript_parser_op_grad.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_grad.py rename to tests/python/relax-op/test_tvmscript_parser_op_grad.py diff --git a/tests/python/relax/test_tvmscript_parser_op_image.py b/tests/python/relax-op/test_tvmscript_parser_op_image.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_image.py rename to tests/python/relax-op/test_tvmscript_parser_op_image.py diff --git a/tests/python/relax/test_tvmscript_parser_op_index.py b/tests/python/relax-op/test_tvmscript_parser_op_index.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_index.py rename to tests/python/relax-op/test_tvmscript_parser_op_index.py diff --git a/tests/python/relax/test_tvmscript_parser_op_linear_algebra.py b/tests/python/relax-op/test_tvmscript_parser_op_linear_algebra.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_linear_algebra.py rename to tests/python/relax-op/test_tvmscript_parser_op_linear_algebra.py diff --git a/tests/python/relax/test_tvmscript_parser_op_manipulate.py b/tests/python/relax-op/test_tvmscript_parser_op_manipulate.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_manipulate.py rename to tests/python/relax-op/test_tvmscript_parser_op_manipulate.py diff --git a/tests/python/relax/test_tvmscript_parser_op_nn.py b/tests/python/relax-op/test_tvmscript_parser_op_nn.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_nn.py rename to tests/python/relax-op/test_tvmscript_parser_op_nn.py diff --git a/tests/python/relax/test_tvmscript_parser_op_search.py b/tests/python/relax-op/test_tvmscript_parser_op_search.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_search.py rename to tests/python/relax-op/test_tvmscript_parser_op_search.py diff --git a/tests/python/relax/test_tvmscript_parser_op_set.py b/tests/python/relax-op/test_tvmscript_parser_op_set.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_set.py rename to tests/python/relax-op/test_tvmscript_parser_op_set.py diff --git a/tests/python/relax/test_tvmscript_parser_op_statistical.py b/tests/python/relax-op/test_tvmscript_parser_op_statistical.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser_op_statistical.py rename to tests/python/relax-op/test_tvmscript_parser_op_statistical.py diff --git a/tests/python/relax-pass/conftest.py b/tests/python/relax-pass/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-pass/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_analysis.py b/tests/python/relax-pass/test_analysis.py similarity index 100% rename from tests/python/relax/test_analysis.py rename to tests/python/relax-pass/test_analysis.py diff --git a/tests/python/relax/test_analysis_contains_impure_call.py b/tests/python/relax-pass/test_analysis_contains_impure_call.py similarity index 100% rename from tests/python/relax/test_analysis_contains_impure_call.py rename to tests/python/relax-pass/test_analysis_contains_impure_call.py diff --git a/tests/python/relax/test_analysis_detect_recursion.py b/tests/python/relax-pass/test_analysis_detect_recursion.py similarity index 100% rename from tests/python/relax/test_analysis_detect_recursion.py rename to tests/python/relax-pass/test_analysis_detect_recursion.py diff --git a/tests/python/relax/test_analysis_estimate_memory_usage.py b/tests/python/relax-pass/test_analysis_estimate_memory_usage.py similarity index 100% rename from tests/python/relax/test_analysis_estimate_memory_usage.py rename to tests/python/relax-pass/test_analysis_estimate_memory_usage.py diff --git a/tests/python/relax/test_analysis_struct_info_analysis.py b/tests/python/relax-pass/test_analysis_struct_info_analysis.py similarity index 100% rename from tests/python/relax/test_analysis_struct_info_analysis.py rename to tests/python/relax-pass/test_analysis_struct_info_analysis.py diff --git a/tests/python/relax/test_analysis_suggest_layout_transforms.py b/tests/python/relax-pass/test_analysis_suggest_layout_transforms.py similarity index 100% rename from tests/python/relax/test_analysis_suggest_layout_transforms.py rename to tests/python/relax-pass/test_analysis_suggest_layout_transforms.py diff --git a/tests/python/relax/test_analysis_well_formed.py b/tests/python/relax-pass/test_analysis_well_formed.py similarity index 100% rename from tests/python/relax/test_analysis_well_formed.py rename to tests/python/relax-pass/test_analysis_well_formed.py diff --git a/tests/python/relax/test_transform.py b/tests/python/relax-pass/test_transform.py similarity index 100% rename from tests/python/relax/test_transform.py rename to tests/python/relax-pass/test_transform.py diff --git a/tests/python/relax/test_transform_allocate_workspace.py b/tests/python/relax-pass/test_transform_allocate_workspace.py similarity index 100% rename from tests/python/relax/test_transform_allocate_workspace.py rename to tests/python/relax-pass/test_transform_allocate_workspace.py diff --git a/tests/python/relax/test_transform_alter_op_impl.py b/tests/python/relax-pass/test_transform_alter_op_impl.py similarity index 100% rename from tests/python/relax/test_transform_alter_op_impl.py rename to tests/python/relax-pass/test_transform_alter_op_impl.py diff --git a/tests/python/relax/test_transform_annotate_tir_op_pattern.py b/tests/python/relax-pass/test_transform_annotate_tir_op_pattern.py similarity index 100% rename from tests/python/relax/test_transform_annotate_tir_op_pattern.py rename to tests/python/relax-pass/test_transform_annotate_tir_op_pattern.py diff --git a/tests/python/relax/test_transform_attach_global_symbol.py b/tests/python/relax-pass/test_transform_attach_global_symbol.py similarity index 100% rename from tests/python/relax/test_transform_attach_global_symbol.py rename to tests/python/relax-pass/test_transform_attach_global_symbol.py diff --git a/tests/python/relax/test_transform_bind_params.py b/tests/python/relax-pass/test_transform_bind_params.py similarity index 100% rename from tests/python/relax/test_transform_bind_params.py rename to tests/python/relax-pass/test_transform_bind_params.py diff --git a/tests/python/relax/test_transform_bind_symbolic_vars.py b/tests/python/relax-pass/test_transform_bind_symbolic_vars.py similarity index 100% rename from tests/python/relax/test_transform_bind_symbolic_vars.py rename to tests/python/relax-pass/test_transform_bind_symbolic_vars.py diff --git a/tests/python/relax/test_transform_canonicalize_bindings.py b/tests/python/relax-pass/test_transform_canonicalize_bindings.py similarity index 100% rename from tests/python/relax/test_transform_canonicalize_bindings.py rename to tests/python/relax-pass/test_transform_canonicalize_bindings.py diff --git a/tests/python/relax/test_transform_codegen_pass.py b/tests/python/relax-pass/test_transform_codegen_pass.py similarity index 100% rename from tests/python/relax/test_transform_codegen_pass.py rename to tests/python/relax-pass/test_transform_codegen_pass.py diff --git a/tests/python/relax/test_transform_combine_parallel_matmul.py b/tests/python/relax-pass/test_transform_combine_parallel_matmul.py similarity index 100% rename from tests/python/relax/test_transform_combine_parallel_matmul.py rename to tests/python/relax-pass/test_transform_combine_parallel_matmul.py diff --git a/tests/python/relax/test_transform_convert_layout.py b/tests/python/relax-pass/test_transform_convert_layout.py similarity index 100% rename from tests/python/relax/test_transform_convert_layout.py rename to tests/python/relax-pass/test_transform_convert_layout.py diff --git a/tests/python/relax/test_transform_cse.py b/tests/python/relax-pass/test_transform_cse.py similarity index 100% rename from tests/python/relax/test_transform_cse.py rename to tests/python/relax-pass/test_transform_cse.py diff --git a/tests/python/relax/test_transform_dead_code_elimination.py b/tests/python/relax-pass/test_transform_dead_code_elimination.py similarity index 100% rename from tests/python/relax/test_transform_dead_code_elimination.py rename to tests/python/relax-pass/test_transform_dead_code_elimination.py diff --git a/tests/python/relax/test_transform_decompose_ops.py b/tests/python/relax-pass/test_transform_decompose_ops.py similarity index 100% rename from tests/python/relax/test_transform_decompose_ops.py rename to tests/python/relax-pass/test_transform_decompose_ops.py diff --git a/tests/python/relax/test_transform_fold_constant.py b/tests/python/relax-pass/test_transform_fold_constant.py similarity index 100% rename from tests/python/relax/test_transform_fold_constant.py rename to tests/python/relax-pass/test_transform_fold_constant.py diff --git a/tests/python/relax/test_transform_fold_dataflow_block_output.py b/tests/python/relax-pass/test_transform_fold_dataflow_block_output.py similarity index 100% rename from tests/python/relax/test_transform_fold_dataflow_block_output.py rename to tests/python/relax-pass/test_transform_fold_dataflow_block_output.py diff --git a/tests/python/relax/test_transform_fuse_ops.py b/tests/python/relax-pass/test_transform_fuse_ops.py similarity index 100% rename from tests/python/relax/test_transform_fuse_ops.py rename to tests/python/relax-pass/test_transform_fuse_ops.py diff --git a/tests/python/relax/test_transform_fuse_ops_by_pattern.py b/tests/python/relax-pass/test_transform_fuse_ops_by_pattern.py similarity index 100% rename from tests/python/relax/test_transform_fuse_ops_by_pattern.py rename to tests/python/relax-pass/test_transform_fuse_ops_by_pattern.py diff --git a/tests/python/relax/test_transform_fuse_tir.py b/tests/python/relax-pass/test_transform_fuse_tir.py similarity index 100% rename from tests/python/relax/test_transform_fuse_tir.py rename to tests/python/relax-pass/test_transform_fuse_tir.py diff --git a/tests/python/relax/test_transform_gradient.py b/tests/python/relax-pass/test_transform_gradient.py similarity index 100% rename from tests/python/relax/test_transform_gradient.py rename to tests/python/relax-pass/test_transform_gradient.py diff --git a/tests/python/relax/test_transform_gradient_checkpoint.py b/tests/python/relax-pass/test_transform_gradient_checkpoint.py similarity index 100% rename from tests/python/relax/test_transform_gradient_checkpoint.py rename to tests/python/relax-pass/test_transform_gradient_checkpoint.py diff --git a/tests/python/relax/test_transform_gradient_numeric.py b/tests/python/relax-pass/test_transform_gradient_numeric.py similarity index 100% rename from tests/python/relax/test_transform_gradient_numeric.py rename to tests/python/relax-pass/test_transform_gradient_numeric.py diff --git a/tests/python/relax/test_transform_gradient_te_register.py b/tests/python/relax-pass/test_transform_gradient_te_register.py similarity index 100% rename from tests/python/relax/test_transform_gradient_te_register.py rename to tests/python/relax-pass/test_transform_gradient_te_register.py diff --git a/tests/python/relax/test_transform_lambda_lift.py b/tests/python/relax-pass/test_transform_lambda_lift.py similarity index 100% rename from tests/python/relax/test_transform_lambda_lift.py rename to tests/python/relax-pass/test_transform_lambda_lift.py diff --git a/tests/python/relax/test_transform_lazy_transform_params.py b/tests/python/relax-pass/test_transform_lazy_transform_params.py similarity index 100% rename from tests/python/relax/test_transform_lazy_transform_params.py rename to tests/python/relax-pass/test_transform_lazy_transform_params.py diff --git a/tests/python/relax/test_transform_lift_transform_params.py b/tests/python/relax-pass/test_transform_lift_transform_params.py similarity index 100% rename from tests/python/relax/test_transform_lift_transform_params.py rename to tests/python/relax-pass/test_transform_lift_transform_params.py diff --git a/tests/python/relax/test_transform_merge_composite_functions.py b/tests/python/relax-pass/test_transform_merge_composite_functions.py similarity index 100% rename from tests/python/relax/test_transform_merge_composite_functions.py rename to tests/python/relax-pass/test_transform_merge_composite_functions.py diff --git a/tests/python/relax/test_transform_meta_schedule_apply_database.py b/tests/python/relax-pass/test_transform_meta_schedule_apply_database.py similarity index 100% rename from tests/python/relax/test_transform_meta_schedule_apply_database.py rename to tests/python/relax-pass/test_transform_meta_schedule_apply_database.py diff --git a/tests/python/relax/test_transform_normalize.py b/tests/python/relax-pass/test_transform_normalize.py similarity index 100% rename from tests/python/relax/test_transform_normalize.py rename to tests/python/relax-pass/test_transform_normalize.py diff --git a/tests/python/relax/test_transform_rewrite_cuda_graph.py b/tests/python/relax-pass/test_transform_rewrite_cuda_graph.py similarity index 100% rename from tests/python/relax/test_transform_rewrite_cuda_graph.py rename to tests/python/relax-pass/test_transform_rewrite_cuda_graph.py diff --git a/tests/python/relax/test_transform_rewrite_dataflow_reshape.py b/tests/python/relax-pass/test_transform_rewrite_dataflow_reshape.py similarity index 100% rename from tests/python/relax/test_transform_rewrite_dataflow_reshape.py rename to tests/python/relax-pass/test_transform_rewrite_dataflow_reshape.py diff --git a/tests/python/relax/test_backend_transform_shape_lower.py b/tests/python/relax-pass/test_transform_shape_lower.py similarity index 100% rename from tests/python/relax/test_backend_transform_shape_lower.py rename to tests/python/relax-pass/test_transform_shape_lower.py diff --git a/tests/python/relax/test_transform_static_plan_block_memory.py b/tests/python/relax-pass/test_transform_static_plan_block_memory.py similarity index 100% rename from tests/python/relax/test_transform_static_plan_block_memory.py rename to tests/python/relax-pass/test_transform_static_plan_block_memory.py diff --git a/tests/python/relax/test_transform_to_mixed_precision.py b/tests/python/relax-pass/test_transform_to_mixed_precision.py similarity index 100% rename from tests/python/relax/test_transform_to_mixed_precision.py rename to tests/python/relax-pass/test_transform_to_mixed_precision.py diff --git a/tests/python/relax/test_transform_update_vdevice.py b/tests/python/relax-pass/test_transform_update_vdevice.py similarity index 100% rename from tests/python/relax/test_transform_update_vdevice.py rename to tests/python/relax-pass/test_transform_update_vdevice.py diff --git a/tests/python/relax-pattern-lang/conftest.py b/tests/python/relax-pattern-lang/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-pattern-lang/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_binding_rewrite.py b/tests/python/relax-pattern-lang/test_binding_rewrite.py similarity index 100% rename from tests/python/relax/test_binding_rewrite.py rename to tests/python/relax-pattern-lang/test_binding_rewrite.py diff --git a/tests/python/relax/test_dataflow_pattern.py b/tests/python/relax-pattern-lang/test_dataflow_pattern.py similarity index 100% rename from tests/python/relax/test_dataflow_pattern.py rename to tests/python/relax-pattern-lang/test_dataflow_pattern.py diff --git a/tests/python/relax-relay/conftest.py b/tests/python/relax-relay/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-relay/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_relay_translator.py b/tests/python/relax-relay/test_relay_translator.py similarity index 100% rename from tests/python/relax/test_relay_translator.py rename to tests/python/relax-relay/test_relay_translator.py diff --git a/tests/python/relax-stablehlo/conftest.py b/tests/python/relax-stablehlo/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-stablehlo/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_frontend_stablehlo.py b/tests/python/relax-stablehlo/test_frontend_stablehlo.py similarity index 100% rename from tests/python/relax/test_frontend_stablehlo.py rename to tests/python/relax-stablehlo/test_frontend_stablehlo.py diff --git a/tests/python/relax-torch/conftest.py b/tests/python/relax-torch/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-torch/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_frontend_dynamo.py b/tests/python/relax-torch/test_frontend_dynamo.py similarity index 100% rename from tests/python/relax/test_frontend_dynamo.py rename to tests/python/relax-torch/test_frontend_dynamo.py diff --git a/tests/python/relax/test_frontend_from_fx.py b/tests/python/relax-torch/test_frontend_from_fx.py similarity index 100% rename from tests/python/relax/test_frontend_from_fx.py rename to tests/python/relax-torch/test_frontend_from_fx.py diff --git a/tests/python/relax-training/conftest.py b/tests/python/relax-training/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-training/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_training_append_loss.py b/tests/python/relax-training/test_training_append_loss.py similarity index 100% rename from tests/python/relax/test_training_append_loss.py rename to tests/python/relax-training/test_training_append_loss.py diff --git a/tests/python/relax/test_training_loss.py b/tests/python/relax-training/test_training_loss.py similarity index 100% rename from tests/python/relax/test_training_loss.py rename to tests/python/relax-training/test_training_loss.py diff --git a/tests/python/relax/test_training_optimizer.py b/tests/python/relax-training/test_training_optimizer.py similarity index 100% rename from tests/python/relax/test_training_optimizer.py rename to tests/python/relax-training/test_training_optimizer.py diff --git a/tests/python/relax/test_training_optimizer_numeric.py b/tests/python/relax-training/test_training_optimizer_numeric.py similarity index 100% rename from tests/python/relax/test_training_optimizer_numeric.py rename to tests/python/relax-training/test_training_optimizer_numeric.py diff --git a/tests/python/relax/test_training_setup_trainer.py b/tests/python/relax-training/test_training_setup_trainer.py similarity index 100% rename from tests/python/relax/test_training_setup_trainer.py rename to tests/python/relax-training/test_training_setup_trainer.py diff --git a/tests/python/relax/test_training_trainer_numeric.py b/tests/python/relax-training/test_training_trainer_numeric.py similarity index 100% rename from tests/python/relax/test_training_trainer_numeric.py rename to tests/python/relax-training/test_training_trainer_numeric.py diff --git a/tests/python/relax-tvmscript/conftest.py b/tests/python/relax-tvmscript/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-tvmscript/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_ast_printer.py b/tests/python/relax-tvmscript/test_ast_printer.py similarity index 100% rename from tests/python/relax/test_ast_printer.py rename to tests/python/relax-tvmscript/test_ast_printer.py diff --git a/tests/python/relax/test_tvmscript_ir_builder.py b/tests/python/relax-tvmscript/test_tvmscript_ir_builder.py similarity index 100% rename from tests/python/relax/test_tvmscript_ir_builder.py rename to tests/python/relax-tvmscript/test_tvmscript_ir_builder.py diff --git a/tests/python/relax/test_tvmscript_parser.py b/tests/python/relax-tvmscript/test_tvmscript_parser.py similarity index 100% rename from tests/python/relax/test_tvmscript_parser.py rename to tests/python/relax-tvmscript/test_tvmscript_parser.py diff --git a/tests/python/relax/test_tvmscript_printer_relax.py b/tests/python/relax-tvmscript/test_tvmscript_printer_relax.py similarity index 100% rename from tests/python/relax/test_tvmscript_printer_relax.py rename to tests/python/relax-tvmscript/test_tvmscript_printer_relax.py diff --git a/tests/python/relax-vm/conftest.py b/tests/python/relax-vm/conftest.py new file mode 100644 index 0000000000..f1b1187066 --- /dev/null +++ b/tests/python/relax-vm/conftest.py @@ -0,0 +1,23 @@ +# 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 + +import pytest + +import tvm +from tvm.relax.ir.instrument import WellFormedInstrument + + +tvm.transform.PassContext.current().override_instruments([WellFormedInstrument()]) diff --git a/tests/python/relax/test_pipeline.py b/tests/python/relax-vm/test_pipeline.py similarity index 100% rename from tests/python/relax/test_pipeline.py rename to tests/python/relax-vm/test_pipeline.py diff --git a/tests/python/relax/test_vm_alloc_storage_with_scope.py b/tests/python/relax-vm/test_vm_alloc_storage_with_scope.py similarity index 100% rename from tests/python/relax/test_vm_alloc_storage_with_scope.py rename to tests/python/relax-vm/test_vm_alloc_storage_with_scope.py diff --git a/tests/python/relax/test_vm_build.py b/tests/python/relax-vm/test_vm_build.py similarity index 100% rename from tests/python/relax/test_vm_build.py rename to tests/python/relax-vm/test_vm_build.py diff --git a/tests/python/relax/test_runtime_builtin.py b/tests/python/relax-vm/test_vm_builtin.py similarity index 100% rename from tests/python/relax/test_runtime_builtin.py rename to tests/python/relax-vm/test_vm_builtin.py diff --git a/tests/python/relax/test_vm_codegen_only.py b/tests/python/relax-vm/test_vm_codegen_only.py similarity index 100% rename from tests/python/relax/test_vm_codegen_only.py rename to tests/python/relax-vm/test_vm_codegen_only.py diff --git a/tests/python/relax/test_vm_codegen_tir.py b/tests/python/relax-vm/test_vm_codegen_tir.py similarity index 100% rename from tests/python/relax/test_vm_codegen_tir.py rename to tests/python/relax-vm/test_vm_codegen_tir.py diff --git a/tests/python/relax/test_vm_cuda_graph.py b/tests/python/relax-vm/test_vm_cuda_graph.py similarity index 100% rename from tests/python/relax/test_vm_cuda_graph.py rename to tests/python/relax-vm/test_vm_cuda_graph.py diff --git a/tests/python/relax/test_vm_execbuilder.py b/tests/python/relax-vm/test_vm_execbuilder.py similarity index 100% rename from tests/python/relax/test_vm_execbuilder.py rename to tests/python/relax-vm/test_vm_execbuilder.py diff --git a/tests/python/relax/test_vm_instrument.py b/tests/python/relax-vm/test_vm_instrument.py similarity index 100% rename from tests/python/relax/test_vm_instrument.py rename to tests/python/relax-vm/test_vm_instrument.py diff --git a/tests/python/relax/test_vm_profiler.py b/tests/python/relax-vm/test_vm_profiler.py similarity index 100% rename from tests/python/relax/test_vm_profiler.py rename to tests/python/relax-vm/test_vm_profiler.py diff --git a/tests/python/unittest/test_runtime_container.py b/tests/python/runtime/test_runtime_container.py similarity index 100% rename from tests/python/unittest/test_runtime_container.py rename to tests/python/runtime/test_runtime_container.py diff --git a/tests/python/unittest/test_runtime_dlpack.py b/tests/python/runtime/test_runtime_dlpack.py similarity index 100% rename from tests/python/unittest/test_runtime_dlpack.py rename to tests/python/runtime/test_runtime_dlpack.py diff --git a/tests/python/unittest/test_runtime_error.py b/tests/python/runtime/test_runtime_error.py similarity index 100% rename from tests/python/unittest/test_runtime_error.py rename to tests/python/runtime/test_runtime_error.py diff --git a/tests/python/unittest/test_runtime_extension.py b/tests/python/runtime/test_runtime_extension.py similarity index 100% rename from tests/python/unittest/test_runtime_extension.py rename to tests/python/runtime/test_runtime_extension.py diff --git a/tests/python/unittest/test_runtime_graph.py b/tests/python/runtime/test_runtime_graph.py similarity index 100% rename from tests/python/unittest/test_runtime_graph.py rename to tests/python/runtime/test_runtime_graph.py diff --git a/tests/python/unittest/test_runtime_graph_cuda_graph.py b/tests/python/runtime/test_runtime_graph_cuda_graph.py similarity index 100% rename from tests/python/unittest/test_runtime_graph_cuda_graph.py rename to tests/python/runtime/test_runtime_graph_cuda_graph.py diff --git a/tests/python/unittest/test_runtime_graph_debug.py b/tests/python/runtime/test_runtime_graph_debug.py similarity index 100% rename from tests/python/unittest/test_runtime_graph_debug.py rename to tests/python/runtime/test_runtime_graph_debug.py diff --git a/tests/python/unittest/test_runtime_heterogeneous.py b/tests/python/runtime/test_runtime_heterogeneous.py similarity index 100% rename from tests/python/unittest/test_runtime_heterogeneous.py rename to tests/python/runtime/test_runtime_heterogeneous.py diff --git a/tests/python/unittest/test_runtime_measure.py b/tests/python/runtime/test_runtime_measure.py similarity index 100% rename from tests/python/unittest/test_runtime_measure.py rename to tests/python/runtime/test_runtime_measure.py diff --git a/tests/python/unittest/test_runtime_module_based_interface.py b/tests/python/runtime/test_runtime_module_based_interface.py similarity index 100% rename from tests/python/unittest/test_runtime_module_based_interface.py rename to tests/python/runtime/test_runtime_module_based_interface.py diff --git a/tests/python/unittest/test_runtime_module_export.py b/tests/python/runtime/test_runtime_module_export.py similarity index 100% rename from tests/python/unittest/test_runtime_module_export.py rename to tests/python/runtime/test_runtime_module_export.py diff --git a/tests/python/unittest/test_runtime_module_load.py b/tests/python/runtime/test_runtime_module_load.py similarity index 100% rename from tests/python/unittest/test_runtime_module_load.py rename to tests/python/runtime/test_runtime_module_load.py diff --git a/tests/python/unittest/test_runtime_module_property.py b/tests/python/runtime/test_runtime_module_property.py similarity index 100% rename from tests/python/unittest/test_runtime_module_property.py rename to tests/python/runtime/test_runtime_module_property.py diff --git a/tests/python/unittest/test_runtime_profiling.py b/tests/python/runtime/test_runtime_profiling.py similarity index 100% rename from tests/python/unittest/test_runtime_profiling.py rename to tests/python/runtime/test_runtime_profiling.py diff --git a/tests/python/unittest/test_runtime_rpc.py b/tests/python/runtime/test_runtime_rpc.py similarity index 100% rename from tests/python/unittest/test_runtime_rpc.py rename to tests/python/runtime/test_runtime_rpc.py diff --git a/tests/python/unittest/test_runtime_trace.py b/tests/python/runtime/test_runtime_trace.py similarity index 100% rename from tests/python/unittest/test_runtime_trace.py rename to tests/python/runtime/test_runtime_trace.py diff --git a/tests/python/unittest/test_runtime_vm_profiler.py b/tests/python/runtime/test_runtime_vm_profiler.py similarity index 100% rename from tests/python/unittest/test_runtime_vm_profiler.py rename to tests/python/runtime/test_runtime_vm_profiler.py diff --git a/tests/python/unittest/test_tir_analysis_calculate_allocated_memory.py b/tests/python/tir-pass/test_tir_analysis_calculate_allocated_memory.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_calculate_allocated_memory.py rename to tests/python/tir-pass/test_tir_analysis_calculate_allocated_memory.py diff --git a/tests/python/unittest/test_tir_analysis_calculate_workspace.py b/tests/python/tir-pass/test_tir_analysis_calculate_workspace.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_calculate_workspace.py rename to tests/python/tir-pass/test_tir_analysis_calculate_workspace.py diff --git a/tests/python/unittest/test_tir_analysis_detect_buffer_access_lca.py b/tests/python/tir-pass/test_tir_analysis_detect_buffer_access_lca.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_detect_buffer_access_lca.py rename to tests/python/tir-pass/test_tir_analysis_detect_buffer_access_lca.py diff --git a/tests/python/unittest/test_tir_analysis_estimate_tir_flops.py b/tests/python/tir-pass/test_tir_analysis_estimate_tir_flops.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_estimate_tir_flops.py rename to tests/python/tir-pass/test_tir_analysis_estimate_tir_flops.py diff --git a/tests/python/unittest/test_tir_analysis_expr_deep_equal.py b/tests/python/tir-pass/test_tir_analysis_expr_deep_equal.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_expr_deep_equal.py rename to tests/python/tir-pass/test_tir_analysis_expr_deep_equal.py diff --git a/tests/python/unittest/test_tir_analysis_get_block_access_region.py b/tests/python/tir-pass/test_tir_analysis_get_block_access_region.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_get_block_access_region.py rename to tests/python/tir-pass/test_tir_analysis_get_block_access_region.py diff --git a/tests/python/unittest/test_tir_analysis_identify_memcpy.py b/tests/python/tir-pass/test_tir_analysis_identify_memcpy.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_identify_memcpy.py rename to tests/python/tir-pass/test_tir_analysis_identify_memcpy.py diff --git a/tests/python/unittest/test_tir_analysis_oob.py b/tests/python/tir-pass/test_tir_analysis_oob.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_oob.py rename to tests/python/tir-pass/test_tir_analysis_oob.py diff --git a/tests/python/unittest/test_tir_analysis_stmt_finding.py b/tests/python/tir-pass/test_tir_analysis_stmt_finding.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_stmt_finding.py rename to tests/python/tir-pass/test_tir_analysis_stmt_finding.py diff --git a/tests/python/unittest/test_tir_analysis_usedef.py b/tests/python/tir-pass/test_tir_analysis_usedef.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_usedef.py rename to tests/python/tir-pass/test_tir_analysis_usedef.py diff --git a/tests/python/unittest/test_tir_analysis_verify_gpu_code.py b/tests/python/tir-pass/test_tir_analysis_verify_gpu_code.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_verify_gpu_code.py rename to tests/python/tir-pass/test_tir_analysis_verify_gpu_code.py diff --git a/tests/python/unittest/test_tir_analysis_verify_memory.py b/tests/python/tir-pass/test_tir_analysis_verify_memory.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_verify_memory.py rename to tests/python/tir-pass/test_tir_analysis_verify_memory.py diff --git a/tests/python/unittest/test_tir_analysis_verify_ssa.py b/tests/python/tir-pass/test_tir_analysis_verify_ssa.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_verify_ssa.py rename to tests/python/tir-pass/test_tir_analysis_verify_ssa.py diff --git a/tests/python/unittest/test_tir_analysis_verify_well_formed.py b/tests/python/tir-pass/test_tir_analysis_verify_well_formed.py similarity index 100% rename from tests/python/unittest/test_tir_analysis_verify_well_formed.py rename to tests/python/tir-pass/test_tir_analysis_verify_well_formed.py diff --git a/tests/python/unittest/test_tir_transform_annotate_device_regions.py b/tests/python/tir-pass/test_tir_transform_annotate_device_regions.py similarity index 100% rename from tests/python/unittest/test_tir_transform_annotate_device_regions.py rename to tests/python/tir-pass/test_tir_transform_annotate_device_regions.py diff --git a/tests/python/unittest/test_tir_transform_bf16_legalize.py b/tests/python/tir-pass/test_tir_transform_bf16_legalize.py similarity index 100% rename from tests/python/unittest/test_tir_transform_bf16_legalize.py rename to tests/python/tir-pass/test_tir_transform_bf16_legalize.py diff --git a/tests/python/unittest/test_tir_transform_combine_context_call.py b/tests/python/tir-pass/test_tir_transform_combine_context_call.py similarity index 100% rename from tests/python/unittest/test_tir_transform_combine_context_call.py rename to tests/python/tir-pass/test_tir_transform_combine_context_call.py diff --git a/tests/python/unittest/test_tir_transform_common_subexpr_elim.py b/tests/python/tir-pass/test_tir_transform_common_subexpr_elim.py similarity index 100% rename from tests/python/unittest/test_tir_transform_common_subexpr_elim.py rename to tests/python/tir-pass/test_tir_transform_common_subexpr_elim.py diff --git a/tests/python/unittest/test_tir_transform_compact_buffer_region.py b/tests/python/tir-pass/test_tir_transform_compact_buffer_region.py similarity index 100% rename from tests/python/unittest/test_tir_transform_compact_buffer_region.py rename to tests/python/tir-pass/test_tir_transform_compact_buffer_region.py diff --git a/tests/python/unittest/test_tir_transform_convert_blocks_to_opaque.py b/tests/python/tir-pass/test_tir_transform_convert_blocks_to_opaque.py similarity index 100% rename from tests/python/unittest/test_tir_transform_convert_blocks_to_opaque.py rename to tests/python/tir-pass/test_tir_transform_convert_blocks_to_opaque.py diff --git a/tests/python/unittest/test_tir_transform_convert_for_loops_serial.py b/tests/python/tir-pass/test_tir_transform_convert_for_loops_serial.py similarity index 100% rename from tests/python/unittest/test_tir_transform_convert_for_loops_serial.py rename to tests/python/tir-pass/test_tir_transform_convert_for_loops_serial.py diff --git a/tests/python/unittest/test_tir_transform_convert_ssa.py b/tests/python/tir-pass/test_tir_transform_convert_ssa.py similarity index 100% rename from tests/python/unittest/test_tir_transform_convert_ssa.py rename to tests/python/tir-pass/test_tir_transform_convert_ssa.py diff --git a/tests/python/unittest/test_tir_transform_coproc_sync.py b/tests/python/tir-pass/test_tir_transform_coproc_sync.py similarity index 100% rename from tests/python/unittest/test_tir_transform_coproc_sync.py rename to tests/python/tir-pass/test_tir_transform_coproc_sync.py diff --git a/tests/python/unittest/test_tir_transform_decorate_device_scope.py b/tests/python/tir-pass/test_tir_transform_decorate_device_scope.py similarity index 100% rename from tests/python/unittest/test_tir_transform_decorate_device_scope.py rename to tests/python/tir-pass/test_tir_transform_decorate_device_scope.py diff --git a/tests/python/unittest/test_transform_default_gpu_schedule.py b/tests/python/tir-pass/test_tir_transform_default_gpu_schedule.py similarity index 100% rename from tests/python/unittest/test_transform_default_gpu_schedule.py rename to tests/python/tir-pass/test_tir_transform_default_gpu_schedule.py diff --git a/tests/python/unittest/test_tir_transform_device_kernel_launch.py b/tests/python/tir-pass/test_tir_transform_device_kernel_launch.py similarity index 100% rename from tests/python/unittest/test_tir_transform_device_kernel_launch.py rename to tests/python/tir-pass/test_tir_transform_device_kernel_launch.py diff --git a/tests/python/unittest/test_tir_transform_extract_constants.py b/tests/python/tir-pass/test_tir_transform_extract_constants.py similarity index 100% rename from tests/python/unittest/test_tir_transform_extract_constants.py rename to tests/python/tir-pass/test_tir_transform_extract_constants.py diff --git a/tests/python/unittest/test_tir_transform_flatten_buffer.py b/tests/python/tir-pass/test_tir_transform_flatten_buffer.py similarity index 100% rename from tests/python/unittest/test_tir_transform_flatten_buffer.py rename to tests/python/tir-pass/test_tir_transform_flatten_buffer.py diff --git a/tests/python/unittest/test_tir_transform_force_narrow_index_to_i32.py b/tests/python/tir-pass/test_tir_transform_force_narrow_index_to_i32.py similarity index 100% rename from tests/python/unittest/test_tir_transform_force_narrow_index_to_i32.py rename to tests/python/tir-pass/test_tir_transform_force_narrow_index_to_i32.py diff --git a/tests/python/unittest/test_tir_transform_fp8_legalize.py b/tests/python/tir-pass/test_tir_transform_fp8_legalize.py similarity index 100% rename from tests/python/unittest/test_tir_transform_fp8_legalize.py rename to tests/python/tir-pass/test_tir_transform_fp8_legalize.py diff --git a/tests/python/unittest/test_tir_transform_helpers.py b/tests/python/tir-pass/test_tir_transform_helpers.py similarity index 100% rename from tests/python/unittest/test_tir_transform_helpers.py rename to tests/python/tir-pass/test_tir_transform_helpers.py diff --git a/tests/python/unittest/test_tir_transform_hoist_expression.py b/tests/python/tir-pass/test_tir_transform_hoist_expression.py similarity index 100% rename from tests/python/unittest/test_tir_transform_hoist_expression.py rename to tests/python/tir-pass/test_tir_transform_hoist_expression.py diff --git a/tests/python/unittest/test_tir_transform_hoist_if.py b/tests/python/tir-pass/test_tir_transform_hoist_if.py similarity index 100% rename from tests/python/unittest/test_tir_transform_hoist_if.py rename to tests/python/tir-pass/test_tir_transform_hoist_if.py diff --git a/tests/python/unittest/test_tir_transform_inject_copy_intrin.py b/tests/python/tir-pass/test_tir_transform_inject_copy_intrin.py similarity index 100% rename from tests/python/unittest/test_tir_transform_inject_copy_intrin.py rename to tests/python/tir-pass/test_tir_transform_inject_copy_intrin.py diff --git a/tests/python/unittest/test_tir_transform_inject_double_buffer.py b/tests/python/tir-pass/test_tir_transform_inject_double_buffer.py similarity index 100% rename from tests/python/unittest/test_tir_transform_inject_double_buffer.py rename to tests/python/tir-pass/test_tir_transform_inject_double_buffer.py diff --git a/tests/python/unittest/test_tir_transform_inject_ptx_async_copy.py b/tests/python/tir-pass/test_tir_transform_inject_ptx_async_copy.py similarity index 100% rename from tests/python/unittest/test_tir_transform_inject_ptx_async_copy.py rename to tests/python/tir-pass/test_tir_transform_inject_ptx_async_copy.py diff --git a/tests/python/unittest/test_tir_transform_inject_software_pipeline.py b/tests/python/tir-pass/test_tir_transform_inject_software_pipeline.py similarity index 100% rename from tests/python/unittest/test_tir_transform_inject_software_pipeline.py rename to tests/python/tir-pass/test_tir_transform_inject_software_pipeline.py diff --git a/tests/python/unittest/test_tir_transform_inject_virtual_thread.py b/tests/python/tir-pass/test_tir_transform_inject_virtual_thread.py similarity index 100% rename from tests/python/unittest/test_tir_transform_inject_virtual_thread.py rename to tests/python/tir-pass/test_tir_transform_inject_virtual_thread.py diff --git a/tests/python/unittest/test_tir_transform_instrument_bound_checkers.py b/tests/python/tir-pass/test_tir_transform_instrument_bound_checkers.py similarity index 100% rename from tests/python/unittest/test_tir_transform_instrument_bound_checkers.py rename to tests/python/tir-pass/test_tir_transform_instrument_bound_checkers.py diff --git a/tests/python/unittest/test_tir_transform_lift_attr_scope.py b/tests/python/tir-pass/test_tir_transform_lift_attr_scope.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lift_attr_scope.py rename to tests/python/tir-pass/test_tir_transform_lift_attr_scope.py diff --git a/tests/python/unittest/test_tir_transform_lift_thread_binding.py b/tests/python/tir-pass/test_tir_transform_lift_thread_binding.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lift_thread_binding.py rename to tests/python/tir-pass/test_tir_transform_lift_thread_binding.py diff --git a/tests/python/unittest/test_tir_transform_loop_partition.py b/tests/python/tir-pass/test_tir_transform_loop_partition.py similarity index 100% rename from tests/python/unittest/test_tir_transform_loop_partition.py rename to tests/python/tir-pass/test_tir_transform_loop_partition.py diff --git a/tests/python/unittest/test_tir_transform_lower_cross_thread_reduction.py b/tests/python/tir-pass/test_tir_transform_lower_cross_thread_reduction.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_cross_thread_reduction.py rename to tests/python/tir-pass/test_tir_transform_lower_cross_thread_reduction.py diff --git a/tests/python/unittest/test_tir_transform_lower_device_storage_access_info.py b/tests/python/tir-pass/test_tir_transform_lower_device_storage_access_info.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_device_storage_access_info.py rename to tests/python/tir-pass/test_tir_transform_lower_device_storage_access_info.py diff --git a/tests/python/unittest/test_tir_transform_lower_init_block.py b/tests/python/tir-pass/test_tir_transform_lower_init_block.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_init_block.py rename to tests/python/tir-pass/test_tir_transform_lower_init_block.py diff --git a/tests/python/unittest/test_tir_transform_lower_intrin.py b/tests/python/tir-pass/test_tir_transform_lower_intrin.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_intrin.py rename to tests/python/tir-pass/test_tir_transform_lower_intrin.py diff --git a/tests/python/unittest/test_tir_transform_lower_opaque_block.py b/tests/python/tir-pass/test_tir_transform_lower_opaque_block.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_opaque_block.py rename to tests/python/tir-pass/test_tir_transform_lower_opaque_block.py diff --git a/tests/python/unittest/test_tir_transform_lower_thread_all_reduce.py b/tests/python/tir-pass/test_tir_transform_lower_thread_all_reduce.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_thread_all_reduce.py rename to tests/python/tir-pass/test_tir_transform_lower_thread_all_reduce.py diff --git a/tests/python/unittest/test_tir_transform_lower_tvm_builtin.py b/tests/python/tir-pass/test_tir_transform_lower_tvm_builtin.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_tvm_builtin.py rename to tests/python/tir-pass/test_tir_transform_lower_tvm_builtin.py diff --git a/tests/python/unittest/test_tir_transform_lower_warp_memory.py b/tests/python/tir-pass/test_tir_transform_lower_warp_memory.py similarity index 100% rename from tests/python/unittest/test_tir_transform_lower_warp_memory.py rename to tests/python/tir-pass/test_tir_transform_lower_warp_memory.py diff --git a/tests/python/unittest/test_tir_transform_make_packed_api.py b/tests/python/tir-pass/test_tir_transform_make_packed_api.py similarity index 100% rename from tests/python/unittest/test_tir_transform_make_packed_api.py rename to tests/python/tir-pass/test_tir_transform_make_packed_api.py diff --git a/tests/python/unittest/test_tir_transform_make_unpacked_api.py b/tests/python/tir-pass/test_tir_transform_make_unpacked_api.py similarity index 100% rename from tests/python/unittest/test_tir_transform_make_unpacked_api.py rename to tests/python/tir-pass/test_tir_transform_make_unpacked_api.py diff --git a/tests/python/unittest/test_tir_transform_manifest_shared_memory_local_stage.py b/tests/python/tir-pass/test_tir_transform_manifest_shared_memory_local_stage.py similarity index 100% rename from tests/python/unittest/test_tir_transform_manifest_shared_memory_local_stage.py rename to tests/python/tir-pass/test_tir_transform_manifest_shared_memory_local_stage.py diff --git a/tests/python/unittest/test_tir_transform_memhammer_lower_auto_copy.py b/tests/python/tir-pass/test_tir_transform_memhammer_lower_auto_copy.py similarity index 100% rename from tests/python/unittest/test_tir_transform_memhammer_lower_auto_copy.py rename to tests/python/tir-pass/test_tir_transform_memhammer_lower_auto_copy.py diff --git a/tests/python/unittest/test_tir_transform_merge_dynamic_shared_memory_allocations.py b/tests/python/tir-pass/test_tir_transform_merge_dynamic_shared_memory_allocations.py similarity index 100% rename from tests/python/unittest/test_tir_transform_merge_dynamic_shared_memory_allocations.py rename to tests/python/tir-pass/test_tir_transform_merge_dynamic_shared_memory_allocations.py diff --git a/tests/python/unittest/test_tir_transform_narrow_datatype.py b/tests/python/tir-pass/test_tir_transform_narrow_datatype.py similarity index 100% rename from tests/python/unittest/test_tir_transform_narrow_datatype.py rename to tests/python/tir-pass/test_tir_transform_narrow_datatype.py diff --git a/tests/python/unittest/test_tir_transform_plan_update_buffer_allocation_location.py b/tests/python/tir-pass/test_tir_transform_plan_update_buffer_allocation_location.py similarity index 100% rename from tests/python/unittest/test_tir_transform_plan_update_buffer_allocation_location.py rename to tests/python/tir-pass/test_tir_transform_plan_update_buffer_allocation_location.py diff --git a/tests/python/unittest/test_tir_transform_pointer_value_type_rewrite.py b/tests/python/tir-pass/test_tir_transform_pointer_value_type_rewrite.py similarity index 100% rename from tests/python/unittest/test_tir_transform_pointer_value_type_rewrite.py rename to tests/python/tir-pass/test_tir_transform_pointer_value_type_rewrite.py diff --git a/tests/python/unittest/test_tir_transform_prim_func_pass.py b/tests/python/tir-pass/test_tir_transform_prim_func_pass.py similarity index 100% rename from tests/python/unittest/test_tir_transform_prim_func_pass.py rename to tests/python/tir-pass/test_tir_transform_prim_func_pass.py diff --git a/tests/python/unittest/test_tir_transform_profiling_instr.py b/tests/python/tir-pass/test_tir_transform_profiling_instr.py similarity index 100% rename from tests/python/unittest/test_tir_transform_profiling_instr.py rename to tests/python/tir-pass/test_tir_transform_profiling_instr.py diff --git a/tests/python/unittest/test_tir_transform_reduce_branching_through_overcompute.py b/tests/python/tir-pass/test_tir_transform_reduce_branching_through_overcompute.py similarity index 100% rename from tests/python/unittest/test_tir_transform_reduce_branching_through_overcompute.py rename to tests/python/tir-pass/test_tir_transform_reduce_branching_through_overcompute.py diff --git a/tests/python/unittest/test_tir_transform_remove_assume.py b/tests/python/tir-pass/test_tir_transform_remove_assume.py similarity index 100% rename from tests/python/unittest/test_tir_transform_remove_assume.py rename to tests/python/tir-pass/test_tir_transform_remove_assume.py diff --git a/tests/python/unittest/test_tir_transform_remove_no_op.py b/tests/python/tir-pass/test_tir_transform_remove_no_op.py similarity index 100% rename from tests/python/unittest/test_tir_transform_remove_no_op.py rename to tests/python/tir-pass/test_tir_transform_remove_no_op.py diff --git a/tests/python/unittest/test_tir_transform_remove_undef.py b/tests/python/tir-pass/test_tir_transform_remove_undef.py similarity index 100% rename from tests/python/unittest/test_tir_transform_remove_undef.py rename to tests/python/tir-pass/test_tir_transform_remove_undef.py diff --git a/tests/python/unittest/test_tir_transform_remove_weight_layout_rewrite_block.py b/tests/python/tir-pass/test_tir_transform_remove_weight_layout_rewrite_block.py similarity index 100% rename from tests/python/unittest/test_tir_transform_remove_weight_layout_rewrite_block.py rename to tests/python/tir-pass/test_tir_transform_remove_weight_layout_rewrite_block.py diff --git a/tests/python/unittest/test_tir_transform_renormalize_split_pattern.py b/tests/python/tir-pass/test_tir_transform_renormalize_split_pattern.py similarity index 100% rename from tests/python/unittest/test_tir_transform_renormalize_split_pattern.py rename to tests/python/tir-pass/test_tir_transform_renormalize_split_pattern.py diff --git a/tests/python/unittest/test_tir_transform_rewrite_unsafe_select.py b/tests/python/tir-pass/test_tir_transform_rewrite_unsafe_select.py similarity index 100% rename from tests/python/unittest/test_tir_transform_rewrite_unsafe_select.py rename to tests/python/tir-pass/test_tir_transform_rewrite_unsafe_select.py diff --git a/tests/python/unittest/test_tir_transform_simplify.py b/tests/python/tir-pass/test_tir_transform_simplify.py similarity index 100% rename from tests/python/unittest/test_tir_transform_simplify.py rename to tests/python/tir-pass/test_tir_transform_simplify.py diff --git a/tests/python/unittest/test_tir_transform_split_host_device.py b/tests/python/tir-pass/test_tir_transform_split_host_device.py similarity index 100% rename from tests/python/unittest/test_tir_transform_split_host_device.py rename to tests/python/tir-pass/test_tir_transform_split_host_device.py diff --git a/tests/python/unittest/test_tir_transform_storage_flatten.py b/tests/python/tir-pass/test_tir_transform_storage_flatten.py similarity index 100% rename from tests/python/unittest/test_tir_transform_storage_flatten.py rename to tests/python/tir-pass/test_tir_transform_storage_flatten.py diff --git a/tests/python/unittest/test_tir_transform_storage_rewrite.py b/tests/python/tir-pass/test_tir_transform_storage_rewrite.py similarity index 100% rename from tests/python/unittest/test_tir_transform_storage_rewrite.py rename to tests/python/tir-pass/test_tir_transform_storage_rewrite.py diff --git a/tests/python/unittest/test_tir_transform_thread_sync.py b/tests/python/tir-pass/test_tir_transform_thread_sync.py similarity index 100% rename from tests/python/unittest/test_tir_transform_thread_sync.py rename to tests/python/tir-pass/test_tir_transform_thread_sync.py diff --git a/tests/python/unittest/test_tir_transform_unify_thread_binding.py b/tests/python/tir-pass/test_tir_transform_unify_thread_binding.py similarity index 100% rename from tests/python/unittest/test_tir_transform_unify_thread_binding.py rename to tests/python/tir-pass/test_tir_transform_unify_thread_binding.py diff --git a/tests/python/unittest/test_tir_transform_unroll_loop.py b/tests/python/tir-pass/test_tir_transform_unroll_loop.py similarity index 100% rename from tests/python/unittest/test_tir_transform_unroll_loop.py rename to tests/python/tir-pass/test_tir_transform_unroll_loop.py diff --git a/tests/python/unittest/test_tir_transform_vectorize.py b/tests/python/tir-pass/test_tir_transform_vectorize.py similarity index 100% rename from tests/python/unittest/test_tir_transform_vectorize.py rename to tests/python/tir-pass/test_tir_transform_vectorize.py diff --git a/tests/python/unittest/test_tir_schedule_analysis.py b/tests/python/tir-schedule/test_tir_schedule_analysis.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_analysis.py rename to tests/python/tir-schedule/test_tir_schedule_analysis.py diff --git a/tests/python/unittest/test_tir_schedule_block_scope.py b/tests/python/tir-schedule/test_tir_schedule_block_scope.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_block_scope.py rename to tests/python/tir-schedule/test_tir_schedule_block_scope.py diff --git a/tests/python/unittest/test_tir_schedule_blockize.py b/tests/python/tir-schedule/test_tir_schedule_blockize.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_blockize.py rename to tests/python/tir-schedule/test_tir_schedule_blockize.py diff --git a/tests/python/unittest/test_tir_schedule_cache_index.py b/tests/python/tir-schedule/test_tir_schedule_cache_index.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_cache_index.py rename to tests/python/tir-schedule/test_tir_schedule_cache_index.py diff --git a/tests/python/unittest/test_tir_schedule_cache_read_write.py b/tests/python/tir-schedule/test_tir_schedule_cache_read_write.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_cache_read_write.py rename to tests/python/tir-schedule/test_tir_schedule_cache_read_write.py diff --git a/tests/python/unittest/test_tir_schedule_compute_at.py b/tests/python/tir-schedule/test_tir_schedule_compute_at.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_compute_at.py rename to tests/python/tir-schedule/test_tir_schedule_compute_at.py diff --git a/tests/python/unittest/test_tir_schedule_compute_inline.py b/tests/python/tir-schedule/test_tir_schedule_compute_inline.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_compute_inline.py rename to tests/python/tir-schedule/test_tir_schedule_compute_inline.py diff --git a/tests/python/unittest/test_tir_schedule_decompose_padding.py b/tests/python/tir-schedule/test_tir_schedule_decompose_padding.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_decompose_padding.py rename to tests/python/tir-schedule/test_tir_schedule_decompose_padding.py diff --git a/tests/python/unittest/test_tir_schedule_error.py b/tests/python/tir-schedule/test_tir_schedule_error.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_error.py rename to tests/python/tir-schedule/test_tir_schedule_error.py diff --git a/tests/python/unittest/test_tir_schedule_for_kind.py b/tests/python/tir-schedule/test_tir_schedule_for_kind.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_for_kind.py rename to tests/python/tir-schedule/test_tir_schedule_for_kind.py diff --git a/tests/python/unittest/test_tir_schedule_instruction.py b/tests/python/tir-schedule/test_tir_schedule_instruction.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_instruction.py rename to tests/python/tir-schedule/test_tir_schedule_instruction.py diff --git a/tests/python/unittest/test_tir_schedule_merge.py b/tests/python/tir-schedule/test_tir_schedule_merge.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_merge.py rename to tests/python/tir-schedule/test_tir_schedule_merge.py diff --git a/tests/python/unittest/test_tir_schedule_pad_einsum.py b/tests/python/tir-schedule/test_tir_schedule_pad_einsum.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_pad_einsum.py rename to tests/python/tir-schedule/test_tir_schedule_pad_einsum.py diff --git a/tests/python/unittest/test_tir_schedule_read_write_at.py b/tests/python/tir-schedule/test_tir_schedule_read_write_at.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_read_write_at.py rename to tests/python/tir-schedule/test_tir_schedule_read_write_at.py diff --git a/tests/python/unittest/test_tir_schedule_reduction.py b/tests/python/tir-schedule/test_tir_schedule_reduction.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_reduction.py rename to tests/python/tir-schedule/test_tir_schedule_reduction.py diff --git a/tests/python/unittest/test_tir_schedule_reindex.py b/tests/python/tir-schedule/test_tir_schedule_reindex.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_reindex.py rename to tests/python/tir-schedule/test_tir_schedule_reindex.py diff --git a/tests/python/unittest/test_tir_schedule_reorder.py b/tests/python/tir-schedule/test_tir_schedule_reorder.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_reorder.py rename to tests/python/tir-schedule/test_tir_schedule_reorder.py diff --git a/tests/python/unittest/test_tir_schedule_rfactor.py b/tests/python/tir-schedule/test_tir_schedule_rfactor.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_rfactor.py rename to tests/python/tir-schedule/test_tir_schedule_rfactor.py diff --git a/tests/python/unittest/test_tir_schedule_rolling_buffer.py b/tests/python/tir-schedule/test_tir_schedule_rolling_buffer.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_rolling_buffer.py rename to tests/python/tir-schedule/test_tir_schedule_rolling_buffer.py diff --git a/tests/python/unittest/test_tir_schedule_sampling.py b/tests/python/tir-schedule/test_tir_schedule_sampling.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_sampling.py rename to tests/python/tir-schedule/test_tir_schedule_sampling.py diff --git a/tests/python/unittest/test_tir_schedule_set_axis_separator.py b/tests/python/tir-schedule/test_tir_schedule_set_axis_separator.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_set_axis_separator.py rename to tests/python/tir-schedule/test_tir_schedule_set_axis_separator.py diff --git a/tests/python/unittest/test_tir_schedule_set_dtype.py b/tests/python/tir-schedule/test_tir_schedule_set_dtype.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_set_dtype.py rename to tests/python/tir-schedule/test_tir_schedule_set_dtype.py diff --git a/tests/python/unittest/test_tir_schedule_set_scope.py b/tests/python/tir-schedule/test_tir_schedule_set_scope.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_set_scope.py rename to tests/python/tir-schedule/test_tir_schedule_set_scope.py diff --git a/tests/python/unittest/test_tir_schedule_split_fuse.py b/tests/python/tir-schedule/test_tir_schedule_split_fuse.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_split_fuse.py rename to tests/python/tir-schedule/test_tir_schedule_split_fuse.py diff --git a/tests/python/unittest/test_tir_schedule_state.py b/tests/python/tir-schedule/test_tir_schedule_state.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_state.py rename to tests/python/tir-schedule/test_tir_schedule_state.py diff --git a/tests/python/unittest/test_tir_schedule_state_cached_flags.py b/tests/python/tir-schedule/test_tir_schedule_state_cached_flags.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_state_cached_flags.py rename to tests/python/tir-schedule/test_tir_schedule_state_cached_flags.py diff --git a/tests/python/unittest/test_tir_schedule_storage_align.py b/tests/python/tir-schedule/test_tir_schedule_storage_align.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_storage_align.py rename to tests/python/tir-schedule/test_tir_schedule_storage_align.py diff --git a/tests/python/unittest/test_tir_schedule_tensorize.py b/tests/python/tir-schedule/test_tir_schedule_tensorize.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_tensorize.py rename to tests/python/tir-schedule/test_tir_schedule_tensorize.py diff --git a/tests/python/unittest/test_tir_schedule_tensorize_ldmatrix_mma.py b/tests/python/tir-schedule/test_tir_schedule_tensorize_ldmatrix_mma.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_tensorize_ldmatrix_mma.py rename to tests/python/tir-schedule/test_tir_schedule_tensorize_ldmatrix_mma.py diff --git a/tests/python/unittest/test_tir_schedule_tensorize_mfma.py b/tests/python/tir-schedule/test_tir_schedule_tensorize_mfma.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_tensorize_mfma.py rename to tests/python/tir-schedule/test_tir_schedule_tensorize_mfma.py diff --git a/tests/python/unittest/test_tir_schedule_trace.py b/tests/python/tir-schedule/test_tir_schedule_trace.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_trace.py rename to tests/python/tir-schedule/test_tir_schedule_trace.py diff --git a/tests/python/unittest/test_tir_schedule_transform.py b/tests/python/tir-schedule/test_tir_schedule_transform.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_transform.py rename to tests/python/tir-schedule/test_tir_schedule_transform.py diff --git a/tests/python/unittest/test_tir_schedule_transform_layout.py b/tests/python/tir-schedule/test_tir_schedule_transform_layout.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_transform_layout.py rename to tests/python/tir-schedule/test_tir_schedule_transform_layout.py diff --git a/tests/python/unittest/test_tir_schedule_utilities.py b/tests/python/tir-schedule/test_tir_schedule_utilities.py similarity index 100% rename from tests/python/unittest/test_tir_schedule_utilities.py rename to tests/python/tir-schedule/test_tir_schedule_utilities.py diff --git a/tests/python/unittest/test_tvmscript_complete.py b/tests/python/tir-tvmscript/test_tvmscript_complete.py similarity index 100% rename from tests/python/unittest/test_tvmscript_complete.py rename to tests/python/tir-tvmscript/test_tvmscript_complete.py diff --git a/tests/python/unittest/test_tvmscript_error_report.py b/tests/python/tir-tvmscript/test_tvmscript_error_report.py similarity index 100% rename from tests/python/unittest/test_tvmscript_error_report.py rename to tests/python/tir-tvmscript/test_tvmscript_error_report.py diff --git a/tests/python/unittest/test_tvmscript_ir_builder_base.py b/tests/python/tir-tvmscript/test_tvmscript_ir_builder_base.py similarity index 100% rename from tests/python/unittest/test_tvmscript_ir_builder_base.py rename to tests/python/tir-tvmscript/test_tvmscript_ir_builder_base.py diff --git a/tests/python/unittest/test_tvmscript_ir_builder_irmodule.py b/tests/python/tir-tvmscript/test_tvmscript_ir_builder_irmodule.py similarity index 100% rename from tests/python/unittest/test_tvmscript_ir_builder_irmodule.py rename to tests/python/tir-tvmscript/test_tvmscript_ir_builder_irmodule.py diff --git a/tests/python/unittest/test_tvmscript_ir_builder_tir.py b/tests/python/tir-tvmscript/test_tvmscript_ir_builder_tir.py similarity index 100% rename from tests/python/unittest/test_tvmscript_ir_builder_tir.py rename to tests/python/tir-tvmscript/test_tvmscript_ir_builder_tir.py diff --git a/tests/python/unittest/test_tvmscript_meta_programming.py b/tests/python/tir-tvmscript/test_tvmscript_meta_programming.py similarity index 100% rename from tests/python/unittest/test_tvmscript_meta_programming.py rename to tests/python/tir-tvmscript/test_tvmscript_meta_programming.py diff --git a/tests/python/unittest/test_tvmscript_ops.py b/tests/python/tir-tvmscript/test_tvmscript_ops.py similarity index 100% rename from tests/python/unittest/test_tvmscript_ops.py rename to tests/python/tir-tvmscript/test_tvmscript_ops.py diff --git a/tests/python/unittest/test_tvmscript_parser_evaluator.py b/tests/python/tir-tvmscript/test_tvmscript_parser_evaluator.py similarity index 100% rename from tests/python/unittest/test_tvmscript_parser_evaluator.py rename to tests/python/tir-tvmscript/test_tvmscript_parser_evaluator.py diff --git a/tests/python/unittest/test_tvmscript_parser_ir.py b/tests/python/tir-tvmscript/test_tvmscript_parser_ir.py similarity index 100% rename from tests/python/unittest/test_tvmscript_parser_ir.py rename to tests/python/tir-tvmscript/test_tvmscript_parser_ir.py diff --git a/tests/python/unittest/test_tvmscript_parser_source.py b/tests/python/tir-tvmscript/test_tvmscript_parser_source.py similarity index 100% rename from tests/python/unittest/test_tvmscript_parser_source.py rename to tests/python/tir-tvmscript/test_tvmscript_parser_source.py diff --git a/tests/python/unittest/test_tvmscript_parser_tir.py b/tests/python/tir-tvmscript/test_tvmscript_parser_tir.py similarity index 100% rename from tests/python/unittest/test_tvmscript_parser_tir.py rename to tests/python/tir-tvmscript/test_tvmscript_parser_tir.py diff --git a/tests/python/unittest/test_tvmscript_printer_annotation.py b/tests/python/tir-tvmscript/test_tvmscript_printer_annotation.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_annotation.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_annotation.py diff --git a/tests/python/unittest/test_tvmscript_printer_doc.py b/tests/python/tir-tvmscript/test_tvmscript_printer_doc.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_doc.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_doc.py diff --git a/tests/python/unittest/test_tvmscript_printer_highlight.py b/tests/python/tir-tvmscript/test_tvmscript_printer_highlight.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_highlight.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_highlight.py diff --git a/tests/python/unittest/test_tvmscript_printer_ir.py b/tests/python/tir-tvmscript/test_tvmscript_printer_ir.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_ir.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_ir.py diff --git a/tests/python/unittest/test_tvmscript_printer_metadata.py b/tests/python/tir-tvmscript/test_tvmscript_printer_metadata.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_metadata.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_metadata.py diff --git a/tests/python/unittest/test_tvmscript_printer_python_doc_printer.py b/tests/python/tir-tvmscript/test_tvmscript_printer_python_doc_printer.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_python_doc_printer.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_python_doc_printer.py diff --git a/tests/python/unittest/test_tvmscript_printer_structural_equal.py b/tests/python/tir-tvmscript/test_tvmscript_printer_structural_equal.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_structural_equal.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_structural_equal.py diff --git a/tests/python/unittest/test_tvmscript_printer_tir.py b/tests/python/tir-tvmscript/test_tvmscript_printer_tir.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_tir.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_tir.py diff --git a/tests/python/unittest/test_tvmscript_printer_underlining.py b/tests/python/tir-tvmscript/test_tvmscript_printer_underlining.py similarity index 100% rename from tests/python/unittest/test_tvmscript_printer_underlining.py rename to tests/python/tir-tvmscript/test_tvmscript_printer_underlining.py diff --git a/tests/python/unittest/test_tvmscript_regression.py b/tests/python/tir-tvmscript/test_tvmscript_regression.py similarity index 100% rename from tests/python/unittest/test_tvmscript_regression.py rename to tests/python/tir-tvmscript/test_tvmscript_regression.py diff --git a/tests/python/unittest/test_tvmscript_roundtrip.py b/tests/python/tir-tvmscript/test_tvmscript_roundtrip.py similarity index 100% rename from tests/python/unittest/test_tvmscript_roundtrip.py rename to tests/python/tir-tvmscript/test_tvmscript_roundtrip.py diff --git a/tests/python/unittest/test_tvmscript_syntax_sugar.py b/tests/python/tir-tvmscript/test_tvmscript_syntax_sugar.py similarity index 100% rename from tests/python/unittest/test_tvmscript_syntax_sugar.py rename to tests/python/tir-tvmscript/test_tvmscript_syntax_sugar.py diff --git a/tests/python/unittest/test_tvmscript_type.py b/tests/python/tir-tvmscript/test_tvmscript_type.py similarity index 100% rename from tests/python/unittest/test_tvmscript_type.py rename to tests/python/tir-tvmscript/test_tvmscript_type.py diff --git a/tests/python/unittest/test_tir_usmp_algo.py b/tests/python/tir-usmp/test_tir_usmp_algo.py similarity index 100% rename from tests/python/unittest/test_tir_usmp_algo.py rename to tests/python/tir-usmp/test_tir_usmp_algo.py diff --git a/tests/python/unittest/test_tir_usmp_algo_hill_climb.py b/tests/python/tir-usmp/test_tir_usmp_algo_hill_climb.py similarity index 100% rename from tests/python/unittest/test_tir_usmp_algo_hill_climb.py rename to tests/python/tir-usmp/test_tir_usmp_algo_hill_climb.py diff --git a/tests/python/unittest/test_tir_usmp_analysis_extract_bufferinfo.py b/tests/python/tir-usmp/test_tir_usmp_analysis_extract_bufferinfo.py similarity index 100% rename from tests/python/unittest/test_tir_usmp_analysis_extract_bufferinfo.py rename to tests/python/tir-usmp/test_tir_usmp_analysis_extract_bufferinfo.py diff --git a/tests/python/unittest/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py b/tests/python/tir-usmp/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py similarity index 100% rename from tests/python/unittest/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py rename to tests/python/tir-usmp/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py diff --git a/tests/python/unittest/test_tir_usmp_transform_create_io_allocates.py b/tests/python/tir-usmp/test_tir_usmp_transform_create_io_allocates.py similarity index 100% rename from tests/python/unittest/test_tir_usmp_transform_create_io_allocates.py rename to tests/python/tir-usmp/test_tir_usmp_transform_create_io_allocates.py diff --git a/tests/python/unittest/test_tir_usmp_utils.py b/tests/python/tir-usmp/test_tir_usmp_utils.py similarity index 100% rename from tests/python/unittest/test_tir_usmp_utils.py rename to tests/python/tir-usmp/test_tir_usmp_utils.py diff --git a/tests/python/target/test_arm_target.py b/tests/python/unittest/test_arm_target.py similarity index 100% rename from tests/python/target/test_arm_target.py rename to tests/python/unittest/test_arm_target.py diff --git a/tests/python/tir/analysis/test_device_constraint_utils.py b/tests/python/unittest/test_device_constraint_utils.py similarity index 100% rename from tests/python/tir/analysis/test_device_constraint_utils.py rename to tests/python/unittest/test_device_constraint_utils.py diff --git a/tests/python/target/test_virtual_device.py b/tests/python/unittest/test_virtual_device.py similarity index 100% rename from tests/python/target/test_virtual_device.py rename to tests/python/unittest/test_virtual_device.py diff --git a/tests/scripts/mlc/task_mlc_build.sh b/tests/scripts/mlc/task_mlc_build.sh new file mode 100755 index 0000000000..556e5abbff --- /dev/null +++ b/tests/scripts/mlc/task_mlc_build.sh @@ -0,0 +1,23 @@ +#!/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. +set -euxo pipefail + +BUILD_THREADS="${BUILD_THREADS:-1}" + +cd build +make -j $BUILD_THREADS diff --git a/tests/scripts/mlc/task_mlc_cmake.sh b/tests/scripts/mlc/task_mlc_cmake.sh new file mode 100755 index 0000000000..32e88bb105 --- /dev/null +++ b/tests/scripts/mlc/task_mlc_cmake.sh @@ -0,0 +1,21 @@ +#!/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. +set -euxo pipefail + +cd build +cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. diff --git a/tests/scripts/task_mypy.sh b/tests/scripts/task_mypy.sh index c3e5d50b3e..31bfca4af3 100755 --- a/tests/scripts/task_mypy.sh +++ b/tests/scripts/task_mypy.sh @@ -21,22 +21,19 @@ set -euxo pipefail source tests/scripts/setup-pytest-env.sh echo "Checking MyPy Type defs in the TensorIR schedule package." -mypy --check-untyped-defs python/tvm/tir/schedule +mypy --check-untyped-defs python/tvm/tir/schedule echo "Checking MyPy Type defs in the meta schedule package." -mypy --check-untyped-defs python/tvm/meta_schedule +mypy --check-untyped-defs python/tvm/meta_schedule echo "Checking MyPy Type defs in the analysis package." -mypy --check-untyped-defs python/tvm/tir/analysis/ +mypy --check-untyped-defs python/tvm/tir/analysis/ echo "Checking MyPy Type defs in the transform package." -mypy --check-untyped-defs python/tvm/tir/transform/ +mypy --check-untyped-defs python/tvm/tir/transform/ echo "Checking MyPy Type defs in the tvmscript printer package." -mypy --check-untyped-defs python/tvm/script/printer - -echo "Checking MyPy Type defs in the TIR package with unittest" -MYPYPATH=$TVM_PATH/python mypy --check-untyped-defs tests/python/unittest/test_tvmscript_type.py +mypy --check-untyped-defs python/tvm/script/printer echo "Checking MyPy Type defs in tvm.relay.op.contrib" mypy --disallow-untyped-defs python/tvm/relay/op/contrib/cublas.py @@ -44,9 +41,5 @@ mypy --disallow-untyped-defs python/tvm/relay/op/contrib/cudnn.py mypy --disallow-untyped-defs python/tvm/relay/op/contrib/te_target.py mypy --disallow-untyped-defs python/tvm/relay/op/contrib/tensorrt.py -#TODO(@mikepapadim): This is failing atm -# echo "Checking MyPy Type defs in the tvm.relay.backend.contrib.ethosu package." -# mypy --check-untyped-defs python/tvm/relay/backend/contrib/ethosu/ - echo "Checking MyPy Type defs in the tvmscript IRBuilder package." -mypy --check-untyped-defs python/tvm/script/ir_builder +mypy --check-untyped-defs python/tvm/script/ir_builder diff --git a/tests/scripts/unity/task_python_relax.sh b/tests/scripts/unity/task_python_relax.sh index 121ba1389a..14d2880eec 100755 --- a/tests/scripts/unity/task_python_relax.sh +++ b/tests/scripts/unity/task_python_relax.sh @@ -15,7 +15,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - set -euxo pipefail source tests/scripts/setup-pytest-env.sh @@ -29,13 +28,6 @@ export TVM_NUM_THREADS=2 make cython3 # Run Relax tests -TVM_TEST_TARGETS="${TVM_RELAY_TEST_TARGETS:-llvm}" pytest tests/python/relax -TVM_TEST_TARGETS="${TVM_RELAY_TEST_TARGETS:-llvm}" pytest tests/python/dlight - -# Run Relax examples -# python3 ./apps/relax_examples/mlp.py -# python3 ./apps/relax_examples/nn_module.py -# python3 ./apps/relax_examples/resnet.py - -# Test for MSC -pytest tests/python/contrib/test_msc +export TEST_DIRECTORY=$1 +python3 -m pip install pytest-durations +python3 -m pytest -vv --durations 0 tests/python/${TEST_DIRECTORY}/