From d0c61dca454270cf6585202f6f45d7b69619fc88 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Tue, 3 Nov 2020 16:40:58 +0800 Subject: [PATCH 01/13] [Draft] Unit test check for layout rewrite --- .../test_auto_scheduler_layout_rewrite.py | 29 ++++++++++++++----- tests/scripts/task_python_unittest.sh | 1 + 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 9e4f1bf27735..6328f22efe19 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -20,8 +20,10 @@ import numpy as np import pytest +import random import tvm +import tvm.testing from tvm import topi from tvm import auto_scheduler, te @@ -56,6 +58,10 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag + seed = random.randint(0, 10000000) + print(seed) + random.seed(seed) + with tempfile.NamedTemporaryFile() as fp: log_file = fp.name @@ -114,8 +120,8 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): func_ref(*args_ref) ctx.sync() - tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), rtol=1e-4) - tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), rtol=1e-4) + tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy()) + tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy()) del measure_ctx @@ -127,6 +133,10 @@ def test_correctness_layout_rewrite_insert_transform_stage(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag + seed = random.randint(0, 10000000) + print(seed) + random.seed(seed) + with tempfile.NamedTemporaryFile() as fp: log_file = fp.name @@ -162,14 +172,19 @@ def test_correctness_layout_rewrite_insert_transform_stage(): func_ref(*args_ref) ctx.sync() - tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), rtol=1e-4) - tvm.testing.assert_allclose(args[1].asnumpy(), args_ref[1].asnumpy(), rtol=1e-4) - tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), rtol=1e-4) + tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy()) + tvm.testing.assert_allclose(args[1].asnumpy(), args_ref[1].asnumpy()) + tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy()) del measure_ctx +def ffff(): + for i in range(10): + test_correctness_layout_rewrite_rewrite_for_preTransformed() + test_correctness_layout_rewrite_insert_transform_stage() + if __name__ == "__main__": - test_apply_steps_with_layout_rewrite() - # Disable for now due to being flaky on i386 + # test_apply_steps_with_layout_rewrite() # test_correctness_layout_rewrite_rewrite_for_preTransformed() # test_correctness_layout_rewrite_insert_transform_stage() + ffff() diff --git a/tests/scripts/task_python_unittest.sh b/tests/scripts/task_python_unittest.sh index 0aaf9fc86664..98ad0e7b6c9c 100755 --- a/tests/scripts/task_python_unittest.sh +++ b/tests/scripts/task_python_unittest.sh @@ -27,5 +27,6 @@ make cython3 TVM_FFI=ctypes python3 -m pytest tests/python/all-platform-minimal-test TVM_FFI=cython python3 -m pytest tests/python/all-platform-minimal-test +python3 tests/python/unittest/test_auto_scheduler_layout_rewrite.py TVM_FFI=ctypes python3 -m pytest tests/python/unittest TVM_FFI=cython python3 -m pytest tests/python/unittest From 68ec5e1166b97be3cfbda462737c2358e4f30143 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Tue, 3 Nov 2020 16:47:59 +0800 Subject: [PATCH 02/13] [Draft] Disable unused tests --- tests/scripts/task_lint.sh | 32 +++--- tests/scripts/task_python_frontend.sh | 32 +++--- tests/scripts/task_python_frontend_cpu.sh | 16 +-- tests/scripts/task_python_vta_tsim.sh | 30 +++--- tests/scripts/task_rust.sh | 126 +++++++++++----------- 5 files changed, 118 insertions(+), 118 deletions(-) diff --git a/tests/scripts/task_lint.sh b/tests/scripts/task_lint.sh index deb9b9bde6c1..30ab7fc984f7 100755 --- a/tests/scripts/task_lint.sh +++ b/tests/scripts/task_lint.sh @@ -27,26 +27,26 @@ cleanup() trap cleanup 0 -echo "Checking file types..." -python3 tests/lint/check_file_type.py +# echo "Checking file types..." +# python3 tests/lint/check_file_type.py -echo "Checking ASF license headers..." -tests/lint/check_asf_header.sh +# echo "Checking ASF license headers..." +# tests/lint/check_asf_header.sh -echo "Linting the C++ code..." -tests/lint/cpplint.sh +# echo "Linting the C++ code..." +# tests/lint/cpplint.sh -echo "clang-format check..." -tests/lint/clang_format.sh +# echo "clang-format check..." +# tests/lint/clang_format.sh -echo "black check..." -tests/lint/python_format.sh +# echo "black check..." +# tests/lint/python_format.sh -echo "Linting the Python code..." -tests/lint/pylint.sh +# echo "Linting the Python code..." +# tests/lint/pylint.sh -echo "Lintinf the JNI code..." -tests/lint/jnilint.sh +# echo "Lintinf the JNI code..." +# tests/lint/jnilint.sh -echo "Checking C++ documentation..." -tests/lint/cppdocs.sh +# echo "Checking C++ documentation..." +# tests/lint/cppdocs.sh diff --git a/tests/scripts/task_python_frontend.sh b/tests/scripts/task_python_frontend.sh index 3c5839bc7e1c..d065dbbc4441 100755 --- a/tests/scripts/task_python_frontend.sh +++ b/tests/scripts/task_python_frontend.sh @@ -28,26 +28,26 @@ export TVM_TEST_TARGETS="llvm;cuda" find . -type f -path "*.pyc" | xargs rm -f -# Rebuild cython -make cython3 +# # Rebuild cython +# make cython3 -echo "Running relay MXNet frontend test..." -python3 -m pytest tests/python/frontend/mxnet +# echo "Running relay MXNet frontend test..." +# python3 -m pytest tests/python/frontend/mxnet -echo "Running relay ONNX frontend test..." -python3 -m pytest tests/python/frontend/onnx +# echo "Running relay ONNX frontend test..." +# python3 -m pytest tests/python/frontend/onnx -echo "Running relay CoreML frontend test..." -python3 -m pytest tests/python/frontend/coreml +# echo "Running relay CoreML frontend test..." +# python3 -m pytest tests/python/frontend/coreml -echo "Running relay Tensorflow frontend test..." -python3 -m pytest tests/python/frontend/tensorflow +# echo "Running relay Tensorflow frontend test..." +# python3 -m pytest tests/python/frontend/tensorflow -echo "Running relay caffe2 frontend test..." -python3 -m pytest tests/python/frontend/caffe2 +# echo "Running relay caffe2 frontend test..." +# python3 -m pytest tests/python/frontend/caffe2 -echo "Running relay DarkNet frontend test..." -python3 -m pytest tests/python/frontend/darknet +# echo "Running relay DarkNet frontend test..." +# python3 -m pytest tests/python/frontend/darknet -echo "Running relay PyTorch frontend test..." -python3 -m pytest tests/python/frontend/pytorch +# echo "Running relay PyTorch frontend test..." +# python3 -m pytest tests/python/frontend/pytorch diff --git a/tests/scripts/task_python_frontend_cpu.sh b/tests/scripts/task_python_frontend_cpu.sh index 6dfcabc2cd37..ec75558228cc 100755 --- a/tests/scripts/task_python_frontend_cpu.sh +++ b/tests/scripts/task_python_frontend_cpu.sh @@ -29,14 +29,14 @@ export TVM_TEST_TARGETS="llvm" find . -type f -path "*.pyc" | xargs rm -f -# Rebuild cython -make cython3 +# # Rebuild cython +# make cython3 -echo "Running relay TFLite frontend test..." -python3 -m pytest tests/python/frontend/tflite +# echo "Running relay TFLite frontend test..." +# python3 -m pytest tests/python/frontend/tflite -echo "Running relay Keras frontend test..." -python3 -m pytest tests/python/frontend/keras +# echo "Running relay Keras frontend test..." +# python3 -m pytest tests/python/frontend/keras -echo "Running relay Caffe frontend test..." -python3 -m pytest tests/python/frontend/caffe +# echo "Running relay Caffe frontend test..." +# python3 -m pytest tests/python/frontend/caffe diff --git a/tests/scripts/task_python_vta_tsim.sh b/tests/scripts/task_python_vta_tsim.sh index c87d5483b8a5..982861f5d9db 100755 --- a/tests/scripts/task_python_vta_tsim.sh +++ b/tests/scripts/task_python_vta_tsim.sh @@ -44,22 +44,22 @@ cp ${VTA_HW_PATH}/config/tsim_sample.json ${VTA_HW_PATH}/config/vta_config.json # make -C ${VTA_HW_PATH}/apps/tsim_example/ run_chisel # make -C ${VTA_HW_PATH}/apps/gemm/ default -# Check style of scala code -echo "Check style of scala code..." -make -C ${VTA_HW_PATH}/hardware/chisel lint +# # Check style of scala code +# echo "Check style of scala code..." +# make -C ${VTA_HW_PATH}/hardware/chisel lint -# Build VTA chisel design and verilator simulator -echo "Building VTA chisel design..." -make -C ${VTA_HW_PATH}/hardware/chisel cleanall -make -C ${VTA_HW_PATH}/hardware/chisel USE_THREADS=0 lib +# # Build VTA chisel design and verilator simulator +# echo "Building VTA chisel design..." +# make -C ${VTA_HW_PATH}/hardware/chisel cleanall +# make -C ${VTA_HW_PATH}/hardware/chisel USE_THREADS=0 lib -# Run unit tests in cycle accurate simulator -echo "Running unittest in tsim..." -python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest +# # Run unit tests in cycle accurate simulator +# echo "Running unittest in tsim..." +# python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest -# Run unit tests in cycle accurate simulator -echo "Running integration test in tsim..." -python3 -m pytest ${TVM_PATH}/vta/tests/python/integration +# # Run unit tests in cycle accurate simulator +# echo "Running integration test in tsim..." +# python3 -m pytest ${TVM_PATH}/vta/tests/python/integration -# Reset default fsim simulation -cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json +# # Reset default fsim simulation +# cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json diff --git a/tests/scripts/task_rust.sh b/tests/scripts/task_rust.sh index d60999c3f3d0..264672912a0e 100755 --- a/tests/scripts/task_rust.sh +++ b/tests/scripts/task_rust.sh @@ -38,78 +38,78 @@ echo "Using LLVM_CONFIG_PATH=$LLVM_CONFIG_PATH" export TVM_BIND_THREADS=0 export OMP_NUM_THREADS=1 -cd $RUST_DIR -cargo fmt -- --check +# cd $RUST_DIR +# cargo fmt -- --check -# First we test tvm-sys the core Rust bindings. -cd $RUST_DIR/tvm-sys -# First we test w/o the bindings feature on. -cargo build -cargo test --tests +# # First we test tvm-sys the core Rust bindings. +# cd $RUST_DIR/tvm-sys +# # First we test w/o the bindings feature on. +# cargo build +# cargo test --tests + +# # Second we test w/ the bindings feature on. +# cargo build --features bindings +# cargo test --features bindings --tests + +# # Next we test the runtime API. +# cd $RUST_DIR/tvm-rt + +# # Build and run the tests. +# cargo build +# cargo test --tests + +# # Next we test the graph runtime crate. +# cd $RUST_DIR/tvm-graph-rt -# Second we test w/ the bindings feature on. -cargo build --features bindings -cargo test --features bindings --tests +# # We first we compile a model using the Python bindings then run the tests. +# python3 tests/build_model.py +# cargo test --tests -# Next we test the runtime API. -cd $RUST_DIR/tvm-rt +# # Run some more tests involving the graph runtime API. +# cd tests/test_tvm_basic +# cargo run +# cd - + +# cd tests/test_tvm_dso +# cargo run +# cd - -# Build and run the tests. -cargo build -cargo test --tests +# # # run wasm32 test +# # cd tests/test_wasm32 +# # cargo build +# # wasmtime $RUST_DIR/target/wasm32-wasi/debug/test-wasm32.wasm +# # cd - -# Next we test the graph runtime crate. -cd $RUST_DIR/tvm-graph-rt +# # run nn graph test +# cd tests/test_nn +# cargo run +# cd - -# We first we compile a model using the Python bindings then run the tests. -python3 tests/build_model.py -cargo test --tests +# # Finally we test the TVM crate which provides both runtime +# # and compiler bindings. +# cd $RUST_DIR/tvm -# Run some more tests involving the graph runtime API. -cd tests/test_tvm_basic -cargo run -cd - +# cargo test --tests -- --test-threads=1 -cd tests/test_tvm_dso -cargo run -cd - +# # run basic tests on cpu +# cd tests/basics +# cargo build --features cpu +# cargo run --features cpu +# # uncomment when have more CI resources +# # cargo build --features gpu +# # cargo run --features gpu +# # fi +# cd - -# # run wasm32 test -# cd tests/test_wasm32 +# # run callback tests separately: https://discuss.tvm.ai/t/are-global-functions-need-to-be-accessed-in-separate-processes/1075 +# cd tests/callback # cargo build -# wasmtime $RUST_DIR/target/wasm32-wasi/debug/test-wasm32.wasm +# cargo run --bin int +# cargo run --bin float +# cargo run --bin array +# cargo run --bin string # cd - -# run nn graph test -cd tests/test_nn -cargo run -cd - - -# Finally we test the TVM crate which provides both runtime -# and compiler bindings. -cd $RUST_DIR/tvm - -cargo test --tests -- --test-threads=1 - -# run basic tests on cpu -cd tests/basics -cargo build --features cpu -cargo run --features cpu -# uncomment when have more CI resources -# cargo build --features gpu -# cargo run --features gpu -# fi -cd - - -# run callback tests separately: https://discuss.tvm.ai/t/are-global-functions-need-to-be-accessed-in-separate-processes/1075 -cd tests/callback -cargo build -cargo run --bin int -cargo run --bin float -cargo run --bin array -cargo run --bin string -cd - - -cd examples/resnet -cargo run -cd - +# cd examples/resnet +# cargo run +# cd - From b71e67f95e82f47fc3fb53375ff3e567546f3772 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Tue, 3 Nov 2020 17:59:13 +0800 Subject: [PATCH 03/13] [Draft] Disable more tests --- .../test_auto_scheduler_layout_rewrite.py | 14 ++-- tests/scripts/task_cpp_unittest.sh | 36 +++++----- tests/scripts/task_python_integration.sh | 70 +++++++++---------- tests/scripts/task_python_microtvm.sh | 12 ++-- tests/scripts/task_python_vta_fsim.sh | 16 ++--- tests/scripts/task_sphinx_precheck.sh | 42 +++++------ tests/scripts/task_web_wasm.sh | 24 +++---- 7 files changed, 107 insertions(+), 107 deletions(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 6328f22efe19..5cd42b4e9378 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -58,7 +58,7 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - seed = random.randint(0, 10000000) + seed = 1286272 # random.randint(0, 10000000) print(seed) random.seed(seed) @@ -79,7 +79,9 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.RewriteForPreTransformed ) + print(tvm.lower(s, bufs, simple_mode=True)) s_ref, bufs_ref = dag.apply_steps_from_state(inp.state) + print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] np_args_ref = [np.array(x) for x in np_args] @@ -133,7 +135,7 @@ def test_correctness_layout_rewrite_insert_transform_stage(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - seed = random.randint(0, 10000000) + seed = 1286272 # random.randint(0, 10000000) print(seed) random.seed(seed) @@ -155,7 +157,9 @@ def test_correctness_layout_rewrite_insert_transform_stage(): inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.InsertTransformStage ) + print(tvm.lower(s, bufs, simple_mode=True)) s_ref, bufs_ref = dag.apply_steps_from_state(inp.state) + print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] func = tvm.build(s, bufs, target=target) @@ -185,6 +189,6 @@ def ffff(): if __name__ == "__main__": # test_apply_steps_with_layout_rewrite() - # test_correctness_layout_rewrite_rewrite_for_preTransformed() - # test_correctness_layout_rewrite_insert_transform_stage() - ffff() + test_correctness_layout_rewrite_rewrite_for_preTransformed() + test_correctness_layout_rewrite_insert_transform_stage() + # ffff() diff --git a/tests/scripts/task_cpp_unittest.sh b/tests/scripts/task_cpp_unittest.sh index 7905755b8813..e86d8921aadd 100755 --- a/tests/scripts/task_cpp_unittest.sh +++ b/tests/scripts/task_cpp_unittest.sh @@ -22,25 +22,25 @@ set -u # Python is required by apps/bundle_deploy source tests/scripts/setup-pytest-env.sh -export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}" -# NOTE: important to use abspath, when VTA is enabled. -export VTA_HW_PATH=`pwd`/3rdparty/vta-hw +# export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}" +# # NOTE: important to use abspath, when VTA is enabled. +# export VTA_HW_PATH=`pwd`/3rdparty/vta-hw -# to avoid CI thread throttling. -export TVM_BIND_THREADS=0 -export OMP_NUM_THREADS=1 +# # to avoid CI thread throttling. +# export TVM_BIND_THREADS=0 +# export OMP_NUM_THREADS=1 -# Remove existing testcases -rm -f build/*_test +# # Remove existing testcases +# rm -f build/*_test -make cpptest -j2 -make crttest # NOTE: don't parallelize, due to issue with build deps. -for test in build/*_test; do - ./$test -done +# make cpptest -j2 +# make crttest # NOTE: don't parallelize, due to issue with build deps. +# for test in build/*_test; do +# ./$test +# done -# Test MISRA-C runtime -cd apps/bundle_deploy -rm -rf build -make test_dynamic test_static -cd ../.. +# # Test MISRA-C runtime +# cd apps/bundle_deploy +# rm -rf build +# make test_dynamic test_static +# cd ../.. diff --git a/tests/scripts/task_python_integration.sh b/tests/scripts/task_python_integration.sh index ef86d6917424..ea6dab2295bc 100755 --- a/tests/scripts/task_python_integration.sh +++ b/tests/scripts/task_python_integration.sh @@ -19,49 +19,49 @@ set -e set -u -source tests/scripts/setup-pytest-env.sh -export PYTHONPATH=${PYTHONPATH}:${TVM_PATH}/apps/extension/python -export LD_LIBRARY_PATH="build:${LD_LIBRARY_PATH:-}" +# source tests/scripts/setup-pytest-env.sh +# export PYTHONPATH=${PYTHONPATH}:${TVM_PATH}/apps/extension/python +# export LD_LIBRARY_PATH="build:${LD_LIBRARY_PATH:-}" -# to avoid CI CPU thread throttling. -export TVM_BIND_THREADS=0 -export TVM_NUM_THREADS=2 +# # to avoid CI CPU thread throttling. +# export TVM_BIND_THREADS=0 +# export TVM_NUM_THREADS=2 -# cleanup pycache -find . -type f -path "*.pyc" | xargs rm -f +# # cleanup pycache +# find . -type f -path "*.pyc" | xargs rm -f -# Test TVM -make cython3 +# # Test TVM +# make cython3 -# Test extern package -cd apps/extension -rm -rf lib -make -cd ../.. +# # Test extern package +# cd apps/extension +# rm -rf lib +# make +# cd ../.. -TVM_FFI=cython python3 -m pytest apps/extension/tests -TVM_FFI=ctypes python3 -m pytest apps/extension/tests +# TVM_FFI=cython python3 -m pytest apps/extension/tests +# TVM_FFI=ctypes python3 -m pytest apps/extension/tests -# Test dso plugin -cd apps/dso_plugin_module -rm -rf lib -make -cd ../.. -TVM_FFI=cython python3 -m pytest apps/dso_plugin_module -TVM_FFI=ctypes python3 -m pytest apps/dso_plugin_module +# # Test dso plugin +# cd apps/dso_plugin_module +# rm -rf lib +# make +# cd ../.. +# TVM_FFI=cython python3 -m pytest apps/dso_plugin_module +# TVM_FFI=ctypes python3 -m pytest apps/dso_plugin_module -# Do not enable TensorFlow op -# TVM_FFI=cython sh prepare_and_test_tfop_module.sh -# TVM_FFI=ctypes sh prepare_and_test_tfop_module.sh +# # Do not enable TensorFlow op +# # TVM_FFI=cython sh prepare_and_test_tfop_module.sh +# # TVM_FFI=ctypes sh prepare_and_test_tfop_module.sh -TVM_FFI=ctypes python3 -m pytest tests/python/integration -TVM_FFI=ctypes python3 -m pytest tests/python/contrib +# TVM_FFI=ctypes python3 -m pytest tests/python/integration +# TVM_FFI=ctypes python3 -m pytest tests/python/contrib -TVM_TEST_TARGETS="${TVM_RELAY_TEST_TARGETS:-llvm;cuda}" TVM_FFI=ctypes python3 -m pytest tests/python/relay +# TVM_TEST_TARGETS="${TVM_RELAY_TEST_TARGETS:-llvm;cuda}" TVM_FFI=ctypes python3 -m pytest tests/python/relay -# Command line driver test -TVM_FFI=ctypes python3 -m pytest tests/python/driver +# # Command line driver test +# TVM_FFI=ctypes python3 -m pytest tests/python/driver -# Do not enable OpenGL -# TVM_FFI=cython python -m pytest tests/webgl -# TVM_FFI=ctypes python3 -m pytest tests/webgl +# # Do not enable OpenGL +# # TVM_FFI=cython python -m pytest tests/webgl +# # TVM_FFI=ctypes python3 -m pytest tests/webgl diff --git a/tests/scripts/task_python_microtvm.sh b/tests/scripts/task_python_microtvm.sh index 7fb8d471a53a..f6944a007b55 100755 --- a/tests/scripts/task_python_microtvm.sh +++ b/tests/scripts/task_python_microtvm.sh @@ -19,11 +19,11 @@ set -e set -u -source tests/scripts/setup-pytest-env.sh +# source tests/scripts/setup-pytest-env.sh -# cleanup pycache -find . -type f -path "*.pyc" | xargs rm -f +# # cleanup pycache +# find . -type f -path "*.pyc" | xargs rm -f -TVM_FFI=ctypes python3 -m pytest tests/micro/qemu -make cython3 -TVM_FFI=cython python3 -m pytest tests/micro/qemu +# TVM_FFI=ctypes python3 -m pytest tests/micro/qemu +# make cython3 +# TVM_FFI=cython python3 -m pytest tests/micro/qemu diff --git a/tests/scripts/task_python_vta_fsim.sh b/tests/scripts/task_python_vta_fsim.sh index 8080bbe756c7..2a1504dfaac8 100755 --- a/tests/scripts/task_python_vta_fsim.sh +++ b/tests/scripts/task_python_vta_fsim.sh @@ -35,13 +35,13 @@ rm -rf ~/.tvm # Rebuild cython make cython3 -# Reset default fsim simulation -cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json +# # Reset default fsim simulation +# cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json -# Run unit tests in functional/fast simulator -echo "Running unittest in fsim..." -python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest +# # Run unit tests in functional/fast simulator +# echo "Running unittest in fsim..." +# python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest -# Run unit tests in functional/fast simulator -echo "Running integration test in fsim..." -python3 -m pytest ${TVM_PATH}/vta/tests/python/integration +# # Run unit tests in functional/fast simulator +# echo "Running integration test in fsim..." +# python3 -m pytest ${TVM_PATH}/vta/tests/python/integration diff --git a/tests/scripts/task_sphinx_precheck.sh b/tests/scripts/task_sphinx_precheck.sh index 08184d9ff333..c5eceb26fe20 100755 --- a/tests/scripts/task_sphinx_precheck.sh +++ b/tests/scripts/task_sphinx_precheck.sh @@ -27,28 +27,24 @@ cleanup() } trap cleanup 0 -# cleanup cache -rm -rf docs/tutorials -rm -rf docs/vta/tutorials -find . -type f -path "*.pyc" | xargs rm -f -make cython3 +# # cleanup cache +# rm -rf docs/tutorials +# rm -rf docs/vta/tutorials +# find . -type f -path "*.pyc" | xargs rm -f +# make cython3 -# install theme addon for to local if does not exists -# avoid docker for now before we stablize on the choice of style -python3 -m pip install --user --upgrade -q tlcpack-sphinx-addon==0.1.0 +# echo "PreCheck sphinx doc generation WARNINGS.." +# cd docs +# make clean +# TVM_TUTORIAL_EXEC_PATTERN=none make html |& tee /tmp/$$.log.txt -echo "PreCheck sphinx doc generation WARNINGS.." -cd docs -make clean -TVM_TUTORIAL_EXEC_PATTERN=none make html |& tee /tmp/$$.log.txt - -grep -v -E "__mro__|UserWarning|FutureWarning|tensorflow|Keras|pytorch|TensorFlow|403" < /tmp/$$.log.txt > /tmp/$$.logclean.txt || true -echo "---------Sphinx Log----------" -cat /tmp/$$.logclean.txt -echo "-----------------------------" -if grep --quiet -E "WARN" < /tmp/$$.logclean.txt; then - echo "WARNINIG found in the log, please fix them." - echo "You can reproduce locally by running ./tests/scripts/task_sphinx_precheck.sh" - exit 1 -fi -echo "No WARNINGS to be fixed." +# grep -v -E "__mro__|UserWarning|FutureWarning|tensorflow|Keras|pytorch|TensorFlow|403" < /tmp/$$.log.txt > /tmp/$$.logclean.txt || true +# echo "---------Sphinx Log----------" +# cat /tmp/$$.logclean.txt +# echo "-----------------------------" +# if grep --quiet -E "WARN" < /tmp/$$.logclean.txt; then +# echo "WARNINIG found in the log, please fix them." +# echo "You can reproduce locally by running ./tests/scripts/task_sphinx_precheck.sh" +# exit 1 +# fi +# echo "No WARNINGS to be fixed." diff --git a/tests/scripts/task_web_wasm.sh b/tests/scripts/task_web_wasm.sh index c117bb08c6f4..72b30198ae09 100755 --- a/tests/scripts/task_web_wasm.sh +++ b/tests/scripts/task_web_wasm.sh @@ -17,17 +17,17 @@ # under the License. set -e -set -u +# set -u -export PYTHONPATH=`pwd`/python +# export PYTHONPATH=`pwd`/python -rm -rf .emscripten_cache -cd web -make clean -npm install -npm run lint -npm run prepwasm -npm run bundle -npm run test -npm run typedoc -cd .. +# rm -rf .emscripten_cache +# cd web +# make clean +# npm install +# npm run lint +# npm run prepwasm +# npm run bundle +# npm run test +# npm run typedoc +# cd .. From 777ee30dd6c8fa7304c147c949cc2918d1c5602d Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Tue, 3 Nov 2020 18:55:40 +0800 Subject: [PATCH 04/13] [Draft] update --- tests/python/unittest/test_auto_scheduler_layout_rewrite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 5cd42b4e9378..c2bba6ff0825 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -58,7 +58,7 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - seed = 1286272 # random.randint(0, 10000000) + seed = 8749744 # random.randint(0, 10000000) print(seed) random.seed(seed) @@ -135,7 +135,7 @@ def test_correctness_layout_rewrite_insert_transform_stage(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - seed = 1286272 # random.randint(0, 10000000) + seed = 8749744 # random.randint(0, 10000000) print(seed) random.seed(seed) From 5c516227e9483ff67457e55357fa6a3f25ce7cf1 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Tue, 3 Nov 2020 19:40:10 +0800 Subject: [PATCH 05/13] [Draft] --- tests/python/unittest/test_auto_scheduler_layout_rewrite.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index c2bba6ff0825..5a55bf9dea87 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -27,6 +27,8 @@ from tvm import topi from tvm import auto_scheduler, te +import os + from test_auto_scheduler_common import get_tiled_matmul, matmul_auto_scheduler_test @@ -75,6 +77,8 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): measure_callbacks=[auto_scheduler.RecordToFile(log_file)], ) auto_scheduler.auto_schedule(task, search_policy, tuning_options) + cmd = "cat %s" % (log_file) + os.system(cmd) inp, _ = auto_scheduler.load_best(log_file, task.workload_key, target) s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.RewriteForPreTransformed @@ -152,6 +156,8 @@ def test_correctness_layout_rewrite_insert_transform_stage(): measure_callbacks=[auto_scheduler.RecordToFile(log_file)], ) auto_scheduler.auto_schedule(task, search_policy, tuning_options) + cmd = "cat %s" % (log_file) + os.system(cmd) inp, _ = auto_scheduler.load_best(log_file, task.workload_key, target) s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.InsertTransformStage From a532d28720e074680826d48681f12485e77257d0 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Tue, 3 Nov 2020 20:34:59 +0800 Subject: [PATCH 06/13] Update llvm version for i386 --- tests/scripts/task_config_build_i386.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/task_config_build_i386.sh b/tests/scripts/task_config_build_i386.sh index 8ed5f94e30dc..65f5d6359dac 100755 --- a/tests/scripts/task_config_build_i386.sh +++ b/tests/scripts/task_config_build_i386.sh @@ -29,7 +29,7 @@ echo set\(USE_GRAPH_RUNTIME_DEBUG ON\) >> config.cmake echo set\(USE_MICRO ON\) >> config.cmake echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake echo set\(USE_VM_PROFILER ON\) >> config.cmake -echo set\(USE_LLVM llvm-config-4.0\) >> config.cmake +echo set\(USE_LLVM llvm-config-8\) >> config.cmake echo set\(CMAKE_CXX_COMPILER g++\) >> config.cmake echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake echo set\(USE_VTA_TSIM ON\) >> config.cmake From c4c95c42278196a8c6077703921b198a2afbb6fb Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Tue, 3 Nov 2020 20:54:15 +0800 Subject: [PATCH 07/13] [Draft] update --- tests/python/unittest/test_auto_scheduler_layout_rewrite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 5a55bf9dea87..3f9f02e9e128 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -197,4 +197,4 @@ def ffff(): # test_apply_steps_with_layout_rewrite() test_correctness_layout_rewrite_rewrite_for_preTransformed() test_correctness_layout_rewrite_insert_transform_stage() - # ffff() + ffff() From 56b6e39d527525b807dabc464b438b368926d0ba Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Wed, 4 Nov 2020 10:09:59 +0800 Subject: [PATCH 08/13] [Draft] Update --- tests/python/unittest/test_auto_scheduler_layout_rewrite.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 3f9f02e9e128..2d0fb37481d5 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -169,7 +169,9 @@ def test_correctness_layout_rewrite_insert_transform_stage(): np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] func = tvm.build(s, bufs, target=target) + print(func.get_source()) func_ref = tvm.build(s_ref, bufs_ref, target=target) + print(func_ref.get_source()) ctx = tvm.context(str(target)) ctx_ref = tvm.cpu() @@ -197,4 +199,4 @@ def ffff(): # test_apply_steps_with_layout_rewrite() test_correctness_layout_rewrite_rewrite_for_preTransformed() test_correctness_layout_rewrite_insert_transform_stage() - ffff() + # ffff() From e664bb6a38cf960cef23a843989deada85e711cd Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Wed, 4 Nov 2020 11:57:44 +0800 Subject: [PATCH 09/13] [Draft] Recheck in llvm-4.0 --- tests/scripts/task_config_build_i386.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/task_config_build_i386.sh b/tests/scripts/task_config_build_i386.sh index 65f5d6359dac..8ed5f94e30dc 100755 --- a/tests/scripts/task_config_build_i386.sh +++ b/tests/scripts/task_config_build_i386.sh @@ -29,7 +29,7 @@ echo set\(USE_GRAPH_RUNTIME_DEBUG ON\) >> config.cmake echo set\(USE_MICRO ON\) >> config.cmake echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake echo set\(USE_VM_PROFILER ON\) >> config.cmake -echo set\(USE_LLVM llvm-config-8\) >> config.cmake +echo set\(USE_LLVM llvm-config-4.0\) >> config.cmake echo set\(CMAKE_CXX_COMPILER g++\) >> config.cmake echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake echo set\(USE_VTA_TSIM ON\) >> config.cmake From c63fbef4683b6c30a3b53dabc5b9a81327f44861 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Wed, 4 Nov 2020 14:23:11 +0800 Subject: [PATCH 10/13] [Draft] Update --- .../test_auto_scheduler_layout_rewrite.py | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 2d0fb37481d5..2899e0d8c5e4 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -60,7 +60,8 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - seed = 8749744 # random.randint(0, 10000000) + # seed = 8749744 + seed = random.randint(0, 10000000) print(seed) random.seed(seed) @@ -79,6 +80,8 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): auto_scheduler.auto_schedule(task, search_policy, tuning_options) cmd = "cat %s" % (log_file) os.system(cmd) + os.system("lscpu") + # log_file = "log.txt" inp, _ = auto_scheduler.load_best(log_file, task.workload_key, target) s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.RewriteForPreTransformed @@ -126,8 +129,8 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): func_ref(*args_ref) ctx.sync() - tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy()) - tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy()) + tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3) + tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3) del measure_ctx @@ -139,7 +142,8 @@ def test_correctness_layout_rewrite_insert_transform_stage(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - seed = 8749744 # random.randint(0, 10000000) + # seed = 8749744 + seed = random.randint(0, 10000000) print(seed) random.seed(seed) @@ -158,6 +162,7 @@ def test_correctness_layout_rewrite_insert_transform_stage(): auto_scheduler.auto_schedule(task, search_policy, tuning_options) cmd = "cat %s" % (log_file) os.system(cmd) + os.system("lscpu") inp, _ = auto_scheduler.load_best(log_file, task.workload_key, target) s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.InsertTransformStage @@ -169,9 +174,9 @@ def test_correctness_layout_rewrite_insert_transform_stage(): np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] func = tvm.build(s, bufs, target=target) - print(func.get_source()) + # print(func.get_source()) func_ref = tvm.build(s_ref, bufs_ref, target=target) - print(func_ref.get_source()) + # print(func_ref.get_source()) ctx = tvm.context(str(target)) ctx_ref = tvm.cpu() @@ -184,9 +189,9 @@ def test_correctness_layout_rewrite_insert_transform_stage(): func_ref(*args_ref) ctx.sync() - tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy()) - tvm.testing.assert_allclose(args[1].asnumpy(), args_ref[1].asnumpy()) - tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy()) + tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3) + tvm.testing.assert_allclose(args[1].asnumpy(), args_ref[1].asnumpy(), atol=1e-3) + tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3) del measure_ctx @@ -199,4 +204,4 @@ def ffff(): # test_apply_steps_with_layout_rewrite() test_correctness_layout_rewrite_rewrite_for_preTransformed() test_correctness_layout_rewrite_insert_transform_stage() - # ffff() + ffff() From ccfaa9e4bd126ae08308f349b577b2d14b618f2f Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Wed, 4 Nov 2020 15:52:04 +0800 Subject: [PATCH 11/13] [Draft] --- .../test_auto_scheduler_layout_rewrite.py | 18 +++++++++--------- tests/scripts/task_python_unittest.sh | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 2899e0d8c5e4..94c6f4994d0b 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -86,9 +86,9 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.RewriteForPreTransformed ) - print(tvm.lower(s, bufs, simple_mode=True)) + # print(tvm.lower(s, bufs, simple_mode=True)) s_ref, bufs_ref = dag.apply_steps_from_state(inp.state) - print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) + # print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] np_args_ref = [np.array(x) for x in np_args] @@ -129,8 +129,8 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): func_ref(*args_ref) ctx.sync() - tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3) - tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3) + tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3, rtol=1e-3) + tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3, rtol=1e-3) del measure_ctx @@ -168,9 +168,9 @@ def test_correctness_layout_rewrite_insert_transform_stage(): inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.InsertTransformStage ) - print(tvm.lower(s, bufs, simple_mode=True)) + # print(tvm.lower(s, bufs, simple_mode=True)) s_ref, bufs_ref = dag.apply_steps_from_state(inp.state) - print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) + # print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] func = tvm.build(s, bufs, target=target) @@ -189,9 +189,9 @@ def test_correctness_layout_rewrite_insert_transform_stage(): func_ref(*args_ref) ctx.sync() - tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3) - tvm.testing.assert_allclose(args[1].asnumpy(), args_ref[1].asnumpy(), atol=1e-3) - tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3) + tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3, rtol=1e-3) + tvm.testing.assert_allclose(args[1].asnumpy(), args_ref[1].asnumpy(), atol=1e-3, rtol=1e-3) + tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3, rtol=1e-3) del measure_ctx diff --git a/tests/scripts/task_python_unittest.sh b/tests/scripts/task_python_unittest.sh index 98ad0e7b6c9c..35e309644866 100755 --- a/tests/scripts/task_python_unittest.sh +++ b/tests/scripts/task_python_unittest.sh @@ -25,8 +25,8 @@ source tests/scripts/setup-pytest-env.sh find . -type f -path "*.pyc" | xargs rm -f make cython3 -TVM_FFI=ctypes python3 -m pytest tests/python/all-platform-minimal-test -TVM_FFI=cython python3 -m pytest tests/python/all-platform-minimal-test +# TVM_FFI=ctypes python3 -m pytest tests/python/all-platform-minimal-test +# TVM_FFI=cython python3 -m pytest tests/python/all-platform-minimal-test python3 tests/python/unittest/test_auto_scheduler_layout_rewrite.py -TVM_FFI=ctypes python3 -m pytest tests/python/unittest -TVM_FFI=cython python3 -m pytest tests/python/unittest +# TVM_FFI=ctypes python3 -m pytest tests/python/unittest +# TVM_FFI=cython python3 -m pytest tests/python/unittest From df1215eaffa21af4fb06fe7427290d1220b58972 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Wed, 4 Nov 2020 16:05:08 +0800 Subject: [PATCH 12/13] Recover the skiped tests --- .../test_auto_scheduler_layout_rewrite.py | 31 +---- tests/scripts/task_cpp_unittest.sh | 36 ++--- tests/scripts/task_lint.sh | 32 ++--- tests/scripts/task_python_frontend.sh | 32 ++--- tests/scripts/task_python_frontend_cpu.sh | 16 +-- tests/scripts/task_python_integration.sh | 70 +++++----- tests/scripts/task_python_microtvm.sh | 12 +- tests/scripts/task_python_unittest.sh | 9 +- tests/scripts/task_python_vta_fsim.sh | 16 +-- tests/scripts/task_python_vta_tsim.sh | 30 ++--- tests/scripts/task_rust.sh | 126 +++++++++--------- tests/scripts/task_sphinx_precheck.sh | 42 +++--- tests/scripts/task_web_wasm.sh | 24 ++-- 13 files changed, 225 insertions(+), 251 deletions(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index 94c6f4994d0b..ee5e0c4ff60e 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -60,11 +60,6 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - # seed = 8749744 - seed = random.randint(0, 10000000) - print(seed) - random.seed(seed) - with tempfile.NamedTemporaryFile() as fp: log_file = fp.name @@ -78,17 +73,11 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): measure_callbacks=[auto_scheduler.RecordToFile(log_file)], ) auto_scheduler.auto_schedule(task, search_policy, tuning_options) - cmd = "cat %s" % (log_file) - os.system(cmd) - os.system("lscpu") - # log_file = "log.txt" inp, _ = auto_scheduler.load_best(log_file, task.workload_key, target) s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.RewriteForPreTransformed ) - # print(tvm.lower(s, bufs, simple_mode=True)) s_ref, bufs_ref = dag.apply_steps_from_state(inp.state) - # print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] np_args_ref = [np.array(x) for x in np_args] @@ -142,11 +131,6 @@ def test_correctness_layout_rewrite_insert_transform_stage(): task = auto_scheduler.create_task(matmul_auto_scheduler_test, (N, N, N), target) dag = task.compute_dag - # seed = 8749744 - seed = random.randint(0, 10000000) - print(seed) - random.seed(seed) - with tempfile.NamedTemporaryFile() as fp: log_file = fp.name @@ -160,23 +144,16 @@ def test_correctness_layout_rewrite_insert_transform_stage(): measure_callbacks=[auto_scheduler.RecordToFile(log_file)], ) auto_scheduler.auto_schedule(task, search_policy, tuning_options) - cmd = "cat %s" % (log_file) - os.system(cmd) - os.system("lscpu") inp, _ = auto_scheduler.load_best(log_file, task.workload_key, target) s, bufs = dag.apply_steps_from_state( inp.state, layout_rewrite=auto_scheduler.compute_dag.ComputeDAG.InsertTransformStage ) - # print(tvm.lower(s, bufs, simple_mode=True)) s_ref, bufs_ref = dag.apply_steps_from_state(inp.state) - # print(tvm.lower(s_ref, bufs_ref, simple_mode=True)) np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs] func = tvm.build(s, bufs, target=target) - # print(func.get_source()) func_ref = tvm.build(s_ref, bufs_ref, target=target) - # print(func_ref.get_source()) ctx = tvm.context(str(target)) ctx_ref = tvm.cpu() @@ -195,13 +172,7 @@ def test_correctness_layout_rewrite_insert_transform_stage(): del measure_ctx -def ffff(): - for i in range(10): - test_correctness_layout_rewrite_rewrite_for_preTransformed() - test_correctness_layout_rewrite_insert_transform_stage() - if __name__ == "__main__": - # test_apply_steps_with_layout_rewrite() + test_apply_steps_with_layout_rewrite() test_correctness_layout_rewrite_rewrite_for_preTransformed() test_correctness_layout_rewrite_insert_transform_stage() - ffff() diff --git a/tests/scripts/task_cpp_unittest.sh b/tests/scripts/task_cpp_unittest.sh index e86d8921aadd..7905755b8813 100755 --- a/tests/scripts/task_cpp_unittest.sh +++ b/tests/scripts/task_cpp_unittest.sh @@ -22,25 +22,25 @@ set -u # Python is required by apps/bundle_deploy source tests/scripts/setup-pytest-env.sh -# export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}" -# # NOTE: important to use abspath, when VTA is enabled. -# export VTA_HW_PATH=`pwd`/3rdparty/vta-hw +export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}" +# NOTE: important to use abspath, when VTA is enabled. +export VTA_HW_PATH=`pwd`/3rdparty/vta-hw -# # to avoid CI thread throttling. -# export TVM_BIND_THREADS=0 -# export OMP_NUM_THREADS=1 +# to avoid CI thread throttling. +export TVM_BIND_THREADS=0 +export OMP_NUM_THREADS=1 -# # Remove existing testcases -# rm -f build/*_test +# Remove existing testcases +rm -f build/*_test -# make cpptest -j2 -# make crttest # NOTE: don't parallelize, due to issue with build deps. -# for test in build/*_test; do -# ./$test -# done +make cpptest -j2 +make crttest # NOTE: don't parallelize, due to issue with build deps. +for test in build/*_test; do + ./$test +done -# # Test MISRA-C runtime -# cd apps/bundle_deploy -# rm -rf build -# make test_dynamic test_static -# cd ../.. +# Test MISRA-C runtime +cd apps/bundle_deploy +rm -rf build +make test_dynamic test_static +cd ../.. diff --git a/tests/scripts/task_lint.sh b/tests/scripts/task_lint.sh index 30ab7fc984f7..deb9b9bde6c1 100755 --- a/tests/scripts/task_lint.sh +++ b/tests/scripts/task_lint.sh @@ -27,26 +27,26 @@ cleanup() trap cleanup 0 -# echo "Checking file types..." -# python3 tests/lint/check_file_type.py +echo "Checking file types..." +python3 tests/lint/check_file_type.py -# echo "Checking ASF license headers..." -# tests/lint/check_asf_header.sh +echo "Checking ASF license headers..." +tests/lint/check_asf_header.sh -# echo "Linting the C++ code..." -# tests/lint/cpplint.sh +echo "Linting the C++ code..." +tests/lint/cpplint.sh -# echo "clang-format check..." -# tests/lint/clang_format.sh +echo "clang-format check..." +tests/lint/clang_format.sh -# echo "black check..." -# tests/lint/python_format.sh +echo "black check..." +tests/lint/python_format.sh -# echo "Linting the Python code..." -# tests/lint/pylint.sh +echo "Linting the Python code..." +tests/lint/pylint.sh -# echo "Lintinf the JNI code..." -# tests/lint/jnilint.sh +echo "Lintinf the JNI code..." +tests/lint/jnilint.sh -# echo "Checking C++ documentation..." -# tests/lint/cppdocs.sh +echo "Checking C++ documentation..." +tests/lint/cppdocs.sh diff --git a/tests/scripts/task_python_frontend.sh b/tests/scripts/task_python_frontend.sh index d065dbbc4441..3c5839bc7e1c 100755 --- a/tests/scripts/task_python_frontend.sh +++ b/tests/scripts/task_python_frontend.sh @@ -28,26 +28,26 @@ export TVM_TEST_TARGETS="llvm;cuda" find . -type f -path "*.pyc" | xargs rm -f -# # Rebuild cython -# make cython3 +# Rebuild cython +make cython3 -# echo "Running relay MXNet frontend test..." -# python3 -m pytest tests/python/frontend/mxnet +echo "Running relay MXNet frontend test..." +python3 -m pytest tests/python/frontend/mxnet -# echo "Running relay ONNX frontend test..." -# python3 -m pytest tests/python/frontend/onnx +echo "Running relay ONNX frontend test..." +python3 -m pytest tests/python/frontend/onnx -# echo "Running relay CoreML frontend test..." -# python3 -m pytest tests/python/frontend/coreml +echo "Running relay CoreML frontend test..." +python3 -m pytest tests/python/frontend/coreml -# echo "Running relay Tensorflow frontend test..." -# python3 -m pytest tests/python/frontend/tensorflow +echo "Running relay Tensorflow frontend test..." +python3 -m pytest tests/python/frontend/tensorflow -# echo "Running relay caffe2 frontend test..." -# python3 -m pytest tests/python/frontend/caffe2 +echo "Running relay caffe2 frontend test..." +python3 -m pytest tests/python/frontend/caffe2 -# echo "Running relay DarkNet frontend test..." -# python3 -m pytest tests/python/frontend/darknet +echo "Running relay DarkNet frontend test..." +python3 -m pytest tests/python/frontend/darknet -# echo "Running relay PyTorch frontend test..." -# python3 -m pytest tests/python/frontend/pytorch +echo "Running relay PyTorch frontend test..." +python3 -m pytest tests/python/frontend/pytorch diff --git a/tests/scripts/task_python_frontend_cpu.sh b/tests/scripts/task_python_frontend_cpu.sh index ec75558228cc..6dfcabc2cd37 100755 --- a/tests/scripts/task_python_frontend_cpu.sh +++ b/tests/scripts/task_python_frontend_cpu.sh @@ -29,14 +29,14 @@ export TVM_TEST_TARGETS="llvm" find . -type f -path "*.pyc" | xargs rm -f -# # Rebuild cython -# make cython3 +# Rebuild cython +make cython3 -# echo "Running relay TFLite frontend test..." -# python3 -m pytest tests/python/frontend/tflite +echo "Running relay TFLite frontend test..." +python3 -m pytest tests/python/frontend/tflite -# echo "Running relay Keras frontend test..." -# python3 -m pytest tests/python/frontend/keras +echo "Running relay Keras frontend test..." +python3 -m pytest tests/python/frontend/keras -# echo "Running relay Caffe frontend test..." -# python3 -m pytest tests/python/frontend/caffe +echo "Running relay Caffe frontend test..." +python3 -m pytest tests/python/frontend/caffe diff --git a/tests/scripts/task_python_integration.sh b/tests/scripts/task_python_integration.sh index ea6dab2295bc..ef86d6917424 100755 --- a/tests/scripts/task_python_integration.sh +++ b/tests/scripts/task_python_integration.sh @@ -19,49 +19,49 @@ set -e set -u -# source tests/scripts/setup-pytest-env.sh -# export PYTHONPATH=${PYTHONPATH}:${TVM_PATH}/apps/extension/python -# export LD_LIBRARY_PATH="build:${LD_LIBRARY_PATH:-}" +source tests/scripts/setup-pytest-env.sh +export PYTHONPATH=${PYTHONPATH}:${TVM_PATH}/apps/extension/python +export LD_LIBRARY_PATH="build:${LD_LIBRARY_PATH:-}" -# # to avoid CI CPU thread throttling. -# export TVM_BIND_THREADS=0 -# export TVM_NUM_THREADS=2 +# to avoid CI CPU thread throttling. +export TVM_BIND_THREADS=0 +export TVM_NUM_THREADS=2 -# # cleanup pycache -# find . -type f -path "*.pyc" | xargs rm -f +# cleanup pycache +find . -type f -path "*.pyc" | xargs rm -f -# # Test TVM -# make cython3 +# Test TVM +make cython3 -# # Test extern package -# cd apps/extension -# rm -rf lib -# make -# cd ../.. +# Test extern package +cd apps/extension +rm -rf lib +make +cd ../.. -# TVM_FFI=cython python3 -m pytest apps/extension/tests -# TVM_FFI=ctypes python3 -m pytest apps/extension/tests +TVM_FFI=cython python3 -m pytest apps/extension/tests +TVM_FFI=ctypes python3 -m pytest apps/extension/tests -# # Test dso plugin -# cd apps/dso_plugin_module -# rm -rf lib -# make -# cd ../.. -# TVM_FFI=cython python3 -m pytest apps/dso_plugin_module -# TVM_FFI=ctypes python3 -m pytest apps/dso_plugin_module +# Test dso plugin +cd apps/dso_plugin_module +rm -rf lib +make +cd ../.. +TVM_FFI=cython python3 -m pytest apps/dso_plugin_module +TVM_FFI=ctypes python3 -m pytest apps/dso_plugin_module -# # Do not enable TensorFlow op -# # TVM_FFI=cython sh prepare_and_test_tfop_module.sh -# # TVM_FFI=ctypes sh prepare_and_test_tfop_module.sh +# Do not enable TensorFlow op +# TVM_FFI=cython sh prepare_and_test_tfop_module.sh +# TVM_FFI=ctypes sh prepare_and_test_tfop_module.sh -# TVM_FFI=ctypes python3 -m pytest tests/python/integration -# TVM_FFI=ctypes python3 -m pytest tests/python/contrib +TVM_FFI=ctypes python3 -m pytest tests/python/integration +TVM_FFI=ctypes python3 -m pytest tests/python/contrib -# TVM_TEST_TARGETS="${TVM_RELAY_TEST_TARGETS:-llvm;cuda}" TVM_FFI=ctypes python3 -m pytest tests/python/relay +TVM_TEST_TARGETS="${TVM_RELAY_TEST_TARGETS:-llvm;cuda}" TVM_FFI=ctypes python3 -m pytest tests/python/relay -# # Command line driver test -# TVM_FFI=ctypes python3 -m pytest tests/python/driver +# Command line driver test +TVM_FFI=ctypes python3 -m pytest tests/python/driver -# # Do not enable OpenGL -# # TVM_FFI=cython python -m pytest tests/webgl -# # TVM_FFI=ctypes python3 -m pytest tests/webgl +# Do not enable OpenGL +# TVM_FFI=cython python -m pytest tests/webgl +# TVM_FFI=ctypes python3 -m pytest tests/webgl diff --git a/tests/scripts/task_python_microtvm.sh b/tests/scripts/task_python_microtvm.sh index f6944a007b55..7fb8d471a53a 100755 --- a/tests/scripts/task_python_microtvm.sh +++ b/tests/scripts/task_python_microtvm.sh @@ -19,11 +19,11 @@ set -e set -u -# source tests/scripts/setup-pytest-env.sh +source tests/scripts/setup-pytest-env.sh -# # cleanup pycache -# find . -type f -path "*.pyc" | xargs rm -f +# cleanup pycache +find . -type f -path "*.pyc" | xargs rm -f -# TVM_FFI=ctypes python3 -m pytest tests/micro/qemu -# make cython3 -# TVM_FFI=cython python3 -m pytest tests/micro/qemu +TVM_FFI=ctypes python3 -m pytest tests/micro/qemu +make cython3 +TVM_FFI=cython python3 -m pytest tests/micro/qemu diff --git a/tests/scripts/task_python_unittest.sh b/tests/scripts/task_python_unittest.sh index 35e309644866..0aaf9fc86664 100755 --- a/tests/scripts/task_python_unittest.sh +++ b/tests/scripts/task_python_unittest.sh @@ -25,8 +25,7 @@ source tests/scripts/setup-pytest-env.sh find . -type f -path "*.pyc" | xargs rm -f make cython3 -# TVM_FFI=ctypes python3 -m pytest tests/python/all-platform-minimal-test -# TVM_FFI=cython python3 -m pytest tests/python/all-platform-minimal-test -python3 tests/python/unittest/test_auto_scheduler_layout_rewrite.py -# TVM_FFI=ctypes python3 -m pytest tests/python/unittest -# TVM_FFI=cython python3 -m pytest tests/python/unittest +TVM_FFI=ctypes python3 -m pytest tests/python/all-platform-minimal-test +TVM_FFI=cython python3 -m pytest tests/python/all-platform-minimal-test +TVM_FFI=ctypes python3 -m pytest tests/python/unittest +TVM_FFI=cython python3 -m pytest tests/python/unittest diff --git a/tests/scripts/task_python_vta_fsim.sh b/tests/scripts/task_python_vta_fsim.sh index 2a1504dfaac8..8080bbe756c7 100755 --- a/tests/scripts/task_python_vta_fsim.sh +++ b/tests/scripts/task_python_vta_fsim.sh @@ -35,13 +35,13 @@ rm -rf ~/.tvm # Rebuild cython make cython3 -# # Reset default fsim simulation -# cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json +# Reset default fsim simulation +cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json -# # Run unit tests in functional/fast simulator -# echo "Running unittest in fsim..." -# python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest +# Run unit tests in functional/fast simulator +echo "Running unittest in fsim..." +python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest -# # Run unit tests in functional/fast simulator -# echo "Running integration test in fsim..." -# python3 -m pytest ${TVM_PATH}/vta/tests/python/integration +# Run unit tests in functional/fast simulator +echo "Running integration test in fsim..." +python3 -m pytest ${TVM_PATH}/vta/tests/python/integration diff --git a/tests/scripts/task_python_vta_tsim.sh b/tests/scripts/task_python_vta_tsim.sh index 982861f5d9db..c87d5483b8a5 100755 --- a/tests/scripts/task_python_vta_tsim.sh +++ b/tests/scripts/task_python_vta_tsim.sh @@ -44,22 +44,22 @@ cp ${VTA_HW_PATH}/config/tsim_sample.json ${VTA_HW_PATH}/config/vta_config.json # make -C ${VTA_HW_PATH}/apps/tsim_example/ run_chisel # make -C ${VTA_HW_PATH}/apps/gemm/ default -# # Check style of scala code -# echo "Check style of scala code..." -# make -C ${VTA_HW_PATH}/hardware/chisel lint +# Check style of scala code +echo "Check style of scala code..." +make -C ${VTA_HW_PATH}/hardware/chisel lint -# # Build VTA chisel design and verilator simulator -# echo "Building VTA chisel design..." -# make -C ${VTA_HW_PATH}/hardware/chisel cleanall -# make -C ${VTA_HW_PATH}/hardware/chisel USE_THREADS=0 lib +# Build VTA chisel design and verilator simulator +echo "Building VTA chisel design..." +make -C ${VTA_HW_PATH}/hardware/chisel cleanall +make -C ${VTA_HW_PATH}/hardware/chisel USE_THREADS=0 lib -# # Run unit tests in cycle accurate simulator -# echo "Running unittest in tsim..." -# python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest +# Run unit tests in cycle accurate simulator +echo "Running unittest in tsim..." +python3 -m pytest ${TVM_PATH}/vta/tests/python/unittest -# # Run unit tests in cycle accurate simulator -# echo "Running integration test in tsim..." -# python3 -m pytest ${TVM_PATH}/vta/tests/python/integration +# Run unit tests in cycle accurate simulator +echo "Running integration test in tsim..." +python3 -m pytest ${TVM_PATH}/vta/tests/python/integration -# # Reset default fsim simulation -# cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json +# Reset default fsim simulation +cp ${VTA_HW_PATH}/config/fsim_sample.json ${VTA_HW_PATH}/config/vta_config.json diff --git a/tests/scripts/task_rust.sh b/tests/scripts/task_rust.sh index 264672912a0e..d60999c3f3d0 100755 --- a/tests/scripts/task_rust.sh +++ b/tests/scripts/task_rust.sh @@ -38,78 +38,78 @@ echo "Using LLVM_CONFIG_PATH=$LLVM_CONFIG_PATH" export TVM_BIND_THREADS=0 export OMP_NUM_THREADS=1 -# cd $RUST_DIR -# cargo fmt -- --check +cd $RUST_DIR +cargo fmt -- --check -# # First we test tvm-sys the core Rust bindings. -# cd $RUST_DIR/tvm-sys -# # First we test w/o the bindings feature on. -# cargo build -# cargo test --tests - -# # Second we test w/ the bindings feature on. -# cargo build --features bindings -# cargo test --features bindings --tests - -# # Next we test the runtime API. -# cd $RUST_DIR/tvm-rt - -# # Build and run the tests. -# cargo build -# cargo test --tests - -# # Next we test the graph runtime crate. -# cd $RUST_DIR/tvm-graph-rt +# First we test tvm-sys the core Rust bindings. +cd $RUST_DIR/tvm-sys +# First we test w/o the bindings feature on. +cargo build +cargo test --tests -# # We first we compile a model using the Python bindings then run the tests. -# python3 tests/build_model.py -# cargo test --tests +# Second we test w/ the bindings feature on. +cargo build --features bindings +cargo test --features bindings --tests -# # Run some more tests involving the graph runtime API. -# cd tests/test_tvm_basic -# cargo run -# cd - - -# cd tests/test_tvm_dso -# cargo run -# cd - +# Next we test the runtime API. +cd $RUST_DIR/tvm-rt -# # # run wasm32 test -# # cd tests/test_wasm32 -# # cargo build -# # wasmtime $RUST_DIR/target/wasm32-wasi/debug/test-wasm32.wasm -# # cd - +# Build and run the tests. +cargo build +cargo test --tests -# # run nn graph test -# cd tests/test_nn -# cargo run -# cd - +# Next we test the graph runtime crate. +cd $RUST_DIR/tvm-graph-rt -# # Finally we test the TVM crate which provides both runtime -# # and compiler bindings. -# cd $RUST_DIR/tvm +# We first we compile a model using the Python bindings then run the tests. +python3 tests/build_model.py +cargo test --tests -# cargo test --tests -- --test-threads=1 +# Run some more tests involving the graph runtime API. +cd tests/test_tvm_basic +cargo run +cd - -# # run basic tests on cpu -# cd tests/basics -# cargo build --features cpu -# cargo run --features cpu -# # uncomment when have more CI resources -# # cargo build --features gpu -# # cargo run --features gpu -# # fi -# cd - +cd tests/test_tvm_dso +cargo run +cd - -# # run callback tests separately: https://discuss.tvm.ai/t/are-global-functions-need-to-be-accessed-in-separate-processes/1075 -# cd tests/callback +# # run wasm32 test +# cd tests/test_wasm32 # cargo build -# cargo run --bin int -# cargo run --bin float -# cargo run --bin array -# cargo run --bin string +# wasmtime $RUST_DIR/target/wasm32-wasi/debug/test-wasm32.wasm # cd - -# cd examples/resnet -# cargo run -# cd - +# run nn graph test +cd tests/test_nn +cargo run +cd - + +# Finally we test the TVM crate which provides both runtime +# and compiler bindings. +cd $RUST_DIR/tvm + +cargo test --tests -- --test-threads=1 + +# run basic tests on cpu +cd tests/basics +cargo build --features cpu +cargo run --features cpu +# uncomment when have more CI resources +# cargo build --features gpu +# cargo run --features gpu +# fi +cd - + +# run callback tests separately: https://discuss.tvm.ai/t/are-global-functions-need-to-be-accessed-in-separate-processes/1075 +cd tests/callback +cargo build +cargo run --bin int +cargo run --bin float +cargo run --bin array +cargo run --bin string +cd - + +cd examples/resnet +cargo run +cd - diff --git a/tests/scripts/task_sphinx_precheck.sh b/tests/scripts/task_sphinx_precheck.sh index c5eceb26fe20..08184d9ff333 100755 --- a/tests/scripts/task_sphinx_precheck.sh +++ b/tests/scripts/task_sphinx_precheck.sh @@ -27,24 +27,28 @@ cleanup() } trap cleanup 0 -# # cleanup cache -# rm -rf docs/tutorials -# rm -rf docs/vta/tutorials -# find . -type f -path "*.pyc" | xargs rm -f -# make cython3 +# cleanup cache +rm -rf docs/tutorials +rm -rf docs/vta/tutorials +find . -type f -path "*.pyc" | xargs rm -f +make cython3 -# echo "PreCheck sphinx doc generation WARNINGS.." -# cd docs -# make clean -# TVM_TUTORIAL_EXEC_PATTERN=none make html |& tee /tmp/$$.log.txt +# install theme addon for to local if does not exists +# avoid docker for now before we stablize on the choice of style +python3 -m pip install --user --upgrade -q tlcpack-sphinx-addon==0.1.0 -# grep -v -E "__mro__|UserWarning|FutureWarning|tensorflow|Keras|pytorch|TensorFlow|403" < /tmp/$$.log.txt > /tmp/$$.logclean.txt || true -# echo "---------Sphinx Log----------" -# cat /tmp/$$.logclean.txt -# echo "-----------------------------" -# if grep --quiet -E "WARN" < /tmp/$$.logclean.txt; then -# echo "WARNINIG found in the log, please fix them." -# echo "You can reproduce locally by running ./tests/scripts/task_sphinx_precheck.sh" -# exit 1 -# fi -# echo "No WARNINGS to be fixed." +echo "PreCheck sphinx doc generation WARNINGS.." +cd docs +make clean +TVM_TUTORIAL_EXEC_PATTERN=none make html |& tee /tmp/$$.log.txt + +grep -v -E "__mro__|UserWarning|FutureWarning|tensorflow|Keras|pytorch|TensorFlow|403" < /tmp/$$.log.txt > /tmp/$$.logclean.txt || true +echo "---------Sphinx Log----------" +cat /tmp/$$.logclean.txt +echo "-----------------------------" +if grep --quiet -E "WARN" < /tmp/$$.logclean.txt; then + echo "WARNINIG found in the log, please fix them." + echo "You can reproduce locally by running ./tests/scripts/task_sphinx_precheck.sh" + exit 1 +fi +echo "No WARNINGS to be fixed." diff --git a/tests/scripts/task_web_wasm.sh b/tests/scripts/task_web_wasm.sh index 72b30198ae09..c117bb08c6f4 100755 --- a/tests/scripts/task_web_wasm.sh +++ b/tests/scripts/task_web_wasm.sh @@ -17,17 +17,17 @@ # under the License. set -e -# set -u +set -u -# export PYTHONPATH=`pwd`/python +export PYTHONPATH=`pwd`/python -# rm -rf .emscripten_cache -# cd web -# make clean -# npm install -# npm run lint -# npm run prepwasm -# npm run bundle -# npm run test -# npm run typedoc -# cd .. +rm -rf .emscripten_cache +cd web +make clean +npm install +npm run lint +npm run prepwasm +npm run bundle +npm run test +npm run typedoc +cd .. From a91418213c42f4038bd41ef8bbb75da273836ca3 Mon Sep 17 00:00:00 2001 From: "chengfan.jcf" Date: Wed, 4 Nov 2020 16:07:06 +0800 Subject: [PATCH 13/13] Update --- tests/python/unittest/test_auto_scheduler_layout_rewrite.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py index ee5e0c4ff60e..9d9704df0524 100644 --- a/tests/python/unittest/test_auto_scheduler_layout_rewrite.py +++ b/tests/python/unittest/test_auto_scheduler_layout_rewrite.py @@ -20,15 +20,12 @@ import numpy as np import pytest -import random import tvm import tvm.testing from tvm import topi from tvm import auto_scheduler, te -import os - from test_auto_scheduler_common import get_tiled_matmul, matmul_auto_scheduler_test @@ -52,7 +49,6 @@ def test_apply_steps_with_layout_rewrite(): assert bufs[1].shape[1] == 512 -@pytest.mark.skip("skip due to flaky") @tvm.testing.requires_llvm def test_correctness_layout_rewrite_rewrite_for_preTransformed(): N = 128 @@ -123,7 +119,6 @@ def test_correctness_layout_rewrite_rewrite_for_preTransformed(): del measure_ctx -@pytest.mark.skip("skip due to flaky") @tvm.testing.requires_llvm def test_correctness_layout_rewrite_insert_transform_stage(): N = 128