You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2020/10/29 17:47:58 UTC
[incubator-tvm] branch main updated: [REFACTOR] Remainings of util
=> utils (#6778)
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git
The following commit(s) were added to refs/heads/main by this push:
new c8064b3 [REFACTOR] Remainings of util => utils (#6778)
c8064b3 is described below
commit c8064b3ca6787961c90fe7c09c3ddc3beba3ece5
Author: Tianqi Chen <tq...@users.noreply.github.com>
AuthorDate: Thu Oct 29 13:46:31 2020 -0400
[REFACTOR] Remainings of util => utils (#6778)
---
apps/android_camera/models/prepare_model.py | 2 +-
apps/android_rpc/tests/android_rpc_test.py | 4 +--
apps/benchmark/arm_cpu_imagenet_bench.py | 2 +-
apps/benchmark/mobile_gpu_imagenet_bench.py | 2 +-
apps/ios_rpc/tests/ios_rpc_mobilenet.py | 4 +--
apps/ios_rpc/tests/ios_rpc_test.py | 4 +--
apps/topi_recipe/conv/depthwise_conv2d_test.py | 2 +-
apps/topi_recipe/conv/test_conv2d_hwcn_map.py | 2 +-
apps/topi_recipe/gemm/android_gemm_square.py | 4 +--
docs/api/python/contrib.rst | 6 ++--
docs/dev/introduction_to_module_serialization.rst | 4 +--
golang/sample/deploy.py | 2 +-
golang/src/{util.go => utils.go} | 2 +-
jvm/README.md | 2 +-
jvm/core/src/test/scripts/test_add_cpu.py | 2 +-
jvm/core/src/test/scripts/test_add_gpu.py | 2 +-
python/setup.py | 1 -
python/tvm/auto_scheduler/auto_schedule.py | 2 +-
python/tvm/autotvm/__init__.py | 2 +-
python/tvm/autotvm/graph_tuner/base_graph_tuner.py | 2 +-
python/tvm/autotvm/measure/measure_methods.py | 2 +-
python/tvm/autotvm/task/space.py | 2 +-
python/tvm/autotvm/task/task.py | 3 +-
python/tvm/autotvm/tophub.py | 2 +-
python/tvm/autotvm/tuner/callback.py | 2 +-
python/tvm/autotvm/tuner/metric.py | 2 +-
python/tvm/autotvm/tuner/sa_model_optimizer.py | 2 +-
python/tvm/autotvm/tuner/tuner.py | 4 +--
python/tvm/autotvm/tuner/xgboost_cost_model.py | 2 +-
python/tvm/autotvm/{util.py => utils.py} | 0
python/tvm/contrib/{binutil.py => binutils.py} | 8 ++---
python/tvm/contrib/clang.py | 8 ++---
python/tvm/contrib/nvcc.py | 4 +--
python/tvm/contrib/peak.py | 4 +--
python/tvm/contrib/rocm.py | 6 ++--
python/tvm/contrib/sdaccel.py | 4 +--
python/tvm/contrib/spirv.py | 4 +--
python/tvm/contrib/tar.py | 4 +--
python/tvm/contrib/{util.py => utils.py} | 0
python/tvm/contrib/xcode.py | 6 ++--
python/tvm/driver/tvmc/compiler.py | 4 +--
python/tvm/error.py | 2 +-
python/tvm/micro/build.py | 8 ++---
python/tvm/micro/compiler.py | 10 +++---
python/tvm/micro/micro_library.py | 4 +--
python/tvm/relay/backend/vm.py | 2 +-
python/tvm/relay/build_module.py | 4 +--
python/tvm/relay/frontend/common.py | 2 +-
python/tvm/relay/frontend/mxnet.py | 2 +-
python/tvm/relay/frontend/onnx.py | 4 +--
python/tvm/relay/frontend/pytorch.py | 2 +-
python/tvm/relay/frontend/tensorflow.py | 2 +-
python/tvm/relay/frontend/tensorflow_parser.py | 4 +--
python/tvm/relay/op/_reduce.py | 2 +-
python/tvm/relay/op/_tensor_grad.py | 7 ++--
python/tvm/relay/op/_transform.py | 2 +-
python/tvm/relay/op/dyn/image/_image.py | 2 +-
python/tvm/relay/op/image/_image.py | 2 +-
python/tvm/relay/op/nn/_nn.py | 2 +-
python/tvm/relay/op/nn/nn.py | 2 +-
python/tvm/relay/op/nn/{util.py => utils.py} | 0
python/tvm/relay/op/strategy/arm_cpu.py | 2 +-
python/tvm/relay/op/strategy/generic.py | 2 +-
python/tvm/relay/op/vision/_rcnn.py | 2 +-
python/tvm/relay/qnn/op/qnn.py | 2 +-
python/tvm/relay/transform/transform.py | 2 +-
python/tvm/rpc/client.py | 4 +--
python/tvm/rpc/server.py | 8 ++---
python/tvm/runtime/module.py | 8 ++---
python/tvm/runtime/vm.py | 2 +-
python/tvm/te/hybrid/module.py | 4 +--
python/tvm/topi/__init__.py | 4 +--
python/tvm/topi/arm_cpu/bitserial_conv2d.py | 4 +--
python/tvm/topi/arm_cpu/bitserial_dense.py | 2 +-
python/tvm/topi/arm_cpu/conv2d.py | 4 +--
python/tvm/topi/arm_cpu/conv2d_alter_op.py | 2 +-
python/tvm/topi/arm_cpu/conv2d_gemm.py | 4 +--
python/tvm/topi/arm_cpu/conv2d_int8.py | 2 +-
python/tvm/topi/arm_cpu/conv2d_spatial_pack.py | 4 +--
python/tvm/topi/arm_cpu/conv2d_transpose.py | 2 +-
python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct.py | 2 +-
.../topi/arm_cpu/cortex_m7/conv2d/direct_simd.py | 4 +--
python/tvm/topi/arm_cpu/depthwise_conv2d.py | 6 ++--
python/tvm/topi/arm_cpu/injective.py | 2 +-
python/tvm/topi/arm_cpu/tensor_intrin.py | 4 +--
python/tvm/topi/bifrost/conv2d.py | 2 +-
python/tvm/topi/bifrost/dense.py | 2 +-
python/tvm/topi/bifrost/depthwise_conv2d.py | 8 ++---
python/tvm/topi/bifrost/gemm.py | 20 +++++------
python/tvm/topi/cpp/__init__.py | 2 +-
python/tvm/topi/cpp/{util.py => utils.py} | 2 +-
python/tvm/topi/cuda/batch_matmul.py | 2 +-
python/tvm/topi/cuda/conv1d.py | 2 +-
python/tvm/topi/cuda/conv1d_transpose_ncw.py | 2 +-
python/tvm/topi/cuda/conv2d.py | 4 +--
python/tvm/topi/cuda/conv2d_alter_op.py | 2 +-
python/tvm/topi/cuda/conv2d_direct.py | 2 +-
python/tvm/topi/cuda/conv2d_hwnc_tensorcore.py | 4 +--
python/tvm/topi/cuda/conv2d_int8.py | 4 +--
python/tvm/topi/cuda/conv2d_nhwc.py | 2 +-
python/tvm/topi/cuda/conv2d_nhwc_tensorcore.py | 4 +--
python/tvm/topi/cuda/conv2d_nhwc_winograd.py | 2 +-
python/tvm/topi/cuda/conv2d_transpose_nchw.py | 2 +-
python/tvm/topi/cuda/conv2d_winograd.py | 2 +-
python/tvm/topi/cuda/conv3d.py | 2 +-
python/tvm/topi/cuda/conv3d_alter_op.py | 2 +-
python/tvm/topi/cuda/conv3d_direct.py | 2 +-
python/tvm/topi/cuda/conv3d_ndhwc_tensorcore.py | 4 +--
python/tvm/topi/cuda/conv3d_transpose_ncdhw.py | 2 +-
python/tvm/topi/cuda/conv3d_winograd.py | 2 +-
python/tvm/topi/cuda/correlation.py | 2 +-
python/tvm/topi/cuda/deformable_conv2d.py | 2 +-
python/tvm/topi/cuda/dense.py | 2 +-
python/tvm/topi/cuda/dense_tensorcore.py | 2 +-
python/tvm/topi/cuda/depthwise_conv2d.py | 2 +-
python/tvm/topi/cuda/group_conv2d_nchw.py | 4 +--
python/tvm/topi/cuda/injective.py | 6 ++--
python/tvm/topi/cuda/pooling.py | 2 +-
python/tvm/topi/cuda/rcnn/proposal.py | 2 +-
python/tvm/topi/cuda/sparse.py | 2 +-
python/tvm/topi/generic/conv2d.py | 2 +-
python/tvm/topi/image/dilation2d.py | 4 +--
python/tvm/topi/image/resize.py | 2 +-
python/tvm/topi/intel_graphics/conv2d.py | 12 +++----
python/tvm/topi/intel_graphics/conv2d_alter_op.py | 2 +-
python/tvm/topi/intel_graphics/depthwise_conv2d.py | 2 +-
python/tvm/topi/mali/conv2d.py | 2 +-
python/tvm/topi/mali/dense.py | 2 +-
python/tvm/topi/mali/depthwise_conv2d.py | 2 +-
python/tvm/topi/nn/batch_matmul.py | 2 +-
python/tvm/topi/nn/bitserial_conv2d.py | 4 +--
python/tvm/topi/nn/bitserial_dense.py | 2 +-
python/tvm/topi/nn/bitserial_util.py | 2 +-
python/tvm/topi/nn/bnn.py | 2 +-
python/tvm/topi/nn/conv1d.py | 4 +--
python/tvm/topi/nn/conv1d_transpose.py | 4 +--
python/tvm/topi/nn/conv2d.py | 4 +--
python/tvm/topi/nn/conv2d_transpose.py | 4 +--
python/tvm/topi/nn/conv3d.py | 4 +--
python/tvm/topi/nn/conv3d_transpose.py | 4 +--
python/tvm/topi/nn/correlation.py | 2 +-
python/tvm/topi/nn/deformable_conv2d.py | 6 ++--
python/tvm/topi/nn/depthwise_conv2d.py | 4 +--
python/tvm/topi/nn/dilate.py | 4 +--
python/tvm/topi/nn/elemwise.py | 2 +-
python/tvm/topi/nn/pad.py | 2 +-
python/tvm/topi/nn/sparse.py | 2 +-
python/tvm/topi/nn/upsampling.py | 2 +-
python/tvm/topi/nn/{util.py => utils.py} | 2 +-
python/tvm/topi/nn/winograd_util.py | 2 +-
python/tvm/topi/rocm/batch_matmul.py | 2 +-
python/tvm/topi/rocm/conv2d.py | 4 +--
python/tvm/topi/rocm/dense.py | 2 +-
python/tvm/topi/sort.py | 2 +-
python/tvm/topi/sparse/csrmm.py | 2 +-
python/tvm/topi/sparse/dense.py | 2 +-
python/tvm/topi/testing/bilinear_resize_python.py | 2 +-
python/tvm/topi/testing/conv1d_ncw_python.py | 2 +-
.../topi/testing/conv1d_transpose_ncw_python.py | 2 +-
python/tvm/topi/testing/conv2d_hwcn_python.py | 2 +-
python/tvm/topi/testing/conv2d_nchw_python.py | 2 +-
python/tvm/topi/testing/conv2d_nhwc_python.py | 2 +-
python/tvm/topi/testing/conv2d_transpose_python.py | 2 +-
python/tvm/topi/testing/conv3d_ncdhw_python.py | 2 +-
python/tvm/topi/testing/conv3d_ndhwc_python.py | 2 +-
.../topi/testing/conv3d_transpose_ncdhw_python.py | 2 +-
.../topi/testing/deformable_conv2d_nchw_python.py | 2 +-
python/tvm/topi/testing/upsampling_python.py | 2 +-
python/tvm/topi/transform.py | 2 +-
python/tvm/topi/{util.py => utils.py} | 2 +-
python/tvm/topi/vision/rcnn/proposal.py | 2 +-
python/tvm/topi/vision/rcnn/roi_align.py | 4 +--
python/tvm/topi/vision/rcnn/roi_pool.py | 2 +-
python/tvm/topi/x86/batch_matmul.py | 2 +-
python/tvm/topi/x86/bitserial_conv2d.py | 4 +--
python/tvm/topi/x86/bitserial_dense.py | 2 +-
python/tvm/topi/x86/conv2d.py | 4 +--
python/tvm/topi/x86/conv2d_alter_op.py | 4 +--
python/tvm/topi/x86/conv2d_avx_1x1.py | 6 ++--
python/tvm/topi/x86/conv2d_avx_common.py | 4 +--
python/tvm/topi/x86/conv2d_int8.py | 4 +--
python/tvm/topi/x86/conv2d_transpose.py | 2 +-
python/tvm/topi/x86/conv3d.py | 8 ++---
python/tvm/topi/x86/conv3d_transpose.py | 2 +-
python/tvm/topi/x86/dense.py | 4 +--
python/tvm/topi/x86/depthwise_conv2d.py | 8 ++---
python/tvm/topi/x86/injective.py | 2 +-
python/tvm/topi/x86/reduction.py | 2 +-
python/tvm/topi/x86/roi_align.py | 2 +-
python/tvm/topi/x86/sparse.py | 4 +--
python/tvm/topi/x86/{util.py => utils.py} | 0
src/topi/schedule.cc | 4 +--
tests/micro/qemu/test_zephyr.py | 4 +--
tests/micro/test_runtime_micro_on_arm.py | 2 +-
.../test_minimal_target_codegen_llvm.py | 4 +--
.../contrib/test_arm_compute_lib/infrastructure.py | 4 +--
.../contrib/{test_binutil.py => test_binutils.py} | 12 +++----
tests/python/contrib/test_coreml_runtime.py | 6 ++--
tests/python/contrib/test_edgetpu_runtime.py | 2 +-
tests/python/contrib/test_ethosn/infrastructure.py | 6 ++--
tests/python/contrib/test_nnpack.py | 2 +-
tests/python/contrib/test_tflite_runtime.py | 6 ++--
tests/python/contrib/test_util.py | 36 +++++++++----------
tests/python/frontend/caffe/test_forward.py | 2 +-
tests/python/frontend/tensorflow/test_forward.py | 4 +--
tests/python/frontend/tflite/test_forward.py | 2 +-
tests/python/integration/test_winograd_nnpack.py | 2 +-
tests/python/relay/test_any.py | 2 +-
tests/python/relay/test_external_codegen.py | 4 +--
tests/python/relay/test_json_runtime.py | 2 +-
tests/python/relay/test_op_grad_level2.py | 6 ++--
tests/python/relay/test_op_level2.py | 4 +--
tests/python/relay/test_op_qnn_conv2d.py | 2 +-
tests/python/relay/test_param_dict.py | 4 +--
tests/python/relay/test_pass_annotate_target.py | 4 +--
tests/python/relay/test_pass_auto_quantize.py | 2 +-
.../relay/test_pass_merge_compiler_regions.py | 2 +-
tests/python/relay/test_pass_partition_graph.py | 4 +--
tests/python/relay/test_vm_serialization.py | 4 +--
.../relay/{util => utils}/assert_diagnostic.py | 0
tests/python/topi/python/test_topi_basic.py | 6 ++--
tests/python/topi/python/test_topi_batch_matmul.py | 2 +-
.../topi/python/test_topi_bitserial_conv2d.py | 2 +-
.../topi/python/test_topi_bitserial_conv2d_rasp.py | 2 +-
.../topi/python/test_topi_bitserial_dense.py | 2 +-
tests/python/topi/python/test_topi_bnn.py | 2 +-
tests/python/topi/python/test_topi_clip.py | 2 +-
tests/python/topi/python/test_topi_conv1d.py | 2 +-
.../topi/python/test_topi_conv1d_transpose_ncw.py | 2 +-
tests/python/topi/python/test_topi_conv2d_NCHWc.py | 4 +--
tests/python/topi/python/test_topi_conv2d_hwcn.py | 2 +-
.../python/test_topi_conv2d_hwnc_tensorcore.py | 4 +--
tests/python/topi/python/test_topi_conv2d_int8.py | 4 +--
tests/python/topi/python/test_topi_conv2d_nchw.py | 4 +--
tests/python/topi/python/test_topi_conv2d_nhwc.py | 2 +-
.../topi/python/test_topi_conv2d_nhwc_pack_int8.py | 2 +-
.../python/test_topi_conv2d_nhwc_tensorcore.py | 4 +--
.../topi/python/test_topi_conv2d_nhwc_winograd.py | 4 +--
.../topi/python/test_topi_conv2d_transpose_nchw.py | 2 +-
.../topi/python/test_topi_conv2d_winograd.py | 4 +--
tests/python/topi/python/test_topi_conv3d_ncdhw.py | 4 +--
tests/python/topi/python/test_topi_conv3d_ndhwc.py | 2 +-
.../python/test_topi_conv3d_ndhwc_tensorcore.py | 4 +--
.../python/test_topi_conv3d_transpose_ncdhw.py | 2 +-
.../topi/python/test_topi_conv3d_winograd.py | 4 +--
tests/python/topi/python/test_topi_correlation.py | 2 +-
.../topi/python/test_topi_deformable_conv2d.py | 2 +-
tests/python/topi/python/test_topi_dense.py | 2 +-
.../topi/python/test_topi_dense_tensorcore.py | 2 +-
.../topi/python/test_topi_depthwise_conv2d.py | 4 +--
.../test_topi_depthwise_conv2d_back_input.py | 4 +--
.../test_topi_depthwise_conv2d_back_weight.py | 4 +--
tests/python/topi/python/test_topi_dilate.py | 2 +-
tests/python/topi/python/test_topi_group_conv2d.py | 2 +-
.../python/test_topi_group_conv2d_NCHWc_int8.py | 2 +-
tests/python/topi/python/test_topi_lrn.py | 2 +-
tests/python/topi/python/test_topi_math.py | 6 ++--
tests/python/topi/python/test_topi_matmul.py | 2 +-
tests/python/topi/python/test_topi_pooling.py | 2 +-
tests/python/topi/python/test_topi_relu.py | 2 +-
tests/python/topi/python/test_topi_reorg.py | 2 +-
tests/python/topi/python/test_topi_softmax.py | 2 +-
tests/python/topi/python/test_topi_sparse.py | 2 +-
tests/python/topi/python/test_topi_upsampling.py | 2 +-
tests/python/topi/python/test_topi_util.py | 2 +-
tests/python/topi/python/test_topi_vision.py | 2 +-
.../python/unittest/test_auto_scheduler_common.py | 2 +-
tests/python/unittest/test_autotvm_record.py | 4 +--
tests/python/unittest/test_crt.py | 2 +-
tests/python/unittest/test_format_si_prefix.py | 8 ++---
tests/python/unittest/test_micro_artifact.py | 8 ++---
tests/python/unittest/test_runtime_graph.py | 4 +--
tests/python/unittest/test_runtime_graph_debug.py | 4 +--
.../python/unittest/test_runtime_heterogeneous.py | 4 +--
tests/python/unittest/test_runtime_measure.py | 2 +-
.../test_runtime_module_based_interface.py | 32 ++++++++---------
.../python/unittest/test_runtime_module_export.py | 20 +++++------
tests/python/unittest/test_runtime_module_load.py | 12 +++----
tests/python/unittest/test_runtime_rpc.py | 12 +++----
tests/python/unittest/test_target_codegen_blob.py | 8 ++---
.../python/unittest/test_target_codegen_c_host.py | 8 ++---
.../unittest/test_target_codegen_cross_llvm.py | 6 ++--
.../python/unittest/test_target_codegen_device.py | 2 +-
tests/python/unittest/test_target_codegen_llvm.py | 4 +--
tests/python/unittest/test_te_autodiff.py | 2 +-
tests/python/unittest/test_te_hybrid_script.py | 4 +--
tests/python/unittest/test_te_tensor_overload.py | 2 +-
tests/python/unittest/test_tir_data_layout.py | 2 +-
tests/python/unittest/test_tir_intrin.py | 2 +-
tests/scripts/task_golang.sh | 2 ++
tutorials/autotvm/tune_relay_arm.py | 4 +--
tutorials/autotvm/tune_relay_cuda.py | 4 +--
tutorials/autotvm/tune_relay_mobile_gpu.py | 4 +--
tutorials/frontend/deploy_model_on_android.py | 4 +--
tutorials/frontend/deploy_model_on_rasp.py | 4 +--
tutorials/frontend/deploy_prequantized.py | 2 +-
tutorials/frontend/deploy_quantized.py | 2 +-
tutorials/frontend/from_onnx.py | 2 +-
tutorials/get_started/cross_compilation_and_rpc.py | 4 +--
tutorials/get_started/relay_quick_start.py | 4 +--
tutorials/get_started/tensor_expr_get_started.py | 4 +--
tutorials/language/tensorize.py | 10 +++---
tutorials/micro/micro_tflite.py | 2 +-
version.py | 2 +-
vta/python/vta/__init__.py | 2 --
vta/python/vta/testing/__init__.py | 2 +-
vta/python/vta/testing/{util.py => utils.py} | 0
vta/python/vta/top/__init__.py | 2 +-
vta/python/vta/top/bitpack.py | 4 +--
vta/python/vta/top/op.py | 6 ++--
vta/python/vta/top/{util.py => utils.py} | 0
vta/python/vta/top/vta_conv2d.py | 12 +++----
vta/python/vta/top/vta_conv2d_transpose.py | 6 ++--
vta/python/vta/top/vta_dense.py | 6 ++--
vta/python/vta/top/vta_group_conv2d.py | 10 +++---
vta/python/vta/transform.py | 42 +++++++++++-----------
vta/scripts/tune_resnet.py | 4 +--
.../python/integration/test_benchmark_gemm.py | 4 +--
.../integration/test_benchmark_topi_conv2d.py | 6 ++--
.../test_benchmark_topi_conv2d_transpose.py | 6 ++--
.../integration/test_benchmark_topi_dense.py | 6 ++--
.../test_benchmark_topi_group_conv2d.py | 6 ++--
vta/tests/python/unittest/test_vta_insn.py | 14 ++++----
vta/tutorials/autotvm/tune_relay_vta.py | 6 ++--
vta/tutorials/frontend/deploy_classification.py | 4 +--
vta/tutorials/frontend/legacy/deploy_detection.py | 2 +-
vta/tutorials/matrix_multiply.py | 4 +--
vta/tutorials/optimize/convolution_opt.py | 4 +--
vta/tutorials/optimize/matrix_multiply_opt.py | 4 +--
vta/tutorials/vta_get_started.py | 4 +--
web/tests/python/webgpu_rpc_test.py | 4 +--
web/tests/python/websock_rpc_test.py | 4 +--
332 files changed, 618 insertions(+), 619 deletions(-)
diff --git a/apps/android_camera/models/prepare_model.py b/apps/android_camera/models/prepare_model.py
index 19be368..ab20e02 100644
--- a/apps/android_camera/models/prepare_model.py
+++ b/apps/android_camera/models/prepare_model.py
@@ -25,7 +25,7 @@ import json
import tvm
import tvm.relay as relay
-from tvm.contrib import util, ndk, graph_runtime as runtime
+from tvm.contrib import utils, ndk, graph_runtime as runtime
from tvm.contrib.download import download_testdata, download
target = "llvm -mtriple=arm64-linux-android"
diff --git a/apps/android_rpc/tests/android_rpc_test.py b/apps/android_rpc/tests/android_rpc_test.py
index 2827c14..9586bff 100644
--- a/apps/android_rpc/tests/android_rpc_test.py
+++ b/apps/android_rpc/tests/android_rpc_test.py
@@ -25,7 +25,7 @@ import tvm
from tvm import te
import os
from tvm import rpc
-from tvm.contrib import util, ndk
+from tvm.contrib import utils, ndk
import numpy as np
# Set to be address of tvm proxy.
@@ -50,7 +50,7 @@ def test_rpc_module():
A = te.placeholder((n,), name="A")
B = te.compute(A.shape, lambda *i: A(*i) + 1.0, name="B")
a_np = np.random.uniform(size=1024).astype(A.dtype)
- temp = util.tempdir()
+ temp = utils.tempdir()
# Establish remote connection with target hardware
tracker = rpc.connect_tracker(tracker_host, tracker_port)
diff --git a/apps/benchmark/arm_cpu_imagenet_bench.py b/apps/benchmark/arm_cpu_imagenet_bench.py
index fb58819..e723337 100644
--- a/apps/benchmark/arm_cpu_imagenet_bench.py
+++ b/apps/benchmark/arm_cpu_imagenet_bench.py
@@ -23,7 +23,7 @@ import numpy as np
import tvm
from tvm import te
-from tvm.contrib.util import tempdir
+from tvm.contrib.utils import tempdir
import tvm.contrib.graph_runtime as runtime
from tvm import relay
diff --git a/apps/benchmark/mobile_gpu_imagenet_bench.py b/apps/benchmark/mobile_gpu_imagenet_bench.py
index b57f602..cf78c66 100644
--- a/apps/benchmark/mobile_gpu_imagenet_bench.py
+++ b/apps/benchmark/mobile_gpu_imagenet_bench.py
@@ -23,7 +23,7 @@ import numpy as np
import tvm
from tvm import te
-from tvm.contrib.util import tempdir
+from tvm.contrib.utils import tempdir
import tvm.contrib.graph_runtime as runtime
from tvm import relay
diff --git a/apps/ios_rpc/tests/ios_rpc_mobilenet.py b/apps/ios_rpc/tests/ios_rpc_mobilenet.py
index 132377a..90ac6bf 100644
--- a/apps/ios_rpc/tests/ios_rpc_mobilenet.py
+++ b/apps/ios_rpc/tests/ios_rpc_mobilenet.py
@@ -22,7 +22,7 @@ from tvm.relay.expr_functor import ExprMutator
from tvm.relay import transform
from tvm.relay.op.annotation import compiler_begin, compiler_end
from tvm.relay.quantize.quantize import prerequisite_optimize
-from tvm.contrib import util, xcode, graph_runtime, coreml_runtime
+from tvm.contrib import utils, xcode, graph_runtime, coreml_runtime
from tvm.contrib.target import coreml as _coreml
import os
@@ -98,7 +98,7 @@ def get_model(model_name, data_shape):
def test_mobilenet():
- temp = util.tempdir()
+ temp = utils.tempdir()
image, synset = prepare_input()
model, params = get_model("mobilenetv2_1.0", image.shape)
diff --git a/apps/ios_rpc/tests/ios_rpc_test.py b/apps/ios_rpc/tests/ios_rpc_test.py
index 620fe49..a967c2f 100644
--- a/apps/ios_rpc/tests/ios_rpc_test.py
+++ b/apps/ios_rpc/tests/ios_rpc_test.py
@@ -26,7 +26,7 @@ import os
import re
import sys
from tvm import rpc
-from tvm.contrib import util, xcode
+from tvm.contrib import utils, xcode
import numpy as np
# Set to be address of tvm proxy.
@@ -59,7 +59,7 @@ def test_rpc_module():
n = tvm.runtime.convert(1024)
A = te.placeholder((n,), name="A")
B = te.compute(A.shape, lambda *i: A(*i) + 1.0, name="B")
- temp = util.tempdir()
+ temp = utils.tempdir()
s = te.create_schedule(B.op)
xo, xi = s[B].split(B.op.axis[0], factor=64)
s[B].bind(xi, te.thread_axis("threadIdx.x"))
diff --git a/apps/topi_recipe/conv/depthwise_conv2d_test.py b/apps/topi_recipe/conv/depthwise_conv2d_test.py
index 036f1a4..94687ed 100644
--- a/apps/topi_recipe/conv/depthwise_conv2d_test.py
+++ b/apps/topi_recipe/conv/depthwise_conv2d_test.py
@@ -22,7 +22,7 @@ from scipy import signal
from tvm.contrib import nvcc
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.topi.cuda.depthwise_conv2d import (
schedule_depthwise_conv2d_nchw,
schedule_depthwise_conv2d_nhwc,
diff --git a/apps/topi_recipe/conv/test_conv2d_hwcn_map.py b/apps/topi_recipe/conv/test_conv2d_hwcn_map.py
index 1d2032d..d67bfdc 100644
--- a/apps/topi_recipe/conv/test_conv2d_hwcn_map.py
+++ b/apps/topi_recipe/conv/test_conv2d_hwcn_map.py
@@ -22,7 +22,7 @@ import tvm
from tvm import te
from tvm.contrib import nvcc
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
TASK = "conv2d_hwcn_map"
USE_MANUAL_CODE = False
diff --git a/apps/topi_recipe/gemm/android_gemm_square.py b/apps/topi_recipe/gemm/android_gemm_square.py
index 5228188..0e64dcd 100644
--- a/apps/topi_recipe/gemm/android_gemm_square.py
+++ b/apps/topi_recipe/gemm/android_gemm_square.py
@@ -19,7 +19,7 @@ import tvm
from tvm import te
import os
from tvm import rpc
-from tvm.contrib import util, ndk
+from tvm.contrib import utils, ndk
import numpy as np
# Set to be address of tvm proxy.
@@ -121,7 +121,7 @@ def test_gemm_gpu(N, times, bn, num_block, num_thread):
print(tvm.lower(s, [A, B, C], simple_mode=True))
f = tvm.build(s, [A, B, C], "opencl", target_host=target, name="gemm_gpu")
- temp = util.tempdir()
+ temp = utils.tempdir()
path_dso = temp.relpath("gemm_gpu.so")
f.export_library(path_dso, ndk.create_shared)
diff --git a/docs/api/python/contrib.rst b/docs/api/python/contrib.rst
index 8ac4e1f..0eb3024 100644
--- a/docs/api/python/contrib.rst
+++ b/docs/api/python/contrib.rst
@@ -122,9 +122,9 @@ tvm.contrib.tar
:members:
-tvm.contrib.util
-~~~~~~~~~~~~~~~~
-.. automodule:: tvm.contrib.util
+tvm.contrib.utils
+~~~~~~~~~~~~~~~~~
+.. automodule:: tvm.contrib.utils
:members:
diff --git a/docs/dev/introduction_to_module_serialization.rst b/docs/dev/introduction_to_module_serialization.rst
index 5451b84..6b2f2ad 100644
--- a/docs/dev/introduction_to_module_serialization.rst
+++ b/docs/dev/introduction_to_module_serialization.rst
@@ -32,7 +32,7 @@ Let us build one ResNet-18 workload for GPU as an example first.
from tvm import relay
from tvm.relay import testing
- from tvm.contrib import util
+ from tvm.contrib import utils
import tvm
# Resnet18 workload
@@ -43,7 +43,7 @@ Let us build one ResNet-18 workload for GPU as an example first.
_, resnet18_lib, _ = relay.build_module.build(resnet18_mod, "cuda", params=resnet18_params)
# create one tempory directory
- temp = util.tempdir()
+ temp = utils.tempdir()
# path lib
file_name = "deploy.so"
diff --git a/golang/sample/deploy.py b/golang/sample/deploy.py
index a0553cf..9882019 100644
--- a/golang/sample/deploy.py
+++ b/golang/sample/deploy.py
@@ -51,7 +51,7 @@ fadd = tvm.build(s, [A, B, C], tgt, target_host=tgt_host, name="myadd")
# Save Compiled Module
# --------------------
from tvm.contrib import cc
-from tvm.contrib import util
+from tvm.contrib import utils
fadd.save("deploy.o")
cc.create_shared("deploy.so", ["deploy.o"])
diff --git a/golang/src/util.go b/golang/src/utils.go
similarity index 98%
rename from golang/src/util.go
rename to golang/src/utils.go
index d3846d1..2da4138 100644
--- a/golang/src/util.go
+++ b/golang/src/utils.go
@@ -19,7 +19,7 @@
/*!
* \brief gotvm package source for common utilities
- * \file util.go
+ * \file utils.go
*/
package gotvm
diff --git a/jvm/README.md b/jvm/README.md
index 348e941..320e769 100644
--- a/jvm/README.md
+++ b/jvm/README.md
@@ -97,7 +97,7 @@ There's nothing special for this part. The following Python snippet generate add
import os
import tvm
from tvm import te
-from tvm.contrib import cc, util
+from tvm.contrib import cc, utils
def test_add(target_dir):
n = te.var("n")
diff --git a/jvm/core/src/test/scripts/test_add_cpu.py b/jvm/core/src/test/scripts/test_add_cpu.py
index 40edd08..4725dcb 100644
--- a/jvm/core/src/test/scripts/test_add_cpu.py
+++ b/jvm/core/src/test/scripts/test_add_cpu.py
@@ -18,7 +18,7 @@ import os
import tvm
from tvm import te
-from tvm.contrib import cc, util
+from tvm.contrib import cc, utils
def test_add(target_dir):
diff --git a/jvm/core/src/test/scripts/test_add_gpu.py b/jvm/core/src/test/scripts/test_add_gpu.py
index 7983930..040a447 100644
--- a/jvm/core/src/test/scripts/test_add_gpu.py
+++ b/jvm/core/src/test/scripts/test_add_gpu.py
@@ -18,7 +18,7 @@ import os
import tvm
from tvm import te
-from tvm.contrib import cc, util
+from tvm.contrib import cc, utils
def test_add(target_dir):
diff --git a/python/setup.py b/python/setup.py
index 24022e4..5333da0 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -16,7 +16,6 @@
# under the License.
# pylint: disable=invalid-name, exec-used
"""Setup TVM package."""
-from __future__ import absolute_import
import os
import shutil
import sys
diff --git a/python/tvm/auto_scheduler/auto_schedule.py b/python/tvm/auto_scheduler/auto_schedule.py
index a53c29d..5bc13fe 100644
--- a/python/tvm/auto_scheduler/auto_schedule.py
+++ b/python/tvm/auto_scheduler/auto_schedule.py
@@ -36,7 +36,7 @@ class HardwareParams(Object):
"""The parameters of target hardware used to guide the search policy
TODO(jcf94): This is considered to be merged with the new Target specification:
- https://discuss.tvm.ai/t/rfc-tvm-target-specification/6844
+ https://discuss.tvm.apache.org/t/rfc-tvm-target-specification/6844
Parameters
----------
diff --git a/python/tvm/autotvm/__init__.py b/python/tvm/autotvm/__init__.py
index 7eb1c8b..a3c5925 100644
--- a/python/tvm/autotvm/__init__.py
+++ b/python/tvm/autotvm/__init__.py
@@ -33,7 +33,7 @@ from . import measure
from . import record
from . import task
from . import tuner
-from . import util
+from . import utils
from . import env
from . import tophub
diff --git a/python/tvm/autotvm/graph_tuner/base_graph_tuner.py b/python/tvm/autotvm/graph_tuner/base_graph_tuner.py
index 40945ed..741b05f 100644
--- a/python/tvm/autotvm/graph_tuner/base_graph_tuner.py
+++ b/python/tvm/autotvm/graph_tuner/base_graph_tuner.py
@@ -509,7 +509,7 @@ class BaseGraphTuner(object):
# Rule out invalid layout transformations
out = topi.layout_transform(data, in_layout, out_layout)
out_flops = 1
- for i in topi.util.get_const_tuple(out.shape):
+ for i in topi.utils.get_const_tuple(out.shape):
out_flops *= i
if flops != out_flops:
diff --git a/python/tvm/autotvm/measure/measure_methods.py b/python/tvm/autotvm/measure/measure_methods.py
index 7032db6..913d62b 100644
--- a/python/tvm/autotvm/measure/measure_methods.py
+++ b/python/tvm/autotvm/measure/measure_methods.py
@@ -41,7 +41,7 @@ from tvm.error import TVMError
from tvm.driver import build
from tvm.contrib import nvcc, ndk, tar
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
from ..env import AutotvmGlobalScope
from ..task.space import InstantiationError
diff --git a/python/tvm/autotvm/task/space.py b/python/tvm/autotvm/task/space.py
index fb8cf57..cf9cd80 100644
--- a/python/tvm/autotvm/task/space.py
+++ b/python/tvm/autotvm/task/space.py
@@ -34,7 +34,7 @@ import numpy as np
from tvm.te import schedule, thread_axis
from tvm.tir import expr
-from tvm.autotvm.util import get_const_int
+from tvm.autotvm.utils import get_const_int
Axis = namedtuple("Axis", ["space", "index"])
diff --git a/python/tvm/autotvm/task/task.py b/python/tvm/autotvm/task/task.py
index 8822ba9..c8b50ad 100644
--- a/python/tvm/autotvm/task/task.py
+++ b/python/tvm/autotvm/task/task.py
@@ -29,7 +29,8 @@ from tvm.target import Target
from tvm.te import placeholder, tensor
from tvm.tir import expr
-from ..util import get_const_int, get_const_tuple
+
+from ..utils import get_const_int, get_const_tuple
from .dispatcher import ApplyConfig, DispatchContext
from .space import ConfigSpace
diff --git a/python/tvm/autotvm/tophub.py b/python/tvm/autotvm/tophub.py
index 2076ee7..e3170ba 100644
--- a/python/tvm/autotvm/tophub.py
+++ b/python/tvm/autotvm/tophub.py
@@ -30,7 +30,7 @@ from .task import ApplyHistoryBest
from ..target import Target
from ..contrib.download import download
from .record import load_from_file
-from .util import EmptyContext
+from .utils import EmptyContext
# environment variable to read TopHub location
AUTOTVM_TOPHUB_LOC_VAR = "TOPHUB_LOCATION"
diff --git a/python/tvm/autotvm/tuner/callback.py b/python/tvm/autotvm/tuner/callback.py
index bb9dafa..dc75de2 100644
--- a/python/tvm/autotvm/tuner/callback.py
+++ b/python/tvm/autotvm/tuner/callback.py
@@ -23,7 +23,7 @@ import logging
import numpy as np
from .. import record
-from ..util import format_si_prefix
+from ..utils import format_si_prefix
logger = logging.getLogger("autotvm")
diff --git a/python/tvm/autotvm/tuner/metric.py b/python/tvm/autotvm/tuner/metric.py
index 1ed04ab..f6932f8 100644
--- a/python/tvm/autotvm/tuner/metric.py
+++ b/python/tvm/autotvm/tuner/metric.py
@@ -19,7 +19,7 @@
import numpy as np
-from ..util import get_rank
+from ..utils import get_rank
def max_curve(trial_scores):
diff --git a/python/tvm/autotvm/tuner/sa_model_optimizer.py b/python/tvm/autotvm/tuner/sa_model_optimizer.py
index 5535246..401eda8 100644
--- a/python/tvm/autotvm/tuner/sa_model_optimizer.py
+++ b/python/tvm/autotvm/tuner/sa_model_optimizer.py
@@ -25,7 +25,7 @@ import time
import numpy as np
-from ..util import sample_ints
+from ..utils import sample_ints
from .model_based_tuner import ModelOptimizer, knob2point, point2knob
logger = logging.getLogger("autotvm")
diff --git a/python/tvm/autotvm/tuner/tuner.py b/python/tvm/autotvm/tuner/tuner.py
index b769d34..ba54291 100644
--- a/python/tvm/autotvm/tuner/tuner.py
+++ b/python/tvm/autotvm/tuner/tuner.py
@@ -22,7 +22,7 @@ import tempfile
import numpy as np
from ..measure import MeasureInput, create_measure_batch
-from ..util import format_si_prefix
+from ..utils import format_si_prefix
from ..env import GLOBAL_SCOPE
@@ -107,7 +107,7 @@ class Tuner(object):
with no return value. These callback functions will be called on
every measurement pair. See autotvm/tuner/callback.py for some examples.
si_prefix: str
- One of tvm.autotvm.util.SI_PREFIXES. The SI prefix to use when reporting FLOPS.
+ One of tvm.autotvm.utils.SI_PREFIXES. The SI prefix to use when reporting FLOPS.
"""
measure_batch = create_measure_batch(self.task, measure_option)
n_parallel = getattr(measure_batch, "n_parallel", 1)
diff --git a/python/tvm/autotvm/tuner/xgboost_cost_model.py b/python/tvm/autotvm/tuner/xgboost_cost_model.py
index f66764c..14bc683 100644
--- a/python/tvm/autotvm/tuner/xgboost_cost_model.py
+++ b/python/tvm/autotvm/tuner/xgboost_cost_model.py
@@ -29,7 +29,7 @@ except ImportError:
xgb = None
from .. import feature
-from ..util import get_rank
+from ..utils import get_rank
from .metric import max_curve, recall_curve, cover_curve
from .model_based_tuner import CostModel, FeatureCache
diff --git a/python/tvm/autotvm/util.py b/python/tvm/autotvm/utils.py
similarity index 100%
rename from python/tvm/autotvm/util.py
rename to python/tvm/autotvm/utils.py
diff --git a/python/tvm/contrib/binutil.py b/python/tvm/contrib/binutils.py
similarity index 98%
rename from python/tvm/contrib/binutil.py
rename to python/tvm/contrib/binutils.py
index b0f36c8..646362a 100644
--- a/python/tvm/contrib/binutil.py
+++ b/python/tvm/contrib/binutils.py
@@ -19,7 +19,7 @@
import os
import subprocess
import tvm._ffi
-from . import util
+from . import utils
# TODO does this file still belong in `contrib`. is it too µTVM-specific?
@@ -217,7 +217,7 @@ def tvm_callback_relocate_binary(
stack_pointer_init=stack_pointer_init,
)
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
rel_obj_path = tmp_dir.relpath("relocated.obj")
rel_ld_script_path = tmp_dir.relpath("relocate.lds")
with open(rel_ld_script_path, "w") as f:
@@ -265,7 +265,7 @@ def tvm_callback_read_binary_section(binary, section, toolchain_prefix):
section_bin : bytearray
contents of the read section
"""
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_bin = tmp_dir.relpath("temp.bin")
tmp_section = tmp_dir.relpath("tmp_section.bin")
with open(tmp_bin, "wb") as out_file:
@@ -306,7 +306,7 @@ def tvm_callback_get_symbol_map(binary, toolchain_prefix):
map of defined symbols to addresses, encoded as a series of
alternating newline-separated keys and values
"""
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_obj = tmp_dir.relpath("tmp_obj.bin")
with open(tmp_obj, "wb") as out_file:
out_file.write(bytes(binary))
diff --git a/python/tvm/contrib/clang.py b/python/tvm/contrib/clang.py
index edc1200..9894447 100644
--- a/python/tvm/contrib/clang.py
+++ b/python/tvm/contrib/clang.py
@@ -20,7 +20,7 @@ import subprocess
from tvm._ffi.base import py_str
import tvm.target
-from . import util
+from . import utils
def find_clang(required=True):
@@ -49,7 +49,7 @@ def find_clang(required=True):
cc_list += ["clang-%d" % major]
cc_list += ["clang"]
cc_list += ["clang.exe"]
- valid_list = [util.which(x) for x in cc_list]
+ valid_list = [utils.which(x) for x in cc_list]
valid_list = [x for x in valid_list if x]
if not valid_list and required:
raise RuntimeError("cannot find clang, candidates are: " + str(cc_list))
@@ -83,12 +83,12 @@ def create_llvm(inputs, output=None, options=None, cc=None):
cc = cc if cc else find_clang()[0]
cmd = [cc]
cmd += ["-S", "-emit-llvm"]
- temp = util.tempdir()
+ temp = utils.tempdir()
output = output if output else temp.relpath("output.ll")
inputs = [inputs] if isinstance(inputs, str) else inputs
input_files = []
for i, code in enumerate(inputs):
- if util.is_source_path(code):
+ if utils.is_source_path(code):
input_files.append(code)
else:
temp_path = temp.relpath("input%d.cc" % i)
diff --git a/python/tvm/contrib/nvcc.py b/python/tvm/contrib/nvcc.py
index f958c1f..53a507f 100644
--- a/python/tvm/contrib/nvcc.py
+++ b/python/tvm/contrib/nvcc.py
@@ -25,7 +25,7 @@ import warnings
import tvm._ffi
from tvm.runtime import ndarray as nd
-from . import util
+from . import utils
from .._ffi.base import py_str
@@ -54,7 +54,7 @@ def compile_cuda(code, target="ptx", arch=None, options=None, path_target=None):
cubin : bytearray
The bytearray of the cubin
"""
- temp = util.tempdir()
+ temp = utils.tempdir()
if target not in ["cubin", "ptx", "fatbin"]:
raise ValueError("target must be in cubin, ptx, fatbin")
temp_code = temp.relpath("my_kernel.cu")
diff --git a/python/tvm/contrib/peak.py b/python/tvm/contrib/peak.py
index d9dd536..62ee9fe 100644
--- a/python/tvm/contrib/peak.py
+++ b/python/tvm/contrib/peak.py
@@ -20,13 +20,13 @@
import logging
import tvm
from tvm import te
-from . import util
+from . import utils
from .. import rpc
def _convert_to_remote(func, remote):
""" convert module function to remote rpc function"""
- temp = util.tempdir()
+ temp = utils.tempdir()
path_dso = temp.relpath("tmp_func.tar")
func.export_library(path_dso)
diff --git a/python/tvm/contrib/rocm.py b/python/tvm/contrib/rocm.py
index 7b222f3..e69b255 100644
--- a/python/tvm/contrib/rocm.py
+++ b/python/tvm/contrib/rocm.py
@@ -23,7 +23,7 @@ from tvm._ffi.base import py_str
import tvm.runtime
import tvm.target
-from . import util
+from . import utils
def find_lld(required=True):
@@ -51,7 +51,7 @@ def find_lld(required=True):
lld_list += ["ld.lld-%d.0" % major]
lld_list += ["ld.lld-%d" % major]
lld_list += ["ld.lld"]
- valid_list = [util.which(x) for x in lld_list]
+ valid_list = [utils.which(x) for x in lld_list]
valid_list = [x for x in valid_list if x]
if not valid_list and required:
raise RuntimeError("cannot find ld.lld, candidates are: " + str(lld_list))
@@ -97,7 +97,7 @@ def callback_rocm_link(obj_bin):
cobj_bin : bytearray
The HSA Code Object
"""
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_obj = tmp_dir.relpath("rocm_kernel.o")
tmp_cobj = tmp_dir.relpath("rocm_kernel.co")
with open(tmp_obj, "wb") as out_file:
diff --git a/python/tvm/contrib/sdaccel.py b/python/tvm/contrib/sdaccel.py
index b88fa4c..930752c 100644
--- a/python/tvm/contrib/sdaccel.py
+++ b/python/tvm/contrib/sdaccel.py
@@ -19,7 +19,7 @@ import subprocess
import os
import tvm._ffi
-from . import util
+from . import utils
@tvm._ffi.register_func("tvm_callback_sdaccel_compile")
@@ -40,7 +40,7 @@ def compile_vhls(kernel_info, device_name):
xclbin : bytearray
The bytearray of the xclbin
"""
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
sdk = os.environ.get("XILINX_SDX", None)
xocc = os.path.join(sdk, "bin/xocc") if sdk else "xocc"
diff --git a/python/tvm/contrib/spirv.py b/python/tvm/contrib/spirv.py
index a5d8471..94b24d0 100644
--- a/python/tvm/contrib/spirv.py
+++ b/python/tvm/contrib/spirv.py
@@ -17,7 +17,7 @@
"""Utility for Interacting with SPIRV Tools"""
import subprocess
import os
-from . import util
+from . import utils
from .._ffi.base import py_str
@@ -37,7 +37,7 @@ def optimize(spv_bin):
The HSA Code Object
"""
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_in = tmp_dir.relpath("input.spv")
tmp_out = tmp_dir.relpath("output.spv")
with open(tmp_in, "wb") as out_file:
diff --git a/python/tvm/contrib/tar.py b/python/tvm/contrib/tar.py
index bcc34a1..3548877 100644
--- a/python/tvm/contrib/tar.py
+++ b/python/tvm/contrib/tar.py
@@ -21,7 +21,7 @@ from __future__ import absolute_import as _abs
import os
import shutil
import subprocess
-from . import util
+from . import utils
from .._ffi.base import py_str
@@ -38,7 +38,7 @@ def tar(output, files):
"""
cmd = ["tar"]
cmd += ["-czf"]
- temp = util.tempdir()
+ temp = utils.tempdir()
fset = set()
for fname in files:
base = os.path.basename(fname)
diff --git a/python/tvm/contrib/util.py b/python/tvm/contrib/utils.py
similarity index 100%
rename from python/tvm/contrib/util.py
rename to python/tvm/contrib/utils.py
diff --git a/python/tvm/contrib/xcode.py b/python/tvm/contrib/xcode.py
index 13bd747..0c0dac1 100644
--- a/python/tvm/contrib/xcode.py
+++ b/python/tvm/contrib/xcode.py
@@ -23,7 +23,7 @@ import sys
import subprocess
import json
from .._ffi.base import py_str
-from . import util
+from . import utils
def xcrun(cmd):
@@ -132,7 +132,7 @@ def compile_metal(code, path_target=None, sdk="macosx"):
metallib : bytearray
The bytearray of the metallib
"""
- temp = util.tempdir()
+ temp = utils.tempdir()
temp_code = temp.relpath("my_lib.metal")
temp_ir = temp.relpath("my_lib.air")
temp_target = temp.relpath("my_lib.metallib")
@@ -248,7 +248,7 @@ def popen_test_rpc(host, port, key, destination, libs=None, options=None):
)
# Lock the path so only one file can run
- lock = util.filelock(os.path.join(rpc_root, "ios_rpc.lock"))
+ lock = utils.filelock(os.path.join(rpc_root, "ios_rpc.lock"))
with open(os.path.join(rpc_root, "rpc_config.txt"), "w") as fo:
fo.write("%s %d %s\n" % (host, port, key))
diff --git a/python/tvm/driver/tvmc/compiler.py b/python/tvm/driver/tvmc/compiler.py
index 8001ee2..eeb5d07 100644
--- a/python/tvm/driver/tvmc/compiler.py
+++ b/python/tvm/driver/tvmc/compiler.py
@@ -26,7 +26,7 @@ import tvm
from tvm import autotvm
from tvm import relay
from tvm.contrib import cc
-from tvm.contrib import util
+from tvm.contrib import utils
from . import common, frontends
from .main import register_parser
@@ -238,7 +238,7 @@ def save_module(module_path, graph, lib, params, cross=None):
lib_name = "mod.so"
graph_name = "mod.json"
param_name = "mod.params"
- temp = util.tempdir()
+ temp = utils.tempdir()
path_lib = temp.relpath(lib_name)
if not cross:
logger.debug("exporting library to %s", path_lib)
diff --git a/python/tvm/error.py b/python/tvm/error.py
index d7628a7..819f064 100644
--- a/python/tvm/error.py
+++ b/python/tvm/error.py
@@ -50,7 +50,7 @@ class InternalError(TVMError):
if "TVM hint:" not in msg:
msg += (
"\nTVM hint: You hit an internal error. "
- + "Please open a thread on https://discuss.tvm.ai/ to report it."
+ + "Please open a thread on https://discuss.tvm.apache.org/ to report it."
)
super(InternalError, self).__init__(msg)
diff --git a/python/tvm/micro/build.py b/python/tvm/micro/build.py
index 908bc96..d1a3c41 100644
--- a/python/tvm/micro/build.py
+++ b/python/tvm/micro/build.py
@@ -21,7 +21,7 @@ import copy
import logging
import os
import re
-from tvm.contrib import util
+from tvm.contrib import utils
_LOG = logging.getLogger(__name__)
@@ -32,11 +32,11 @@ class Workspace:
def __init__(self, root=None, debug=False):
if debug or root is not None:
- with util.TempDirectory.set_keep_for_debug():
- self.tempdir = util.tempdir(custom_path=root)
+ with utils.TempDirectory.set_keep_for_debug():
+ self.tempdir = utils.tempdir(custom_path=root)
_LOG.info("Created debug mode workspace at: %s", self.tempdir.temp_dir)
else:
- self.tempdir = util.tempdir()
+ self.tempdir = utils.tempdir()
def relpath(self, path):
return self.tempdir.relpath(path)
diff --git a/python/tvm/micro/compiler.py b/python/tvm/micro/compiler.py
index 307c980..069f600 100644
--- a/python/tvm/micro/compiler.py
+++ b/python/tvm/micro/compiler.py
@@ -22,7 +22,7 @@ import glob
import os
import re
-from tvm.contrib import binutil
+from tvm.contrib import binutils
import tvm.target
from . import build
from . import class_factory
@@ -232,13 +232,13 @@ class DefaultCompiler(Compiler):
output_filename = f"{src_base}.o"
output_abspath = os.path.join(output, output_filename)
- binutil.run_cmd(args + ["-c", "-o", output_abspath, src])
+ binutils.run_cmd(args + ["-c", "-o", output_abspath, src])
outputs.append(output_abspath)
output_filename = f"{os.path.basename(output)}.a"
output_abspath = os.path.join(output, output_filename)
- binutil.run_cmd([prefix + "ar", "-r", output_abspath] + outputs)
- binutil.run_cmd([prefix + "ranlib", output_abspath])
+ binutils.run_cmd([prefix + "ar", "-r", output_abspath] + outputs)
+ binutils.run_cmd([prefix + "ranlib", output_abspath])
return tvm.micro.MicroLibrary(output, [output_filename])
@@ -273,7 +273,7 @@ class DefaultCompiler(Compiler):
for lib_name in obj.library_files:
args.append(obj.abspath(lib_name))
- binutil.run_cmd(args)
+ binutils.run_cmd(args)
return tvm.micro.MicroBinary(output, output_filename, [])
@property
diff --git a/python/tvm/micro/micro_library.py b/python/tvm/micro/micro_library.py
index b287650..74687ed 100644
--- a/python/tvm/micro/micro_library.py
+++ b/python/tvm/micro/micro_library.py
@@ -17,7 +17,7 @@
"""Defines an Artifact subclass that describes a compiled static library."""
-from tvm.contrib import util
+from tvm.contrib import utils
from . import artifact
from . import compiler
@@ -79,7 +79,7 @@ def create_micro_library(output, objects, options=None):
options : Optional[List[str]]
If given, additional command-line flags for the compiler.
"""
- temp_dir = util.tempdir()
+ temp_dir = utils.tempdir()
comp = compiler.DefaultCompiler()
output = temp_dir.relpath("micro-library.o")
comp.library(output, objects, options=options)
diff --git a/python/tvm/relay/backend/vm.py b/python/tvm/relay/backend/vm.py
index b0a5e98..0f7875a 100644
--- a/python/tvm/relay/backend/vm.py
+++ b/python/tvm/relay/backend/vm.py
@@ -223,7 +223,7 @@ class VMCompiler(object):
if isinstance(autotvm.DispatchContext.current, autotvm.FallbackContext):
tophub_context = autotvm.tophub.context(list(target.values()))
else:
- tophub_context = autotvm.util.EmptyContext()
+ tophub_context = autotvm.utils.EmptyContext()
return tophub_context
diff --git a/python/tvm/relay/build_module.py b/python/tvm/relay/build_module.py
index bd0c3e5..35bd8e6 100644
--- a/python/tvm/relay/build_module.py
+++ b/python/tvm/relay/build_module.py
@@ -253,7 +253,7 @@ def build(mod, target=None, target_host=None, params=None, mod_name="default"):
if isinstance(autotvm.DispatchContext.current, autotvm.FallbackContext):
tophub_context = autotvm.tophub.context(list(target.values()))
else:
- tophub_context = autotvm.util.EmptyContext()
+ tophub_context = autotvm.utils.EmptyContext()
with tophub_context:
bld_mod = BuildModule()
@@ -307,7 +307,7 @@ def optimize(mod, target=None, params=None):
if isinstance(autotvm.DispatchContext.current, autotvm.FallbackContext):
tophub_context = autotvm.tophub.context(list(target.values()))
else:
- tophub_context = autotvm.util.EmptyContext()
+ tophub_context = autotvm.utils.EmptyContext()
with tophub_context:
bld_mod = BuildModule()
diff --git a/python/tvm/relay/frontend/common.py b/python/tvm/relay/frontend/common.py
index b27c759..ae51f21 100644
--- a/python/tvm/relay/frontend/common.py
+++ b/python/tvm/relay/frontend/common.py
@@ -22,7 +22,7 @@ import numpy as np
import tvm
from tvm.ir import IRModule
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .. import expr as _expr
from .. import function as _function
diff --git a/python/tvm/relay/frontend/mxnet.py b/python/tvm/relay/frontend/mxnet.py
index a543f78..2242be1 100644
--- a/python/tvm/relay/frontend/mxnet.py
+++ b/python/tvm/relay/frontend/mxnet.py
@@ -23,7 +23,7 @@ import tvm
from tvm.ir import IRModule
from tvm import relay
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .. import analysis
from .. import expr as _expr
from .. import function as _function
diff --git a/python/tvm/relay/frontend/onnx.py b/python/tvm/relay/frontend/onnx.py
index ccf644e..fa404ef 100644
--- a/python/tvm/relay/frontend/onnx.py
+++ b/python/tvm/relay/frontend/onnx.py
@@ -21,7 +21,7 @@ import warnings
import numpy as np
import tvm
from tvm.ir import IRModule
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from ... import nd as _nd
from .. import analysis
@@ -2649,7 +2649,7 @@ def from_onnx(model, shape=None, dtype="float32", opset=None, freeze_params=Fals
retains that dynamism upon import, and the compiler attempts to convert the
model into a static shapes at compile time. If this fails, there may still
be dynamic operations in the model. Not all TVM kernels currently support
- dynamic shapes, please file an issue on discuss.tvm.ai
+ dynamic shapes, please file an issue on discuss.tvm.apache.org
if you hit an error with dynamic kernels.
Parameters
diff --git a/python/tvm/relay/frontend/pytorch.py b/python/tvm/relay/frontend/pytorch.py
index 8d16431..d8c0769 100644
--- a/python/tvm/relay/frontend/pytorch.py
+++ b/python/tvm/relay/frontend/pytorch.py
@@ -25,7 +25,7 @@ import sys
import numpy as np
import tvm
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .. import analysis as _analysis
from .. import expr as _expr
diff --git a/python/tvm/relay/frontend/tensorflow.py b/python/tvm/relay/frontend/tensorflow.py
index 89b3625..218c6e5 100644
--- a/python/tvm/relay/frontend/tensorflow.py
+++ b/python/tvm/relay/frontend/tensorflow.py
@@ -27,7 +27,7 @@ import tvm
from tvm.ir import IRModule
from tvm.relay.prelude import Prelude, StaticTensorArrayOps, get_tensor_array_shape
from tvm.relay.transform import InferType
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .. import analysis
from .. import expr as _expr
diff --git a/python/tvm/relay/frontend/tensorflow_parser.py b/python/tvm/relay/frontend/tensorflow_parser.py
index 3c1d342..b1b10eb 100644
--- a/python/tvm/relay/frontend/tensorflow_parser.py
+++ b/python/tvm/relay/frontend/tensorflow_parser.py
@@ -18,7 +18,7 @@
# pylint: disable=import-outside-toplevel, assignment-from-no-return
import os
-from tvm.contrib import util
+from tvm.contrib import utils
class TFParser(object):
@@ -45,7 +45,7 @@ class TFParser(object):
def __init__(self, model_dir, outputs=None):
from tensorflow.core.framework import graph_pb2
- self._tmp_dir = util.tempdir()
+ self._tmp_dir = utils.tempdir()
self._model_dir = model_dir
self._graph = graph_pb2.GraphDef()
self._outputs = outputs or []
diff --git a/python/tvm/relay/op/_reduce.py b/python/tvm/relay/op/_reduce.py
index 604098f..2872640 100644
--- a/python/tvm/relay/op/_reduce.py
+++ b/python/tvm/relay/op/_reduce.py
@@ -19,7 +19,7 @@ from __future__ import absolute_import
from tvm.runtime import convert
from tvm.te.hybrid import script
-from tvm.topi.util import get_const_int, get_const_tuple
+from tvm.topi.utils import get_const_int, get_const_tuple
from . import op as _reg
_reg.register_reduce_schedule("argmax")
diff --git a/python/tvm/relay/op/_tensor_grad.py b/python/tvm/relay/op/_tensor_grad.py
index 9f4f20c..b070d9f 100644
--- a/python/tvm/relay/op/_tensor_grad.py
+++ b/python/tvm/relay/op/_tensor_grad.py
@@ -16,12 +16,11 @@
# under the License.
# pylint: disable=invalid-name, unused-argument
"""Backend compiler related feature registration"""
-from __future__ import absolute_import
-
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.error import OpError
+
from ..expr import Tuple, TupleGetItem, const, Var
from ..ty import TensorType
from ..loops import while_loop
diff --git a/python/tvm/relay/op/_transform.py b/python/tvm/relay/op/_transform.py
index 156c5b7..edcd5b9 100644
--- a/python/tvm/relay/op/_transform.py
+++ b/python/tvm/relay/op/_transform.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm.te.hybrid import script
from tvm.runtime import convert
from tvm import topi
-from tvm.topi.util import get_const_int, get_const_tuple
+from tvm.topi.utils import get_const_int, get_const_tuple
from . import op as _reg
from . import strategy
from .op import OpPattern
diff --git a/python/tvm/relay/op/dyn/image/_image.py b/python/tvm/relay/op/dyn/image/_image.py
index cc00998..e341579 100644
--- a/python/tvm/relay/op/dyn/image/_image.py
+++ b/python/tvm/relay/op/dyn/image/_image.py
@@ -21,7 +21,7 @@ from __future__ import absolute_import
import tvm.topi
from tvm.runtime import convert
from tvm.te.hybrid import script
-from tvm.topi.util import nchw_pack_layout, nchw_xc_layout
+from tvm.topi.utils import nchw_pack_layout, nchw_xc_layout
from ... import op as reg
diff --git a/python/tvm/relay/op/image/_image.py b/python/tvm/relay/op/image/_image.py
index adbed84..c0cdf64 100644
--- a/python/tvm/relay/op/image/_image.py
+++ b/python/tvm/relay/op/image/_image.py
@@ -22,7 +22,7 @@ from tvm.te.hybrid import script
from tvm.runtime import convert
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .. import op as reg
from .. import strategy
from ..op import OpPattern
diff --git a/python/tvm/relay/op/nn/_nn.py b/python/tvm/relay/op/nn/_nn.py
index c992664..c235f87 100644
--- a/python/tvm/relay/op/nn/_nn.py
+++ b/python/tvm/relay/op/nn/_nn.py
@@ -19,7 +19,7 @@
from __future__ import absolute_import
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.runtime import convert
from tvm.te.hybrid import script
diff --git a/python/tvm/relay/op/nn/nn.py b/python/tvm/relay/op/nn/nn.py
index 1aad4e7..0d01254 100644
--- a/python/tvm/relay/op/nn/nn.py
+++ b/python/tvm/relay/op/nn/nn.py
@@ -20,7 +20,7 @@ from tvm.relay import expr
from . import _make
from ..dyn.nn import _make as _dyn_make
-from .util import get_pad_tuple1d, get_pad_tuple2d, get_pad_tuple3d
+from .utils import get_pad_tuple1d, get_pad_tuple2d, get_pad_tuple3d
from ...expr import const, Expr
diff --git a/python/tvm/relay/op/nn/util.py b/python/tvm/relay/op/nn/utils.py
similarity index 100%
rename from python/tvm/relay/op/nn/util.py
rename to python/tvm/relay/op/nn/utils.py
diff --git a/python/tvm/relay/op/strategy/arm_cpu.py b/python/tvm/relay/op/strategy/arm_cpu.py
index 6759a54..985124e 100644
--- a/python/tvm/relay/op/strategy/arm_cpu.py
+++ b/python/tvm/relay/op/strategy/arm_cpu.py
@@ -180,7 +180,7 @@ def conv2d_strategy_arm_cpu(attrs, inputs, out_type, target):
# This schedule has incorrect result on some hardware platforms (like NV Jetson TX2)
# Let us comment it out but not remove.
# see discussion:
- # https://discuss.tvm.ai/t/autotuner-incorrect-result-after-tuning-mobilenetv2-on-arm-cpu/6088
+ # https://discuss.tvm.apache.org/t/autotuner-incorrect-result-after-tuning-mobilenetv2-on-arm-cpu/6088
# strategy.add_implementation(
# wrap_compute_conv2d(topi.arm_cpu.depthwise_conv2d_nchw_spatial_pack),
# wrap_topi_schedule(topi.arm_cpu.schedule_depthwise_conv2d_nchw_spatial_pack),
diff --git a/python/tvm/relay/op/strategy/generic.py b/python/tvm/relay/op/strategy/generic.py
index 8933c38..f1d1019 100644
--- a/python/tvm/relay/op/strategy/generic.py
+++ b/python/tvm/relay/op/strategy/generic.py
@@ -20,7 +20,7 @@ import logging
import re
from tvm import topi
-from tvm.topi.util import get_const_int, get_const_float, get_const_tuple, get_float_tuple
+from tvm.topi.utils import get_const_int, get_const_float, get_const_tuple, get_float_tuple
from .. import op as _op
from ....target import generic_func, override_native_generic_func
diff --git a/python/tvm/relay/op/vision/_rcnn.py b/python/tvm/relay/op/vision/_rcnn.py
index a5cc266..46eb3cb 100644
--- a/python/tvm/relay/op/vision/_rcnn.py
+++ b/python/tvm/relay/op/vision/_rcnn.py
@@ -17,7 +17,7 @@
# pylint: disable=invalid-name, unused-argument
"""Faster R-CNN and Mask R-CNN operations."""
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .. import op as reg
from .. import strategy
from ..op import OpPattern
diff --git a/python/tvm/relay/qnn/op/qnn.py b/python/tvm/relay/qnn/op/qnn.py
index e4a6cbf4..3f23d68 100644
--- a/python/tvm/relay/qnn/op/qnn.py
+++ b/python/tvm/relay/qnn/op/qnn.py
@@ -19,7 +19,7 @@
from __future__ import absolute_import as _abs
from tvm.relay.expr import Tuple, TupleWrapper
-from tvm.relay.op.nn.util import get_pad_tuple2d
+from tvm.relay.op.nn.utils import get_pad_tuple2d
from . import _make
diff --git a/python/tvm/relay/transform/transform.py b/python/tvm/relay/transform/transform.py
index 060547e..f0f55f6 100644
--- a/python/tvm/relay/transform/transform.py
+++ b/python/tvm/relay/transform/transform.py
@@ -422,7 +422,7 @@ def ConvertLayout(desired_layouts):
parser and relay.build call. This is very helpful for hardware backends that support/prefer only
type of data layout.
- RFC - https://discuss.tvm.ai/t/layout-conversion-pass/4009
+ RFC - https://discuss.tvm.apache.org/t/layout-conversion-pass/4009
This pass uses most of the AlterOpLayout and InferCorrectLayout infrastructure. We can define
new layouts for conv2d ops for now. Most of the other operators try to adapt to their input
diff --git a/python/tvm/rpc/client.py b/python/tvm/rpc/client.py
index b9ad94d..a50f3b8 100644
--- a/python/tvm/rpc/client.py
+++ b/python/tvm/rpc/client.py
@@ -22,7 +22,7 @@ import struct
import time
import tvm._ffi
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm._ffi.base import TVMError
from tvm.runtime import ndarray as nd
@@ -244,7 +244,7 @@ class LocalSession(RPCSession):
@tvm._ffi.register_func("rpc.PopenSession")
def _popen_session(binary):
- temp = util.tempdir()
+ temp = utils.tempdir()
if isinstance(binary, (bytes, bytearray)):
path_exec = temp.relpath("server.minrpc")
diff --git a/python/tvm/rpc/server.py b/python/tvm/rpc/server.py
index 7287234..9489a73 100644
--- a/python/tvm/rpc/server.py
+++ b/python/tvm/rpc/server.py
@@ -42,7 +42,7 @@ import tvm._ffi
from tvm._ffi.base import py_str
from tvm._ffi.libinfo import find_lib_path
from tvm.runtime.module import load_module as _load_module
-from tvm.contrib import util
+from tvm.contrib import utils
from . import _ffi_api
from . import base
from .base import TrackerCode
@@ -55,7 +55,7 @@ def _server_env(load_library, work_path=None):
if work_path:
temp = work_path
else:
- temp = util.tempdir()
+ temp = utils.tempdir()
# pylint: disable=unused-variable
@tvm._ffi.register_func("tvm.rpc.server.workpath", override=True)
@@ -89,7 +89,7 @@ def _server_env(load_library, work_path=None):
# Extra dependencies during runtime.
from tvm.contrib import cc as _cc, tar as _tar
- tar_temp = util.tempdir(custom_path=path.replace(".tar", ""))
+ tar_temp = utils.tempdir(custom_path=path.replace(".tar", ""))
_tar.untar(path, tar_temp.temp_dir)
files = [tar_temp.relpath(x) for x in tar_temp.listdir()]
_cc.create_shared(path + ".so", files, cc=cc)
@@ -230,7 +230,7 @@ def _listen_loop(sock, port, rpc_key, tracker_addr, load_library, custom_addr):
raise exc
# step 3: serving
- work_path = util.tempdir()
+ work_path = utils.tempdir()
logger.info("connection from %s", addr)
server_proc = multiprocessing.Process(
target=_serve_loop, args=(conn, addr, load_library, work_path)
diff --git a/python/tvm/runtime/module.py b/python/tvm/runtime/module.py
index 0559a01..cef6173 100644
--- a/python/tvm/runtime/module.py
+++ b/python/tvm/runtime/module.py
@@ -277,7 +277,7 @@ class Module(object):
raise RuntimeError("Cannot call export_library in runtime only mode")
# Extra dependencies during runtime.
from pathlib import Path
- from tvm.contrib import cc as _cc, tar as _tar, util as _util
+ from tvm.contrib import cc as _cc, tar as _tar, utils as _utils
if isinstance(file_name, Path):
file_name = str(file_name)
@@ -292,7 +292,7 @@ class Module(object):
return
modules = self._collect_dso_modules()
- temp = _util.tempdir()
+ temp = _utils.tempdir()
files = addons if addons else []
is_system_lib = False
has_c_module = False
@@ -408,9 +408,9 @@ def load_module(path, fmt=""):
path += ".so"
elif path.endswith(".tar"):
# Extra dependencies during runtime.
- from tvm.contrib import cc as _cc, util as _util, tar as _tar
+ from tvm.contrib import cc as _cc, utils as _utils, tar as _tar
- tar_temp = _util.tempdir(custom_path=path.replace(".tar", ""))
+ tar_temp = _utils.tempdir(custom_path=path.replace(".tar", ""))
_tar.untar(path, tar_temp.temp_dir)
files = [tar_temp.relpath(x) for x in tar_temp.listdir()]
_cc.create_shared(path + ".so", files, cc=cc)
diff --git a/python/tvm/runtime/vm.py b/python/tvm/runtime/vm.py
index 81a909b..448cb13 100644
--- a/python/tvm/runtime/vm.py
+++ b/python/tvm/runtime/vm.py
@@ -120,7 +120,7 @@ class Executable(object):
executable = relay.vm.compile(mod, target)
code, lib = executable.save()
# save and load the code and lib file.
- tmp = tvm.contrib.util.tempdir()
+ tmp = tvm.contrib.utils.tempdir()
path_lib = tmp.relpath("lib.so")
lib.export_library(path_lib)
with open(tmp.relpath("code.ro"), "wb") as fo:
diff --git a/python/tvm/te/hybrid/module.py b/python/tvm/te/hybrid/module.py
index 2af6785..beea884 100644
--- a/python/tvm/te/hybrid/module.py
+++ b/python/tvm/te/hybrid/module.py
@@ -23,7 +23,7 @@ To enable this feature, you need to build with -DUSE_HYBRID_DUMP=ON.
import ast
-from tvm.contrib import util
+from tvm.contrib import utils
from .utils import _internal_assert
from .utils import _is_tvm_arg_types
from .parser import source_to_op
@@ -48,7 +48,7 @@ class HybridModule(object):
"""
self.src_ = self.name = self.func_ = self.root_ = None
if src is not None:
- temp = util.tempdir()
+ temp = utils.tempdir()
dst = temp.relpath("script.py")
with open(dst, "w") as f:
f.write("import tvm\n@tvm.te.hybrid.script\n%s" % src)
diff --git a/python/tvm/topi/__init__.py b/python/tvm/topi/__init__.py
index 2d44545..97951d9 100644
--- a/python/tvm/topi/__init__.py
+++ b/python/tvm/topi/__init__.py
@@ -48,7 +48,7 @@ from . import arm_cpu
from . import mali
from . import bifrost
from . import intel_graphics
-from . import util
+from . import utils
from . import rocm
from . import vision
from . import image
@@ -56,7 +56,7 @@ from . import sparse
from . import hls
# error reporting
-from .util import InvalidShapeError
+from .utils import InvalidShapeError
# not import testing by default
# because testing can have extra deps that are not necessary
diff --git a/python/tvm/topi/arm_cpu/bitserial_conv2d.py b/python/tvm/topi/arm_cpu/bitserial_conv2d.py
index fb22930..88940a0 100644
--- a/python/tvm/topi/arm_cpu/bitserial_conv2d.py
+++ b/python/tvm/topi/arm_cpu/bitserial_conv2d.py
@@ -25,8 +25,8 @@ from .. import tag
from ..nn.pad import pad
from ..nn.bitserial_conv2d import bitserial_conv2d_legalize
from ..nn.bitserial_util import bitpack, binary_op_multiplier
-from ..nn.util import get_pad_tuple
-from ..util import get_const_int, get_const_tuple
+from ..nn.utils import get_pad_tuple
+from ..utils import get_const_int, get_const_tuple
def _kernel_vec_spatial_pack_nhwc(kernel, kernel_bits, VC, use_bitpack=True):
diff --git a/python/tvm/topi/arm_cpu/bitserial_dense.py b/python/tvm/topi/arm_cpu/bitserial_dense.py
index 61778b7..8ceab51 100644
--- a/python/tvm/topi/arm_cpu/bitserial_dense.py
+++ b/python/tvm/topi/arm_cpu/bitserial_dense.py
@@ -20,7 +20,7 @@ from __future__ import absolute_import as _abs
import tvm
from tvm import te
from tvm import autotvm
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .. import tag
from .bitserial_conv2d import _intrin_popcount
from ..nn.pad import pad
diff --git a/python/tvm/topi/arm_cpu/conv2d.py b/python/tvm/topi/arm_cpu/conv2d.py
index b7f94f7..7dbbf9d 100644
--- a/python/tvm/topi/arm_cpu/conv2d.py
+++ b/python/tvm/topi/arm_cpu/conv2d.py
@@ -23,9 +23,9 @@ from tvm import te
from tvm import autotvm
import tvm.contrib.nnpack
-from ..util import traverse_inline, get_const_tuple
+from ..utils import traverse_inline, get_const_tuple
from .. import nn
-from ..nn.util import get_const_int, get_pad_tuple
+from ..nn.utils import get_const_int, get_pad_tuple
from ..nn.winograd_util import winograd_transform_matrices
from .conv2d_spatial_pack import (
conv2d_spatial_pack_nchw,
diff --git a/python/tvm/topi/arm_cpu/conv2d_alter_op.py b/python/tvm/topi/arm_cpu/conv2d_alter_op.py
index a64bc41..c7c572c 100644
--- a/python/tvm/topi/arm_cpu/conv2d_alter_op.py
+++ b/python/tvm/topi/arm_cpu/conv2d_alter_op.py
@@ -25,7 +25,7 @@ from tvm import relay
from tvm import autotvm
from ..nn import conv2d_alter_layout
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
from ..x86.conv2d import _get_default_config as _get_x86_default_config
from .arm_utils import get_tiling_B_interleaved_t
diff --git a/python/tvm/topi/arm_cpu/conv2d_gemm.py b/python/tvm/topi/arm_cpu/conv2d_gemm.py
index b40fb89..81326f1 100644
--- a/python/tvm/topi/arm_cpu/conv2d_gemm.py
+++ b/python/tvm/topi/arm_cpu/conv2d_gemm.py
@@ -21,8 +21,8 @@ import tvm
from tvm import te
from tvm.topi import nn
from tvm.autotvm.task.space import AnnotateEntity, ReorderEntity, OtherOptionEntity
-from ..util import get_const_tuple, get_const_int
-from ..nn.util import get_pad_tuple
+from ..utils import get_const_tuple, get_const_int
+from ..nn.utils import get_pad_tuple
from .tensor_intrin import (
gemm_quantized,
gemm_quantized_impl,
diff --git a/python/tvm/topi/arm_cpu/conv2d_int8.py b/python/tvm/topi/arm_cpu/conv2d_int8.py
index 43fe801..445b9ec 100644
--- a/python/tvm/topi/arm_cpu/conv2d_int8.py
+++ b/python/tvm/topi/arm_cpu/conv2d_int8.py
@@ -19,7 +19,7 @@
from tvm import te
from tvm import autotvm
from .. import tag
-from ..util import traverse_inline, get_const_tuple
+from ..utils import traverse_inline, get_const_tuple
from ..generic import conv2d as conv2d_generic
from .. import nn
from ..nn.conv2d import _get_workload as _get_conv2d_workload
diff --git a/python/tvm/topi/arm_cpu/conv2d_spatial_pack.py b/python/tvm/topi/arm_cpu/conv2d_spatial_pack.py
index 2e66443..f4cd9d8 100644
--- a/python/tvm/topi/arm_cpu/conv2d_spatial_pack.py
+++ b/python/tvm/topi/arm_cpu/conv2d_spatial_pack.py
@@ -21,8 +21,8 @@ import tvm
from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import get_const_tuple
-from ..nn.util import get_const_int, get_pad_tuple
+from ..utils import get_const_tuple
+from ..nn.utils import get_const_int, get_pad_tuple
def conv2d_spatial_pack_nchw(cfg, data, kernel, strides, padding, dilation, out_dtype, num_tile):
diff --git a/python/tvm/topi/arm_cpu/conv2d_transpose.py b/python/tvm/topi/arm_cpu/conv2d_transpose.py
index bab32ab..c9f1e1e 100644
--- a/python/tvm/topi/arm_cpu/conv2d_transpose.py
+++ b/python/tvm/topi/arm_cpu/conv2d_transpose.py
@@ -23,7 +23,7 @@ from tvm import te
from tvm import autotvm
from ..nn import dilate, pad, get_pad_tuple
-from ..util import get_const_tuple, traverse_inline
+from ..utils import get_const_tuple, traverse_inline
from .conv2d_spatial_pack import schedule_conv2d_spatial_pack_nchw
diff --git a/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct.py b/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct.py
index b084066..4f721da 100644
--- a/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct.py
+++ b/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct.py
@@ -21,7 +21,7 @@ import tvm
from tvm import autotvm
from tvm.autotvm.task import deserialize_args
from tvm.topi.nn.conv2d import conv2d_nchw, conv2d_nhwc
-from tvm.topi.util import get_const_tuple, get_const_int, traverse_inline
+from tvm.topi.utils import get_const_tuple, get_const_int, traverse_inline
def conv2d_direct(*args, **kwargs):
diff --git a/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct_simd.py b/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct_simd.py
index 61dca8a..988c3a9 100644
--- a/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct_simd.py
+++ b/python/tvm/topi/arm_cpu/cortex_m7/conv2d/direct_simd.py
@@ -20,9 +20,9 @@
from tvm import autotvm
from tvm.autotvm.task import deserialize_args
from tvm import te
-from tvm.topi.util import simplify, traverse_inline
+from tvm.topi.utils import simplify, traverse_inline
from tvm.topi.nn.pad import pad
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.nn.utils import get_pad_tuple
from ..micro_kernel.gemm import (
intrin_gemm_MxKxN,
diff --git a/python/tvm/topi/arm_cpu/depthwise_conv2d.py b/python/tvm/topi/arm_cpu/depthwise_conv2d.py
index b71c0c9..3c32d3e 100644
--- a/python/tvm/topi/arm_cpu/depthwise_conv2d.py
+++ b/python/tvm/topi/arm_cpu/depthwise_conv2d.py
@@ -23,8 +23,8 @@ from tvm import autotvm
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
from .. import nn
-from ..util import traverse_inline, get_const_tuple, get_const_int
-from ..nn.util import get_pad_tuple
+from ..utils import traverse_inline, get_const_tuple, get_const_int
+from ..nn.utils import get_pad_tuple
@autotvm.register_topi_compute("depthwise_conv2d_nchw.arm_cpu")
@@ -151,7 +151,7 @@ def schedule_depthwise_conv2d_nchw(cfg, outs):
# This schedule has incorrect result on some hardware platforms (like NV Jetson TX2)
# Let us comment it out but not remove.
# see discussion:
-# https://discuss.tvm.ai/t/autotuner-incorrect-result-after-tuning-mobilenetv2-on-arm-cpu/6088
+# https://discuss.tvm.apache.org/t/autotuner-incorrect-result-after-tuning-mobilenetv2-on-arm-cpu/6088
@autotvm.register_topi_compute("depthwise_conv2d_nchw_spatial_pack.arm_cpu")
def depthwise_conv2d_nchw_spatial_pack(cfg, data, kernel, strides, padding, dilation, out_dtype):
"""TOPI compute callback for depthwise_conv2d nchw
diff --git a/python/tvm/topi/arm_cpu/injective.py b/python/tvm/topi/arm_cpu/injective.py
index aec86bc..55f47c5 100644
--- a/python/tvm/topi/arm_cpu/injective.py
+++ b/python/tvm/topi/arm_cpu/injective.py
@@ -18,7 +18,7 @@
"""Schedule for pooling operators"""
import tvm
from tvm import te
-from ..util import is_empty_shape
+from ..utils import is_empty_shape
def schedule_injective_from_existing(sch, out):
diff --git a/python/tvm/topi/arm_cpu/tensor_intrin.py b/python/tvm/topi/arm_cpu/tensor_intrin.py
index 73cfacb..196f788 100644
--- a/python/tvm/topi/arm_cpu/tensor_intrin.py
+++ b/python/tvm/topi/arm_cpu/tensor_intrin.py
@@ -19,7 +19,7 @@
import tvm
from tvm import te
-from tvm.contrib import util, clang
+from tvm.contrib import utils, clang
def gemm_quantized_4_4_batched():
@@ -372,7 +372,7 @@ def gemm_quantized_impl(M, N, K, unroll, interleave, data_type="uint8"):
cc_code = cc_code.replace("umull", "smull")
cc_code = cc_code.replace("uadalp", "sadalp")
- temp = util.tempdir()
+ temp = utils.tempdir()
ll_path = temp.relpath("temp.ll")
# Create LLVM ir from c source code
ll_code = clang.create_llvm(
diff --git a/python/tvm/topi/bifrost/conv2d.py b/python/tvm/topi/bifrost/conv2d.py
index a3be906..3b6cca6 100644
--- a/python/tvm/topi/bifrost/conv2d.py
+++ b/python/tvm/topi/bifrost/conv2d.py
@@ -25,7 +25,7 @@ from tvm import autotvm
from .gemm import decl_winograd_gemm, schedule_gemm
from .transforms import tile_and_bind, tile_and_bind3d
-from ..util import traverse_inline, get_const_int, get_const_tuple
+from ..utils import traverse_inline, get_const_int, get_const_tuple
from .. import nn
from ..nn.winograd_util import winograd_transform_matrices
diff --git a/python/tvm/topi/bifrost/dense.py b/python/tvm/topi/bifrost/dense.py
index 85703f1..9ab8b4e 100644
--- a/python/tvm/topi/bifrost/dense.py
+++ b/python/tvm/topi/bifrost/dense.py
@@ -20,7 +20,7 @@ from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import traverse_inline
+from ..utils import traverse_inline
@autotvm.register_topi_compute("dense.bifrost")
diff --git a/python/tvm/topi/bifrost/depthwise_conv2d.py b/python/tvm/topi/bifrost/depthwise_conv2d.py
index 35da5a5..625c274 100644
--- a/python/tvm/topi/bifrost/depthwise_conv2d.py
+++ b/python/tvm/topi/bifrost/depthwise_conv2d.py
@@ -22,7 +22,7 @@ from __future__ import absolute_import as _abs
import tvm
from tvm import te
-from .. import util
+from .. import utils
from .. import tag
@@ -70,12 +70,12 @@ def schedule_depthwise_conv2d_nchw(outs):
VH = 1
VW = 1
num_thread = 4
- while util.get_const_int(conv.shape[3]) % (VW * 2) == 0 and VW * 2 <= 4:
+ while utils.get_const_int(conv.shape[3]) % (VW * 2) == 0 and VW * 2 <= 4:
VW = VW * 2
- while util.get_const_int(conv.shape[2]) % (VH * 2) == 0 and VH * 2 <= 2:
+ while utils.get_const_int(conv.shape[2]) % (VH * 2) == 0 and VH * 2 <= 2:
VH = VH * 2
if raw_data.dtype == "float16":
- if util.get_const_int(conv.shape[3]) % (VW * 2) == 0:
+ if utils.get_const_int(conv.shape[3]) % (VW * 2) == 0:
VW *= 2
num_thread *= 2
else:
diff --git a/python/tvm/topi/bifrost/gemm.py b/python/tvm/topi/bifrost/gemm.py
index c06f623..6224493 100644
--- a/python/tvm/topi/bifrost/gemm.py
+++ b/python/tvm/topi/bifrost/gemm.py
@@ -19,7 +19,7 @@
from tvm import te
from .transforms import tile_and_bind, tile_and_bind3d, interleave_transpose, transpose_interleave
-from .. import util
+from .. import utils
def decl_gemm(cfg, A, B):
@@ -50,10 +50,10 @@ def decl_gemm(cfg, A, B):
cfg.define_knob("split_k_factor", [1, 4, 16])
# Mutual k axis must be of equal extent
- assert util.get_const_int(A.shape[1]) == util.get_const_int(B.shape[0])
+ assert utils.get_const_int(A.shape[1]) == utils.get_const_int(B.shape[0])
n = A.shape[0]
m = B.shape[1]
- k_size = util.get_const_int(A.shape[1])
+ k_size = utils.get_const_int(A.shape[1])
unroll_gemm = cfg["split_k_factor"].val
if unroll_gemm == 1:
# No unrolling case must have the same set of tensors to keep scheduling consistent
@@ -120,8 +120,8 @@ def decl_batched_gemm(cfg, A, B):
"""
# Mutual b and k axis must be of equal extent
- assert util.get_const_int(A.shape[2]) == util.get_const_int(B.shape[1])
- assert util.get_const_int(A.shape[0]) == util.get_const_int(B.shape[0])
+ assert utils.get_const_int(A.shape[2]) == utils.get_const_int(B.shape[1])
+ assert utils.get_const_int(A.shape[0]) == utils.get_const_int(B.shape[0])
cfg.define_knob("work_group_x", [1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 64])
cfg.define_knob("work_group_y", [1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 64])
@@ -131,8 +131,8 @@ def decl_batched_gemm(cfg, A, B):
n = A.shape[1]
m = B.shape[2]
- k_size = util.get_const_int(A.shape[2])
- b_size = util.get_const_int(A.shape[0])
+ k_size = utils.get_const_int(A.shape[2])
+ b_size = utils.get_const_int(A.shape[0])
# Declare a batched GEMM
k = te.reduce_axis((0, k_size), name="k")
@@ -163,9 +163,9 @@ def decl_winograd_gemm(cfg, A, B):
-------
"""
- alpha = util.get_const_int(A.shape[0])
- n = util.get_const_int(A.shape[2])
- k = util.get_const_int(A.shape[3])
+ alpha = utils.get_const_int(A.shape[0])
+ n = utils.get_const_int(A.shape[2])
+ k = utils.get_const_int(A.shape[3])
A_3D = te.compute(
(alpha * alpha, n, k), lambda b, i, j: A[b // alpha][b % alpha][i][j], name="A_3D"
diff --git a/python/tvm/topi/cpp/__init__.py b/python/tvm/topi/cpp/__init__.py
index 62e274c..bad6f0e 100644
--- a/python/tvm/topi/cpp/__init__.py
+++ b/python/tvm/topi/cpp/__init__.py
@@ -23,4 +23,4 @@ from . import vision
from . import x86
from . import generic
from . import rocm
-from . import util
+from . import utils
diff --git a/python/tvm/topi/cpp/util.py b/python/tvm/topi/cpp/utils.py
similarity index 93%
rename from python/tvm/topi/cpp/util.py
rename to python/tvm/topi/cpp/utils.py
index ca0b86e..60a2747 100644
--- a/python/tvm/topi/cpp/util.py
+++ b/python/tvm/topi/cpp/utils.py
@@ -17,4 +17,4 @@
"""FFI for TOPI utility functions"""
import tvm._ffi
-tvm._ffi._init_api("topi.util", "tvm.topi.cpp.util")
+tvm._ffi._init_api("topi.utils", "tvm.topi.cpp.utils")
diff --git a/python/tvm/topi/cuda/batch_matmul.py b/python/tvm/topi/cuda/batch_matmul.py
index ee94420..8d34b29 100644
--- a/python/tvm/topi/cuda/batch_matmul.py
+++ b/python/tvm/topi/cuda/batch_matmul.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm.contrib import cublas
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
from .. import nn
-from ..util import traverse_inline, get_const_tuple, get_max_power2_factor
+from ..utils import traverse_inline, get_const_tuple, get_max_power2_factor
@autotvm.register_topi_compute("batch_matmul.cuda")
diff --git a/python/tvm/topi/cuda/conv1d.py b/python/tvm/topi/cuda/conv1d.py
index 416e480..e50913d 100644
--- a/python/tvm/topi/cuda/conv1d.py
+++ b/python/tvm/topi/cuda/conv1d.py
@@ -21,7 +21,7 @@ from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import traverse_inline, get_const_tuple
+from ..utils import traverse_inline, get_const_tuple
@autotvm.register_topi_compute("conv1d_ncw.cuda")
diff --git a/python/tvm/topi/cuda/conv1d_transpose_ncw.py b/python/tvm/topi/cuda/conv1d_transpose_ncw.py
index c827007..1ddbdcc 100644
--- a/python/tvm/topi/cuda/conv1d_transpose_ncw.py
+++ b/python/tvm/topi/cuda/conv1d_transpose_ncw.py
@@ -21,7 +21,7 @@ import tvm
from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import get_const_tuple, traverse_inline
+from ..utils import get_const_tuple, traverse_inline
@autotvm.task.register_topi_compute("conv1d_transpose_nchw.cuda")
diff --git a/python/tvm/topi/cuda/conv2d.py b/python/tvm/topi/cuda/conv2d.py
index cf335ac..ce9cebc 100644
--- a/python/tvm/topi/cuda/conv2d.py
+++ b/python/tvm/topi/cuda/conv2d.py
@@ -22,8 +22,8 @@ from tvm.autotvm.task.space import OtherOptionEntity
from tvm.contrib import cudnn
from .. import nn, generic
-from ..nn.util import get_pad_tuple
-from ..util import get_const_tuple, traverse_inline
+from ..nn.utils import get_pad_tuple
+from ..utils import get_const_tuple, traverse_inline
from .conv2d_direct import schedule_direct_cuda
from .conv2d_nhwc import schedule_conv2d_nhwc_direct
diff --git a/python/tvm/topi/cuda/conv2d_alter_op.py b/python/tvm/topi/cuda/conv2d_alter_op.py
index 9bac87c..609ead3 100644
--- a/python/tvm/topi/cuda/conv2d_alter_op.py
+++ b/python/tvm/topi/cuda/conv2d_alter_op.py
@@ -24,7 +24,7 @@ from tvm import relay
from tvm import autotvm
from .. import nn
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
from .conv2d_winograd import _infer_tile_size
from ..nn import conv2d_legalize
diff --git a/python/tvm/topi/cuda/conv2d_direct.py b/python/tvm/topi/cuda/conv2d_direct.py
index e1f3d82..2dc6635 100644
--- a/python/tvm/topi/cuda/conv2d_direct.py
+++ b/python/tvm/topi/cuda/conv2d_direct.py
@@ -19,7 +19,7 @@
import tvm
from tvm import te
from tvm import autotvm
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def schedule_direct_cuda(cfg, s, conv):
diff --git a/python/tvm/topi/cuda/conv2d_hwnc_tensorcore.py b/python/tvm/topi/cuda/conv2d_hwnc_tensorcore.py
index db5a6c9..e2d3cd9 100644
--- a/python/tvm/topi/cuda/conv2d_hwnc_tensorcore.py
+++ b/python/tvm/topi/cuda/conv2d_hwnc_tensorcore.py
@@ -22,9 +22,9 @@ from tvm import te
from tvm import autotvm
from tvm.target import Target
from tvm.topi.cuda.injective import schedule_injective_from_existing
-from ..util import get_const_tuple, traverse_inline, simplify, tag
+from ..utils import get_const_tuple, traverse_inline, simplify, tag
from ..nn.pad import pad
-from ..nn.util import get_pad_tuple
+from ..nn.utils import get_pad_tuple
from .tensor_intrin import intrin_wmma_load_matrix_A
from .tensor_intrin import intrin_wmma_load_matrix_W
from .tensor_intrin import intrin_wmma_store_matrix
diff --git a/python/tvm/topi/cuda/conv2d_int8.py b/python/tvm/topi/cuda/conv2d_int8.py
index deeec50..50a0e8b 100644
--- a/python/tvm/topi/cuda/conv2d_int8.py
+++ b/python/tvm/topi/cuda/conv2d_int8.py
@@ -25,8 +25,8 @@ from .injective import schedule_injective_from_existing
from .tensor_intrin import dp4a
from ..nn.pad import pad
from ..nn.conv2d import unpack_NCHWc_to_nchw
-from ..nn.util import get_pad_tuple
-from ..util import get_const_tuple, traverse_inline
+from ..nn.utils import get_pad_tuple
+from ..utils import get_const_tuple, traverse_inline
def conv2d_nchw_int8(data, kernel, strides, padding, dilation, out_dtype="int32"):
diff --git a/python/tvm/topi/cuda/conv2d_nhwc.py b/python/tvm/topi/cuda/conv2d_nhwc.py
index b256345..a08d217 100644
--- a/python/tvm/topi/cuda/conv2d_nhwc.py
+++ b/python/tvm/topi/cuda/conv2d_nhwc.py
@@ -19,7 +19,7 @@
import tvm
from tvm import te
from tvm import autotvm
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def schedule_conv2d_nhwc_direct(cfg, s, Conv):
diff --git a/python/tvm/topi/cuda/conv2d_nhwc_tensorcore.py b/python/tvm/topi/cuda/conv2d_nhwc_tensorcore.py
index a33092d..f665cc7 100644
--- a/python/tvm/topi/cuda/conv2d_nhwc_tensorcore.py
+++ b/python/tvm/topi/cuda/conv2d_nhwc_tensorcore.py
@@ -21,9 +21,9 @@ import numpy as np
import tvm
from tvm import te
from tvm import autotvm
-from ..util import get_const_tuple, traverse_inline, simplify
+from ..utils import get_const_tuple, traverse_inline, simplify
from ..nn.pad import pad
-from ..nn.util import get_pad_tuple
+from ..nn.utils import get_pad_tuple
from .tensor_intrin import intrin_wmma_load_matrix_A
from .tensor_intrin import intrin_wmma_load_matrix_W
from .tensor_intrin import intrin_wmma_store_matrix
diff --git a/python/tvm/topi/cuda/conv2d_nhwc_winograd.py b/python/tvm/topi/cuda/conv2d_nhwc_winograd.py
index 246437a..1e368f5 100644
--- a/python/tvm/topi/cuda/conv2d_nhwc_winograd.py
+++ b/python/tvm/topi/cuda/conv2d_nhwc_winograd.py
@@ -23,7 +23,7 @@ import tvm
from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import get_const_int, get_const_tuple, traverse_inline
+from ..utils import get_const_int, get_const_tuple, traverse_inline
from ..nn.winograd_util import winograd_transform_matrices
from .tensor_intrin import intrin_wmma_load_matrix_A
from .tensor_intrin import intrin_wmma_load_matrix_W
diff --git a/python/tvm/topi/cuda/conv2d_transpose_nchw.py b/python/tvm/topi/cuda/conv2d_transpose_nchw.py
index 915e6cd..609d1ac 100644
--- a/python/tvm/topi/cuda/conv2d_transpose_nchw.py
+++ b/python/tvm/topi/cuda/conv2d_transpose_nchw.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import autotvm
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
from .. import nn
-from ..util import get_const_tuple, traverse_inline
+from ..utils import get_const_tuple, traverse_inline
@autotvm.register_topi_compute("conv2d_transpose_nchw.cuda")
diff --git a/python/tvm/topi/cuda/conv2d_winograd.py b/python/tvm/topi/cuda/conv2d_winograd.py
index 11502e1..407f05e 100644
--- a/python/tvm/topi/cuda/conv2d_winograd.py
+++ b/python/tvm/topi/cuda/conv2d_winograd.py
@@ -23,7 +23,7 @@ from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import get_const_int, get_const_tuple, traverse_inline
+from ..utils import get_const_int, get_const_tuple, traverse_inline
from ..nn.winograd_util import winograd_transform_matrices
diff --git a/python/tvm/topi/cuda/conv3d.py b/python/tvm/topi/cuda/conv3d.py
index 98f351b..e5a3a53 100644
--- a/python/tvm/topi/cuda/conv3d.py
+++ b/python/tvm/topi/cuda/conv3d.py
@@ -21,7 +21,7 @@ from tvm import autotvm
from tvm.contrib import cudnn
from .. import nn, generic
-from ..util import get_const_tuple, traverse_inline
+from ..utils import get_const_tuple, traverse_inline
from .conv3d_direct import schedule_direct_conv3d_cuda
diff --git a/python/tvm/topi/cuda/conv3d_alter_op.py b/python/tvm/topi/cuda/conv3d_alter_op.py
index 2dfba50..faf73e7 100644
--- a/python/tvm/topi/cuda/conv3d_alter_op.py
+++ b/python/tvm/topi/cuda/conv3d_alter_op.py
@@ -24,7 +24,7 @@ from tvm import relay
from tvm import autotvm
from .. import nn
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
from .conv3d_winograd import _infer_tile_size
logger = logging.getLogger("topi")
diff --git a/python/tvm/topi/cuda/conv3d_direct.py b/python/tvm/topi/cuda/conv3d_direct.py
index aa13e6b..faccb75 100644
--- a/python/tvm/topi/cuda/conv3d_direct.py
+++ b/python/tvm/topi/cuda/conv3d_direct.py
@@ -19,7 +19,7 @@
import tvm
from tvm import te
from tvm import autotvm
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def schedule_direct_conv3d_cuda(cfg, s, conv, layout, workload_name):
diff --git a/python/tvm/topi/cuda/conv3d_ndhwc_tensorcore.py b/python/tvm/topi/cuda/conv3d_ndhwc_tensorcore.py
index b253130..a5c4e81 100644
--- a/python/tvm/topi/cuda/conv3d_ndhwc_tensorcore.py
+++ b/python/tvm/topi/cuda/conv3d_ndhwc_tensorcore.py
@@ -21,9 +21,9 @@ import numpy as np
import tvm
from tvm import te
from tvm import autotvm
-from ..util import get_const_tuple, traverse_inline, simplify
+from ..utils import get_const_tuple, traverse_inline, simplify
from ..nn.pad import pad
-from ..nn.util import get_pad_tuple3d
+from ..nn.utils import get_pad_tuple3d
from .tensor_intrin import intrin_wmma_load_matrix_A
from .tensor_intrin import intrin_wmma_load_matrix_W
from .tensor_intrin import intrin_wmma_store_matrix
diff --git a/python/tvm/topi/cuda/conv3d_transpose_ncdhw.py b/python/tvm/topi/cuda/conv3d_transpose_ncdhw.py
index 69c0e0f..3ad85b9 100644
--- a/python/tvm/topi/cuda/conv3d_transpose_ncdhw.py
+++ b/python/tvm/topi/cuda/conv3d_transpose_ncdhw.py
@@ -21,7 +21,7 @@ import tvm
from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import get_const_tuple, traverse_inline
+from ..utils import get_const_tuple, traverse_inline
from .conv3d_direct import schedule_direct_conv3d_cuda
diff --git a/python/tvm/topi/cuda/conv3d_winograd.py b/python/tvm/topi/cuda/conv3d_winograd.py
index 7f4f139..2134ee9 100644
--- a/python/tvm/topi/cuda/conv3d_winograd.py
+++ b/python/tvm/topi/cuda/conv3d_winograd.py
@@ -23,7 +23,7 @@ from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import get_const_int, get_const_tuple, traverse_inline, simplify
+from ..utils import get_const_int, get_const_tuple, traverse_inline, simplify
from ..nn.winograd_util import winograd_transform_matrices
logger = logging.getLogger("conv3d_winograd")
diff --git a/python/tvm/topi/cuda/correlation.py b/python/tvm/topi/cuda/correlation.py
index 12f5644..9b16983 100644
--- a/python/tvm/topi/cuda/correlation.py
+++ b/python/tvm/topi/cuda/correlation.py
@@ -20,7 +20,7 @@ from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import traverse_inline
+from ..utils import traverse_inline
@autotvm.register_topi_compute("correlation_nchw.cuda")
diff --git a/python/tvm/topi/cuda/deformable_conv2d.py b/python/tvm/topi/cuda/deformable_conv2d.py
index 365fde5..911588c 100644
--- a/python/tvm/topi/cuda/deformable_conv2d.py
+++ b/python/tvm/topi/cuda/deformable_conv2d.py
@@ -20,7 +20,7 @@ import tvm
from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import traverse_inline
+from ..utils import traverse_inline
@autotvm.register_topi_compute("deformable_conv2d_nchw.cuda")
diff --git a/python/tvm/topi/cuda/dense.py b/python/tvm/topi/cuda/dense.py
index 727992d..47b9db4 100644
--- a/python/tvm/topi/cuda/dense.py
+++ b/python/tvm/topi/cuda/dense.py
@@ -25,7 +25,7 @@ from .tensor_intrin import dp4a
from .. import nn
from .. import tag
from .. import generic
-from ..util import traverse_inline, get_const_tuple
+from ..utils import traverse_inline, get_const_tuple
logger = logging.getLogger("topi")
diff --git a/python/tvm/topi/cuda/dense_tensorcore.py b/python/tvm/topi/cuda/dense_tensorcore.py
index 99f28a1..a59ebd73 100644
--- a/python/tvm/topi/cuda/dense_tensorcore.py
+++ b/python/tvm/topi/cuda/dense_tensorcore.py
@@ -21,7 +21,7 @@ import tvm
from tvm import te
import tvm.autotvm as autotvm
from .. import tag
-from ..util import traverse_inline, get_const_tuple
+from ..utils import traverse_inline, get_const_tuple
from .tensor_intrin import (
intrin_wmma_load_matrix_A,
intrin_wmma_load_matrix_W,
diff --git a/python/tvm/topi/cuda/depthwise_conv2d.py b/python/tvm/topi/cuda/depthwise_conv2d.py
index 2908439..90a7371 100644
--- a/python/tvm/topi/cuda/depthwise_conv2d.py
+++ b/python/tvm/topi/cuda/depthwise_conv2d.py
@@ -19,7 +19,7 @@
import tvm
from tvm import te
from tvm import autotvm
-from ..util import traverse_inline
+from ..utils import traverse_inline
from .. import tag
from .. import nn
diff --git a/python/tvm/topi/cuda/group_conv2d_nchw.py b/python/tvm/topi/cuda/group_conv2d_nchw.py
index 35d5119..2af0117 100644
--- a/python/tvm/topi/cuda/group_conv2d_nchw.py
+++ b/python/tvm/topi/cuda/group_conv2d_nchw.py
@@ -23,8 +23,8 @@ from tvm import autotvm
from .injective import schedule_injective_from_existing
from .tensor_intrin import dp4a
from ..nn.pad import pad
-from ..nn.util import get_pad_tuple
-from ..util import traverse_inline, get_const_tuple, get_const_int
+from ..nn.utils import get_pad_tuple
+from ..utils import traverse_inline, get_const_tuple, get_const_int
from .. import nn
diff --git a/python/tvm/topi/cuda/injective.py b/python/tvm/topi/cuda/injective.py
index 8a5f618..60fb12e 100644
--- a/python/tvm/topi/cuda/injective.py
+++ b/python/tvm/topi/cuda/injective.py
@@ -18,7 +18,7 @@
"""Schedule for composition of injective operator"""
import tvm
from tvm import te
-from .. import util
+from .. import utils
def schedule_injective_from_existing(sch, out):
@@ -45,7 +45,7 @@ def schedule_injective_from_existing(sch, out):
vector_width = 4 if out.dtype == "float16" else 1
try:
- const_size = util.get_const_int(util.prod(out.shape))
+ const_size = utils.get_const_int(utils.prod(out.shape))
need_block_split = const_size > max_block * num_thread * vector_width
except ValueError:
need_block_split = False
@@ -87,7 +87,7 @@ def schedule_injective(outs):
tvm.te.schedule.AutoInlineInjective(s)
for out in outs:
- if not util.is_empty_shape(out.shape):
+ if not utils.is_empty_shape(out.shape):
schedule_injective_from_existing(s, out)
return s
diff --git a/python/tvm/topi/cuda/pooling.py b/python/tvm/topi/cuda/pooling.py
index a3caf5f..f2a6aad 100644
--- a/python/tvm/topi/cuda/pooling.py
+++ b/python/tvm/topi/cuda/pooling.py
@@ -19,7 +19,7 @@
import tvm
from tvm import te
from .. import tag
-from ..util import traverse_inline
+from ..utils import traverse_inline
def schedule_adaptive_pool(outs, layout="NCHW"):
diff --git a/python/tvm/topi/cuda/rcnn/proposal.py b/python/tvm/topi/cuda/rcnn/proposal.py
index 119b7bd..5b7884c 100644
--- a/python/tvm/topi/cuda/rcnn/proposal.py
+++ b/python/tvm/topi/cuda/rcnn/proposal.py
@@ -20,7 +20,7 @@ import math
import tvm
from tvm import te
from ...vision.rcnn import generate_anchor, reg_bbox, reg_iou
-from ...util import get_const_tuple, get_const_int
+from ...utils import get_const_tuple, get_const_int
def predict_bbox_ir(
diff --git a/python/tvm/topi/cuda/sparse.py b/python/tvm/topi/cuda/sparse.py
index 3fd6fbe..d125423 100644
--- a/python/tvm/topi/cuda/sparse.py
+++ b/python/tvm/topi/cuda/sparse.py
@@ -23,7 +23,7 @@ import tvm
from tvm import relay, te
from .. import nn
-from ..util import traverse_inline
+from ..utils import traverse_inline
def sparse_dense(data, weight_data, weight_indices, weight_indptr):
diff --git a/python/tvm/topi/generic/conv2d.py b/python/tvm/topi/generic/conv2d.py
index 122d7d2..f23cff3 100644
--- a/python/tvm/topi/generic/conv2d.py
+++ b/python/tvm/topi/generic/conv2d.py
@@ -20,7 +20,7 @@
from tvm import te
from tvm import autotvm
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def fallback_schedule_cpu_common_int8(cfg, wkl, int32_lanes, num_int8_elements):
diff --git a/python/tvm/topi/image/dilation2d.py b/python/tvm/topi/image/dilation2d.py
index b388782..7aad506 100644
--- a/python/tvm/topi/image/dilation2d.py
+++ b/python/tvm/topi/image/dilation2d.py
@@ -19,9 +19,9 @@
"""Dilation2D operators"""
from __future__ import absolute_import as _abs
from tvm import te
-from tvm.topi.util import simplify
+from tvm.topi.utils import simplify
from ..nn.pad import pad
-from ..nn.util import get_pad_tuple
+from ..nn.utils import get_pad_tuple
def dilation2d_nchw(input, filter, stride, padding, dilations, out_dtype=None):
diff --git a/python/tvm/topi/image/resize.py b/python/tvm/topi/image/resize.py
index ca99044..103850d 100644
--- a/python/tvm/topi/image/resize.py
+++ b/python/tvm/topi/image/resize.py
@@ -19,7 +19,7 @@
from __future__ import absolute_import
import tvm
from tvm import te
-from tvm.topi.util import nchw_pack_layout, nchw_xc_layout
+from tvm.topi.utils import nchw_pack_layout, nchw_xc_layout
from .. import tag
diff --git a/python/tvm/topi/intel_graphics/conv2d.py b/python/tvm/topi/intel_graphics/conv2d.py
index 5bd8581..bdbde91 100644
--- a/python/tvm/topi/intel_graphics/conv2d.py
+++ b/python/tvm/topi/intel_graphics/conv2d.py
@@ -25,8 +25,8 @@ from tvm import autotvm
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
from .. import nn
-from .. import util
-from ..util import simplify, get_const_tuple, traverse_inline
+from .. import utils
+from ..utils import simplify, get_const_tuple, traverse_inline
def _get_default_config(cfg, data, kernel, strides, padding, out_dtype, is_depthwise=False):
@@ -487,8 +487,8 @@ def schedule_conv2d_nchw(outs):
def _decl_cl_spatialpack(data, kernel, stride, padding, out_dtype="float16"):
- batch, in_channel, in_height, in_width = [util.get_const_int(x) for x in data.shape]
- num_filter, channel, kernel_h, kernel_w = [util.get_const_int(x) for x in kernel.shape]
+ batch, in_channel, in_height, in_width = [utils.get_const_int(x) for x in data.shape]
+ num_filter, channel, kernel_h, kernel_w = [utils.get_const_int(x) for x in kernel.shape]
pad_top, pad_left, pad_down, pad_right = nn.get_pad_tuple(padding, (kernel_h, kernel_w))
if isinstance(stride, (tuple, list)):
@@ -574,7 +574,7 @@ def _decl_cl_spatialpack(data, kernel, stride, padding, out_dtype="float16"):
def _schedule_cl_spatialpack(s, op):
output = op.output(0)
- _, _, out_height, out_width = [util.get_const_int(x) for x in output.shape]
+ _, _, out_height, out_width = [utils.get_const_int(x) for x in output.shape]
conv = op.input_tensors[0]
temp = s[conv].op.input_tensors[0]
@@ -584,7 +584,7 @@ def _schedule_cl_spatialpack(s, op):
conv_L = s.cache_write(conv, "local")
kernel_L = s.cache_read(kernel_vec, "local", [conv_L])
- _, in_channel, temp_h, temp_w = [util.get_const_int(x) for x in temp.shape]
+ _, in_channel, temp_h, temp_w = [utils.get_const_int(x) for x in temp.shape]
attrs = s[conv].op.attrs
OUTPUT_BLOCK_HEIGHT = attrs["block_h"]
diff --git a/python/tvm/topi/intel_graphics/conv2d_alter_op.py b/python/tvm/topi/intel_graphics/conv2d_alter_op.py
index 46802bb..0b59a84 100644
--- a/python/tvm/topi/intel_graphics/conv2d_alter_op.py
+++ b/python/tvm/topi/intel_graphics/conv2d_alter_op.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import relay
from tvm import autotvm
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
from ..nn import conv2d_alter_layout, conv2d_infer_layout
from .conv2d import _get_default_config
diff --git a/python/tvm/topi/intel_graphics/depthwise_conv2d.py b/python/tvm/topi/intel_graphics/depthwise_conv2d.py
index e236779..fabd63b 100644
--- a/python/tvm/topi/intel_graphics/depthwise_conv2d.py
+++ b/python/tvm/topi/intel_graphics/depthwise_conv2d.py
@@ -19,7 +19,7 @@
import tvm
from tvm import te
from tvm import autotvm
-from ..util import traverse_inline
+from ..utils import traverse_inline
from .. import tag
from .. import nn
from ..nn.depthwise_conv2d import depthwise_conv2d_infer_layout
diff --git a/python/tvm/topi/mali/conv2d.py b/python/tvm/topi/mali/conv2d.py
index 0ccf1e6..eb4005e 100644
--- a/python/tvm/topi/mali/conv2d.py
+++ b/python/tvm/topi/mali/conv2d.py
@@ -22,7 +22,7 @@ from tvm import relay
from tvm import autotvm
from tvm.autotvm.task.space import get_factors
-from ..util import traverse_inline, get_const_int, get_const_tuple
+from ..utils import traverse_inline, get_const_int, get_const_tuple
from .. import nn
from ..nn.winograd_util import winograd_transform_matrices
diff --git a/python/tvm/topi/mali/dense.py b/python/tvm/topi/mali/dense.py
index 7605ace..53f7621 100644
--- a/python/tvm/topi/mali/dense.py
+++ b/python/tvm/topi/mali/dense.py
@@ -20,7 +20,7 @@ from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import traverse_inline
+from ..utils import traverse_inline
@autotvm.register_topi_compute("dense.mali")
diff --git a/python/tvm/topi/mali/depthwise_conv2d.py b/python/tvm/topi/mali/depthwise_conv2d.py
index b64135c..55fcb1d 100644
--- a/python/tvm/topi/mali/depthwise_conv2d.py
+++ b/python/tvm/topi/mali/depthwise_conv2d.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import autotvm
from .. import nn
-from ..util import traverse_inline
+from ..utils import traverse_inline
# register original implementation of depthwise_conv2d_nchw since we don't need to change this part
@autotvm.register_topi_compute("depthwise_conv2d_nchw.mali")
diff --git a/python/tvm/topi/nn/batch_matmul.py b/python/tvm/topi/nn/batch_matmul.py
index 9b926a1..6e60f27 100644
--- a/python/tvm/topi/nn/batch_matmul.py
+++ b/python/tvm/topi/nn/batch_matmul.py
@@ -17,7 +17,7 @@
"""Binary Neural Network (BNN) Operators"""
# pylint: disable=invalid-name
from tvm import te
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def batch_matmul(x, y, oshape=None):
diff --git a/python/tvm/topi/nn/bitserial_conv2d.py b/python/tvm/topi/nn/bitserial_conv2d.py
index d104519..78d05d0 100644
--- a/python/tvm/topi/nn/bitserial_conv2d.py
+++ b/python/tvm/topi/nn/bitserial_conv2d.py
@@ -20,9 +20,9 @@
import tvm
from tvm import te
from .pad import pad
-from .util import get_pad_tuple
+from .utils import get_pad_tuple
from .bitserial_util import bitpack
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def bitserial_conv2d_nchw(
diff --git a/python/tvm/topi/nn/bitserial_dense.py b/python/tvm/topi/nn/bitserial_dense.py
index 0b86e2e..32154ac 100644
--- a/python/tvm/topi/nn/bitserial_dense.py
+++ b/python/tvm/topi/nn/bitserial_dense.py
@@ -19,7 +19,7 @@
from __future__ import absolute_import
import tvm
from tvm import te
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from .bitserial_util import bitpack
diff --git a/python/tvm/topi/nn/bitserial_util.py b/python/tvm/topi/nn/bitserial_util.py
index ae43668..3a55422 100644
--- a/python/tvm/topi/nn/bitserial_util.py
+++ b/python/tvm/topi/nn/bitserial_util.py
@@ -20,7 +20,7 @@ import numpy as np
import tvm
from tvm import te
from tvm.topi.transform import concatenate
-from ..util import get_const_int
+from ..utils import get_const_int
def bitpack(data, bits, pack_axis, bit_axis, pack_type, name="QuantizeInput"):
diff --git a/python/tvm/topi/nn/bnn.py b/python/tvm/topi/nn/bnn.py
index 6c36b37..50539de 100644
--- a/python/tvm/topi/nn/bnn.py
+++ b/python/tvm/topi/nn/bnn.py
@@ -19,7 +19,7 @@ from __future__ import absolute_import as _abs
import tvm
from tvm import te
from .. import tag
-from ..util import simplify, get_const_int
+from ..utils import simplify, get_const_int
def binarize_pack(data, axis=None, name="PackedInput"):
diff --git a/python/tvm/topi/nn/conv1d.py b/python/tvm/topi/nn/conv1d.py
index cffed66..8fdf3f8 100644
--- a/python/tvm/topi/nn/conv1d.py
+++ b/python/tvm/topi/nn/conv1d.py
@@ -18,8 +18,8 @@
"""1D convolution operators."""
from tvm import te
from .pad import pad
-from ..util import simplify
-from .util import get_pad_tuple1d
+from ..utils import simplify
+from .utils import get_pad_tuple1d
def conv1d(data, kernel, strides=1, padding="VALID", dilation=1, layout="NCW", out_dtype=None):
diff --git a/python/tvm/topi/nn/conv1d_transpose.py b/python/tvm/topi/nn/conv1d_transpose.py
index 813377e..6f04040 100644
--- a/python/tvm/topi/nn/conv1d_transpose.py
+++ b/python/tvm/topi/nn/conv1d_transpose.py
@@ -19,8 +19,8 @@
from tvm import te
from .dilate import dilate
from .pad import pad
-from ..util import simplify
-from .util import get_pad_tuple1d
+from ..utils import simplify
+from .utils import get_pad_tuple1d
def conv1d_transpose_ncw(data, kernel, stride, padding, out_dtype, output_padding):
diff --git a/python/tvm/topi/nn/conv2d.py b/python/tvm/topi/nn/conv2d.py
index c0e941c..2e147fc 100644
--- a/python/tvm/topi/nn/conv2d.py
+++ b/python/tvm/topi/nn/conv2d.py
@@ -23,8 +23,8 @@ import tvm
from tvm import te
from .pad import pad
-from .util import get_pad_tuple
-from ..util import simplify, get_const_tuple, get_const_int, tag
+from .utils import get_pad_tuple
+from ..utils import simplify, get_const_tuple, get_const_int, tag
from .winograd_util import winograd_transform_matrices
# workload description of conv2d
diff --git a/python/tvm/topi/nn/conv2d_transpose.py b/python/tvm/topi/nn/conv2d_transpose.py
index f67f9c9..22188bc 100644
--- a/python/tvm/topi/nn/conv2d_transpose.py
+++ b/python/tvm/topi/nn/conv2d_transpose.py
@@ -21,8 +21,8 @@ from tvm import te
from tvm import relay
from .dilate import dilate
from .pad import pad
-from .util import get_pad_tuple
-from ..util import simplify
+from .utils import get_pad_tuple
+from ..utils import simplify
def conv2d_transpose_nchw(Input, Filter, strides, padding, out_dtype, output_padding):
diff --git a/python/tvm/topi/nn/conv3d.py b/python/tvm/topi/nn/conv3d.py
index 1696ac6..f3cda28 100644
--- a/python/tvm/topi/nn/conv3d.py
+++ b/python/tvm/topi/nn/conv3d.py
@@ -21,8 +21,8 @@ import tvm
from tvm import te
from .pad import pad
-from .util import get_pad_tuple3d
-from ..util import simplify, get_const_tuple
+from .utils import get_pad_tuple3d
+from ..utils import simplify, get_const_tuple
from .winograd_util import winograd_transform_matrices
diff --git a/python/tvm/topi/nn/conv3d_transpose.py b/python/tvm/topi/nn/conv3d_transpose.py
index 9a8828f..9f5c01a 100644
--- a/python/tvm/topi/nn/conv3d_transpose.py
+++ b/python/tvm/topi/nn/conv3d_transpose.py
@@ -21,8 +21,8 @@ from tvm import te
from tvm import relay
from .dilate import dilate
from .pad import pad
-from .util import get_pad_tuple3d
-from ..util import simplify
+from .utils import get_pad_tuple3d
+from ..utils import simplify
def conv3d_transpose_ncdhw(Input, Filter, strides, padding, out_dtype, output_padding):
diff --git a/python/tvm/topi/nn/correlation.py b/python/tvm/topi/nn/correlation.py
index 583002e..d7d650c 100644
--- a/python/tvm/topi/nn/correlation.py
+++ b/python/tvm/topi/nn/correlation.py
@@ -18,7 +18,7 @@
from tvm import te
from .pad import pad
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def correlation_nchw(
diff --git a/python/tvm/topi/nn/deformable_conv2d.py b/python/tvm/topi/nn/deformable_conv2d.py
index 3d2b7ce..a8c2745 100644
--- a/python/tvm/topi/nn/deformable_conv2d.py
+++ b/python/tvm/topi/nn/deformable_conv2d.py
@@ -19,9 +19,9 @@
import tvm
from tvm import te
-from .util import get_pad_tuple
-from ..util import get_const_tuple
-from ..cpp.util import bilinear_sample_nchw
+from .utils import get_pad_tuple
+from ..utils import get_const_tuple
+from ..cpp.utils import bilinear_sample_nchw
def deformable_conv2d_nchw(
diff --git a/python/tvm/topi/nn/depthwise_conv2d.py b/python/tvm/topi/nn/depthwise_conv2d.py
index c863a15..7235682 100644
--- a/python/tvm/topi/nn/depthwise_conv2d.py
+++ b/python/tvm/topi/nn/depthwise_conv2d.py
@@ -23,8 +23,8 @@ from tvm import te
from .dilate import dilate
from .pad import pad
-from .util import get_pad_tuple
-from ..util import simplify
+from .utils import get_pad_tuple
+from ..utils import simplify
# workload description of depthwise-conv2d
Workload = namedtuple(
diff --git a/python/tvm/topi/nn/dilate.py b/python/tvm/topi/nn/dilate.py
index 6980fea..6b2222e 100644
--- a/python/tvm/topi/nn/dilate.py
+++ b/python/tvm/topi/nn/dilate.py
@@ -18,7 +18,7 @@
"""Dilation operators"""
import tvm
from tvm import te
-from .. import util
+from .. import utils
from .. import tag
@@ -57,7 +57,7 @@ def dilate(data, strides, dilation_value=0.0, name="DilatedInput"):
idxdiv = tvm.tir.indexdiv
idxmod = tvm.tir.indexmod
for i in range(n):
- if not util.equal_const_int(strides[i], 1):
+ if not utils.equal_const_int(strides[i], 1):
index_tuple.append(idxdiv(indices[i], strides[i]))
not_zero.append(idxmod(indices[i], strides[i]).equal(0))
else:
diff --git a/python/tvm/topi/nn/elemwise.py b/python/tvm/topi/nn/elemwise.py
index 03fffc7..a80047d 100644
--- a/python/tvm/topi/nn/elemwise.py
+++ b/python/tvm/topi/nn/elemwise.py
@@ -19,7 +19,7 @@ from __future__ import absolute_import as _abs
import tvm
from tvm import te
from .. import tag
-from ..util import get_const_int
+from ..utils import get_const_int
@tvm.te.tag_scope(tag=tag.ELEMWISE)
diff --git a/python/tvm/topi/nn/pad.py b/python/tvm/topi/nn/pad.py
index ec20ef6..78e41b5 100644
--- a/python/tvm/topi/nn/pad.py
+++ b/python/tvm/topi/nn/pad.py
@@ -18,7 +18,7 @@
from __future__ import absolute_import as _abs
import tvm
from tvm import te
-from ..util import equal_const_int
+from ..utils import equal_const_int
from .. import tag
diff --git a/python/tvm/topi/nn/sparse.py b/python/tvm/topi/nn/sparse.py
index 74a9ad5..55b3e6a 100644
--- a/python/tvm/topi/nn/sparse.py
+++ b/python/tvm/topi/nn/sparse.py
@@ -20,7 +20,7 @@ from __future__ import absolute_import
import tvm
from tvm import te
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def sparse_dense(data, weight_data, weight_indices, weight_indptr):
diff --git a/python/tvm/topi/nn/upsampling.py b/python/tvm/topi/nn/upsampling.py
index b390b80..b95835f 100644
--- a/python/tvm/topi/nn/upsampling.py
+++ b/python/tvm/topi/nn/upsampling.py
@@ -17,7 +17,7 @@
"""TVM operator upsampling compute."""
from tvm import topi
from tvm import te
-from ..util import simplify
+from ..utils import simplify
def upsampling(
diff --git a/python/tvm/topi/nn/util.py b/python/tvm/topi/nn/utils.py
similarity index 99%
rename from python/tvm/topi/nn/util.py
rename to python/tvm/topi/nn/utils.py
index 0894656..ff00441 100644
--- a/python/tvm/topi/nn/util.py
+++ b/python/tvm/topi/nn/utils.py
@@ -19,7 +19,7 @@
from __future__ import absolute_import
import tvm
-from ..util import get_const_int
+from ..utils import get_const_int
def infer_pad(data, data_pad):
diff --git a/python/tvm/topi/nn/winograd_util.py b/python/tvm/topi/nn/winograd_util.py
index d43586d..c0f7097 100644
--- a/python/tvm/topi/nn/winograd_util.py
+++ b/python/tvm/topi/nn/winograd_util.py
@@ -26,7 +26,7 @@ from operator import mul
from functools import reduce
import numpy as np
from tvm.contrib.pickle_memoize import memoize
-from ..util import const_matrix
+from ..utils import const_matrix
# pylint: disable=invalid-name
diff --git a/python/tvm/topi/rocm/batch_matmul.py b/python/tvm/topi/rocm/batch_matmul.py
index fa4dd45..7f35f4b 100644
--- a/python/tvm/topi/rocm/batch_matmul.py
+++ b/python/tvm/topi/rocm/batch_matmul.py
@@ -19,7 +19,7 @@
from tvm import autotvm
from tvm.contrib import rocblas
from .. import generic
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
@autotvm.register_topi_compute("batch_matmul_rocblas.rocm")
diff --git a/python/tvm/topi/rocm/conv2d.py b/python/tvm/topi/rocm/conv2d.py
index 0857d09..fac77f0 100644
--- a/python/tvm/topi/rocm/conv2d.py
+++ b/python/tvm/topi/rocm/conv2d.py
@@ -20,8 +20,8 @@ from tvm import autotvm
from tvm.contrib import miopen
from .. import generic
-from ..util import get_const_tuple
-from ..nn.util import get_pad_tuple
+from ..utils import get_const_tuple
+from ..nn.utils import get_pad_tuple
@autotvm.register_topi_compute("conv2d_nchw_miopen.rocm")
diff --git a/python/tvm/topi/rocm/dense.py b/python/tvm/topi/rocm/dense.py
index 4a771c6..2f3ce77 100644
--- a/python/tvm/topi/rocm/dense.py
+++ b/python/tvm/topi/rocm/dense.py
@@ -21,7 +21,7 @@ from tvm import autotvm
from tvm.contrib import rocblas
from .. import generic, nn
from .. import tag
-from ..util import traverse_inline
+from ..utils import traverse_inline
@autotvm.register_topi_compute("dense.rocm")
diff --git a/python/tvm/topi/sort.py b/python/tvm/topi/sort.py
index 86e2bad..98a1080 100644
--- a/python/tvm/topi/sort.py
+++ b/python/tvm/topi/sort.py
@@ -18,7 +18,7 @@
"""Argsort operator"""
import tvm
from tvm import te
-from .util import get_const_tuple
+from .utils import get_const_tuple
def argsort(data, valid_count=None, axis=-1, is_ascend=1, dtype="float32"):
diff --git a/python/tvm/topi/sparse/csrmm.py b/python/tvm/topi/sparse/csrmm.py
index 954f9dd..f578e60 100644
--- a/python/tvm/topi/sparse/csrmm.py
+++ b/python/tvm/topi/sparse/csrmm.py
@@ -19,7 +19,7 @@ from __future__ import absolute_import
import tvm
from tvm import te
from .. import tag
-from ..util import simplify
+from ..utils import simplify
def csrmm_default(data, indices, indptr, weight, bias=None):
diff --git a/python/tvm/topi/sparse/dense.py b/python/tvm/topi/sparse/dense.py
index d86f5dd..d1516d0 100644
--- a/python/tvm/topi/sparse/dense.py
+++ b/python/tvm/topi/sparse/dense.py
@@ -19,7 +19,7 @@ from __future__ import absolute_import
import tvm
from tvm import te
from .. import tag
-from ..util import simplify
+from ..utils import simplify
def dense_si(data, indices, indptr, weight, bias=None):
diff --git a/python/tvm/topi/testing/bilinear_resize_python.py b/python/tvm/topi/testing/bilinear_resize_python.py
index 8d78f13..844546e 100644
--- a/python/tvm/topi/testing/bilinear_resize_python.py
+++ b/python/tvm/topi/testing/bilinear_resize_python.py
@@ -18,7 +18,7 @@
"""Bilinear Scale in python"""
import math
import numpy as np
-from tvm.topi.util import nchw_pack_layout
+from tvm.topi.utils import nchw_pack_layout
def bilinear_resize_python(image, out_size, layout, coordinate_transformation_mode="align_corners"):
diff --git a/python/tvm/topi/testing/conv1d_ncw_python.py b/python/tvm/topi/testing/conv1d_ncw_python.py
index 1405adb..190e1c6 100644
--- a/python/tvm/topi/testing/conv1d_ncw_python.py
+++ b/python/tvm/topi/testing/conv1d_ncw_python.py
@@ -17,7 +17,7 @@
# pylint: disable=unused-variable, invalid-name
"""1D convolution in python"""
import numpy as np
-from tvm.topi.nn.util import get_pad_tuple1d
+from tvm.topi.nn.utils import get_pad_tuple1d
def dilate_np(x, dilation):
diff --git a/python/tvm/topi/testing/conv1d_transpose_ncw_python.py b/python/tvm/topi/testing/conv1d_transpose_ncw_python.py
index 3a1bc61..85e1410 100644
--- a/python/tvm/topi/testing/conv1d_transpose_ncw_python.py
+++ b/python/tvm/topi/testing/conv1d_transpose_ncw_python.py
@@ -19,7 +19,7 @@
import numpy as np
import scipy
import tvm.topi.testing
-from tvm.topi.nn.util import get_pad_tuple1d
+from tvm.topi.nn.utils import get_pad_tuple1d
def conv1d_transpose_ncw_python(a_np, w_np, stride, padding, output_padding):
diff --git a/python/tvm/topi/testing/conv2d_hwcn_python.py b/python/tvm/topi/testing/conv2d_hwcn_python.py
index 9a06edd..9ee66df 100644
--- a/python/tvm/topi/testing/conv2d_hwcn_python.py
+++ b/python/tvm/topi/testing/conv2d_hwcn_python.py
@@ -18,7 +18,7 @@
"""Convolution in python"""
import numpy as np
import scipy.signal
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.nn.utils import get_pad_tuple
def conv2d_hwcn_python(a_np, w_np, stride, padding):
diff --git a/python/tvm/topi/testing/conv2d_nchw_python.py b/python/tvm/topi/testing/conv2d_nchw_python.py
index 38bed4a..ce5d981 100644
--- a/python/tvm/topi/testing/conv2d_nchw_python.py
+++ b/python/tvm/topi/testing/conv2d_nchw_python.py
@@ -18,7 +18,7 @@
"""Convolution in python"""
import numpy as np
import scipy.signal
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.nn.utils import get_pad_tuple
def _conv2d_nchw_python(a_np, w_np, stride, padding):
diff --git a/python/tvm/topi/testing/conv2d_nhwc_python.py b/python/tvm/topi/testing/conv2d_nhwc_python.py
index 136fb6b..68ef8c1 100644
--- a/python/tvm/topi/testing/conv2d_nhwc_python.py
+++ b/python/tvm/topi/testing/conv2d_nhwc_python.py
@@ -18,7 +18,7 @@
"""Convolution in python"""
import numpy as np
import scipy.signal
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.nn.utils import get_pad_tuple
def _conv2d_nhwc_python(a_np, w_np, stride, padding):
diff --git a/python/tvm/topi/testing/conv2d_transpose_python.py b/python/tvm/topi/testing/conv2d_transpose_python.py
index 04e60a7..c7c0d9f 100644
--- a/python/tvm/topi/testing/conv2d_transpose_python.py
+++ b/python/tvm/topi/testing/conv2d_transpose_python.py
@@ -19,7 +19,7 @@
import numpy as np
import scipy
import tvm.topi.testing
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.nn.utils import get_pad_tuple
def conv2d_transpose_nchw_python(a_np, w_np, stride, padding, output_padding):
diff --git a/python/tvm/topi/testing/conv3d_ncdhw_python.py b/python/tvm/topi/testing/conv3d_ncdhw_python.py
index 11b0e23..a10d9ed 100644
--- a/python/tvm/topi/testing/conv3d_ncdhw_python.py
+++ b/python/tvm/topi/testing/conv3d_ncdhw_python.py
@@ -18,7 +18,7 @@
"""Convolution 3D in python"""
import numpy as np
import scipy.signal
-from tvm.topi.nn.util import get_pad_tuple3d
+from tvm.topi.nn.utils import get_pad_tuple3d
def _conv3d_ncdhw_python(a_np, w_np, stride, padding):
diff --git a/python/tvm/topi/testing/conv3d_ndhwc_python.py b/python/tvm/topi/testing/conv3d_ndhwc_python.py
index 52974d4..46f04f6 100644
--- a/python/tvm/topi/testing/conv3d_ndhwc_python.py
+++ b/python/tvm/topi/testing/conv3d_ndhwc_python.py
@@ -18,7 +18,7 @@
"""Convolution 3D in python"""
import numpy as np
import scipy.signal
-from tvm.topi.nn.util import get_pad_tuple3d
+from tvm.topi.nn.utils import get_pad_tuple3d
def conv3d_ndhwc_python(a_np, w_np, stride, padding):
diff --git a/python/tvm/topi/testing/conv3d_transpose_ncdhw_python.py b/python/tvm/topi/testing/conv3d_transpose_ncdhw_python.py
index 779371a..38b8bc5 100644
--- a/python/tvm/topi/testing/conv3d_transpose_ncdhw_python.py
+++ b/python/tvm/topi/testing/conv3d_transpose_ncdhw_python.py
@@ -18,7 +18,7 @@
"""Convolution 3D transpose in python"""
import numpy as np
import tvm.topi.testing
-from tvm.topi.nn.util import get_pad_tuple3d
+from tvm.topi.nn.utils import get_pad_tuple3d
def conv3d_transpose_ncdhw_python(a_np, w_np, stride, padding, output_padding):
diff --git a/python/tvm/topi/testing/deformable_conv2d_nchw_python.py b/python/tvm/topi/testing/deformable_conv2d_nchw_python.py
index cc66c5f..6a7afb4 100644
--- a/python/tvm/topi/testing/deformable_conv2d_nchw_python.py
+++ b/python/tvm/topi/testing/deformable_conv2d_nchw_python.py
@@ -18,7 +18,7 @@
"""Deformable convolution in python"""
import itertools
import numpy as np
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.nn.utils import get_pad_tuple
def deformable_conv2d_nchw_python(
diff --git a/python/tvm/topi/testing/upsampling_python.py b/python/tvm/topi/testing/upsampling_python.py
index 203e804..7f48aa4 100644
--- a/python/tvm/topi/testing/upsampling_python.py
+++ b/python/tvm/topi/testing/upsampling_python.py
@@ -18,7 +18,7 @@
"""Upsampling in python"""
import math
import numpy as np
-from tvm.topi.util import nchw_pack_layout
+from tvm.topi.utils import nchw_pack_layout
def upsample_nearest(arr, scale):
diff --git a/python/tvm/topi/transform.py b/python/tvm/topi/transform.py
index c4e51a8..b4a7d1c 100644
--- a/python/tvm/topi/transform.py
+++ b/python/tvm/topi/transform.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import topi
from . import cpp
from . import tag
-from .util import within_index, make_idx
+from .utils import within_index, make_idx
def expand_dims(a, axis, num_newaxis=1):
diff --git a/python/tvm/topi/util.py b/python/tvm/topi/utils.py
similarity index 99%
rename from python/tvm/topi/util.py
rename to python/tvm/topi/utils.py
index 0a5c93c..ea08f3a 100644
--- a/python/tvm/topi/util.py
+++ b/python/tvm/topi/utils.py
@@ -450,4 +450,4 @@ def is_empty_shape(shape):
is_empty: bool
Whether input shape is empty or has dimesion with size 0.
"""
- return cpp.util.is_empty_shape(shape)
+ return cpp.utils.is_empty_shape(shape)
diff --git a/python/tvm/topi/vision/rcnn/proposal.py b/python/tvm/topi/vision/rcnn/proposal.py
index cda7522..89726ef 100644
--- a/python/tvm/topi/vision/rcnn/proposal.py
+++ b/python/tvm/topi/vision/rcnn/proposal.py
@@ -19,7 +19,7 @@
import math
import tvm
from tvm import te
-from ...util import get_const_tuple, get_const_int
+from ...utils import get_const_tuple, get_const_int
from ...sort import argsort
diff --git a/python/tvm/topi/vision/rcnn/roi_align.py b/python/tvm/topi/vision/rcnn/roi_align.py
index eafdc21..a51ba33 100644
--- a/python/tvm/topi/vision/rcnn/roi_align.py
+++ b/python/tvm/topi/vision/rcnn/roi_align.py
@@ -18,8 +18,8 @@
"""Roi align operator"""
import tvm
from tvm import te
-from ...util import get_const_tuple
-from ...cpp.util import bilinear_sample_nchw
+from ...utils import get_const_tuple
+from ...cpp.utils import bilinear_sample_nchw
def roi_align_nchw(data, rois, pooled_size, spatial_scale, sample_ratio=-1):
diff --git a/python/tvm/topi/vision/rcnn/roi_pool.py b/python/tvm/topi/vision/rcnn/roi_pool.py
index 2254b74..dd1429b 100644
--- a/python/tvm/topi/vision/rcnn/roi_pool.py
+++ b/python/tvm/topi/vision/rcnn/roi_pool.py
@@ -18,7 +18,7 @@
"""ROI pool operator"""
import tvm
from tvm import te
-from ...util import get_const_tuple
+from ...utils import get_const_tuple
def roi_pool_nchw(data, rois, pooled_size, spatial_scale):
diff --git a/python/tvm/topi/x86/batch_matmul.py b/python/tvm/topi/x86/batch_matmul.py
index 100bdf2..166c79a 100644
--- a/python/tvm/topi/x86/batch_matmul.py
+++ b/python/tvm/topi/x86/batch_matmul.py
@@ -21,7 +21,7 @@ from tvm import autotvm
from tvm.autotvm.task.space import SplitEntity
from tvm.contrib import cblas, mkl
from .. import generic
-from ..util import traverse_inline, get_const_tuple, get_max_power2_factor
+from ..utils import traverse_inline, get_const_tuple, get_max_power2_factor
@autotvm.register_topi_compute("batch_matmul.x86")
diff --git a/python/tvm/topi/x86/bitserial_conv2d.py b/python/tvm/topi/x86/bitserial_conv2d.py
index 5fcc9e1..18f3050 100644
--- a/python/tvm/topi/x86/bitserial_conv2d.py
+++ b/python/tvm/topi/x86/bitserial_conv2d.py
@@ -20,9 +20,9 @@ import tvm
from tvm import te
from tvm import autotvm
from .. import tag
-from ..util import get_const_int, get_const_tuple
+from ..utils import get_const_int, get_const_tuple
from ..nn.pad import pad
-from ..nn.util import get_pad_tuple
+from ..nn.utils import get_pad_tuple
from ..nn.bitserial_util import bitpack, binary_op_multiplier
diff --git a/python/tvm/topi/x86/bitserial_dense.py b/python/tvm/topi/x86/bitserial_dense.py
index e9546ac..7af18f6 100644
--- a/python/tvm/topi/x86/bitserial_dense.py
+++ b/python/tvm/topi/x86/bitserial_dense.py
@@ -20,7 +20,7 @@ from __future__ import absolute_import as _abs
import tvm
from tvm import te
from tvm import autotvm
-from tvm.topi.util import get_const_int, get_const_tuple
+from tvm.topi.utils import get_const_int, get_const_tuple
from .. import tag
from ..nn.bitserial_util import bitpack, binary_op_multiplier
diff --git a/python/tvm/topi/x86/conv2d.py b/python/tvm/topi/x86/conv2d.py
index a52e27a..7b9da8a 100644
--- a/python/tvm/topi/x86/conv2d.py
+++ b/python/tvm/topi/x86/conv2d.py
@@ -27,8 +27,8 @@ from .. import nn
from ..nn.conv2d import conv2d_infer_layout, _get_workload as _get_conv2d_workload
from ..nn.conv2d import unpack_NCHWc_to_nchw
from ..nn.depthwise_conv2d import _get_workload as _get_depthwise_conv2d_workload
-from ..nn.util import get_pad_tuple
-from ..util import get_const_tuple, traverse_inline
+from ..nn.utils import get_pad_tuple
+from ..utils import get_const_tuple, traverse_inline
from . import conv2d_avx_1x1, conv2d_avx_common
logger = logging.getLogger("topi")
diff --git a/python/tvm/topi/x86/conv2d_alter_op.py b/python/tvm/topi/x86/conv2d_alter_op.py
index 1c90841..db3c232 100644
--- a/python/tvm/topi/x86/conv2d_alter_op.py
+++ b/python/tvm/topi/x86/conv2d_alter_op.py
@@ -26,9 +26,9 @@ from tvm import relay
from tvm import autotvm
from .conv2d import _get_default_config
from .conv2d_int8 import is_int8_hw_support, _get_default_config_int8
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
from ..nn import conv2d_legalize, conv2d_alter_layout
-from ..nn.util import get_pad_tuple
+from ..nn.utils import get_pad_tuple
logger = logging.getLogger("topi")
diff --git a/python/tvm/topi/x86/conv2d_avx_1x1.py b/python/tvm/topi/x86/conv2d_avx_1x1.py
index 8ca20be..b4a966e 100644
--- a/python/tvm/topi/x86/conv2d_avx_1x1.py
+++ b/python/tvm/topi/x86/conv2d_avx_1x1.py
@@ -22,11 +22,11 @@ from tvm import te
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
from ..nn.pad import pad
-from ..nn.util import get_pad_tuple
+from ..nn.utils import get_pad_tuple
from ..generic import conv2d as conv2d_generic
-from ..util import get_const_tuple, simplify
+from ..utils import get_const_tuple, simplify
from .tensor_intrin import dot_16x1x16_uint8_int8_int32
-from .util import get_fp32_len
+from .utils import get_fp32_len
def _fallback_schedule(cfg, wkl):
diff --git a/python/tvm/topi/x86/conv2d_avx_common.py b/python/tvm/topi/x86/conv2d_avx_common.py
index 28a698c..8d70744 100644
--- a/python/tvm/topi/x86/conv2d_avx_common.py
+++ b/python/tvm/topi/x86/conv2d_avx_common.py
@@ -20,9 +20,9 @@ import tvm
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
from ..generic import conv2d as conv2d_generic
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
from .tensor_intrin import dot_16x1x16_uint8_int8_int32
-from .util import get_fp32_len
+from .utils import get_fp32_len
def _fallback_schedule(cfg, wkl):
diff --git a/python/tvm/topi/x86/conv2d_int8.py b/python/tvm/topi/x86/conv2d_int8.py
index e2862ec..905ada6 100644
--- a/python/tvm/topi/x86/conv2d_int8.py
+++ b/python/tvm/topi/x86/conv2d_int8.py
@@ -24,10 +24,10 @@ from tvm import autotvm
from ..nn.conv2d import _get_workload as _get_conv2d_workload
from .. import tag
from ..generic import conv2d as conv2d_generic
-from ..nn.util import get_pad_tuple
+from ..nn.utils import get_pad_tuple
from ..nn.conv2d import unpack_NCHWc_to_nchw
from ..nn.depthwise_conv2d import _get_workload as _get_depthwise_conv2d_workload
-from ..util import get_const_tuple, traverse_inline
+from ..utils import get_const_tuple, traverse_inline
from .. import nn
from . import conv2d_avx_1x1, conv2d_avx_common
diff --git a/python/tvm/topi/x86/conv2d_transpose.py b/python/tvm/topi/x86/conv2d_transpose.py
index 105c455..865b62b 100644
--- a/python/tvm/topi/x86/conv2d_transpose.py
+++ b/python/tvm/topi/x86/conv2d_transpose.py
@@ -17,7 +17,7 @@
# pylint: disable=invalid-name,unused-variable,unused-argument,no-member
"""Conv2D Transpose schedule on x86"""
from tvm import te
-from ..util import traverse_inline
+from ..utils import traverse_inline
from .. import nn
from .conv2d import conv2d_nchw, schedule_conv2d_nchw
diff --git a/python/tvm/topi/x86/conv3d.py b/python/tvm/topi/x86/conv3d.py
index 479a27b..cb202f5 100644
--- a/python/tvm/topi/x86/conv3d.py
+++ b/python/tvm/topi/x86/conv3d.py
@@ -22,11 +22,11 @@ import tvm
from tvm import te
from tvm import autotvm
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
-from ..util import traverse_inline
-from ..nn.util import get_pad_tuple3d, infer_pad3d
+from ..utils import traverse_inline
+from ..nn.utils import get_pad_tuple3d, infer_pad3d
from ..nn.pad import pad
-from ..util import get_const_tuple, simplify, get_const_int
-from .util import get_fp32_len
+from ..utils import get_const_tuple, simplify, get_const_int
+from .utils import get_fp32_len
Workload3D = namedtuple(
"Workload",
diff --git a/python/tvm/topi/x86/conv3d_transpose.py b/python/tvm/topi/x86/conv3d_transpose.py
index f986ccf..e743f02 100644
--- a/python/tvm/topi/x86/conv3d_transpose.py
+++ b/python/tvm/topi/x86/conv3d_transpose.py
@@ -19,7 +19,7 @@
"""Conv3D Transpose schedule on x86"""
from tvm import te
-from ..util import traverse_inline
+from ..utils import traverse_inline
from .. import nn
from .conv3d import conv3d_ncdhw, schedule_conv3d_ncdhw
diff --git a/python/tvm/topi/x86/dense.py b/python/tvm/topi/x86/dense.py
index b0cc71a..15d7a1a 100644
--- a/python/tvm/topi/x86/dense.py
+++ b/python/tvm/topi/x86/dense.py
@@ -25,9 +25,9 @@ from tvm.contrib import cblas
from tvm.contrib import mkl
from tvm.contrib import mkldnn
-from .util import get_fp32_len
+from .utils import get_fp32_len
from .. import generic, tag
-from ..util import traverse_inline, get_const_tuple
+from ..utils import traverse_inline, get_const_tuple
def _schedule_dense_pack_template(cfg, s, C):
diff --git a/python/tvm/topi/x86/depthwise_conv2d.py b/python/tvm/topi/x86/depthwise_conv2d.py
index 1921f7f..badba1a 100644
--- a/python/tvm/topi/x86/depthwise_conv2d.py
+++ b/python/tvm/topi/x86/depthwise_conv2d.py
@@ -22,12 +22,12 @@ from tvm import te
from tvm import autotvm
from tvm.autotvm.task.space import SplitEntity, OtherOptionEntity
from ..nn.pad import pad
-from ..util import get_const_tuple
-from ..nn.util import get_pad_tuple
+from ..utils import get_const_tuple
+from ..nn.utils import get_pad_tuple
from ..nn.depthwise_conv2d import _get_workload, depthwise_conv2d_infer_layout
from ..nn.conv2d import unpack_NCHWc_to_nchw
-from ..util import traverse_inline
-from .util import get_fp32_len
+from ..utils import traverse_inline
+from .utils import get_fp32_len
def _fallback_schedule(cfg, wkl):
diff --git a/python/tvm/topi/x86/injective.py b/python/tvm/topi/x86/injective.py
index a5e521b..29f903f 100644
--- a/python/tvm/topi/x86/injective.py
+++ b/python/tvm/topi/x86/injective.py
@@ -17,7 +17,7 @@
# pylint: disable=invalid-name
"""x86 declaration and schedules."""
from tvm import te
-from ..util import is_empty_shape
+from ..utils import is_empty_shape
def schedule_injective_from_existing(sch, out):
diff --git a/python/tvm/topi/x86/reduction.py b/python/tvm/topi/x86/reduction.py
index 69659de..db3ea81 100644
--- a/python/tvm/topi/x86/reduction.py
+++ b/python/tvm/topi/x86/reduction.py
@@ -20,7 +20,7 @@ import tvm
from tvm import te
from .injective import schedule_injective_from_existing
from .. import tag
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
def _schedule_reduce(sch, op, is_idx_reduce=False):
diff --git a/python/tvm/topi/x86/roi_align.py b/python/tvm/topi/x86/roi_align.py
index baa23ad..ac2146b 100644
--- a/python/tvm/topi/x86/roi_align.py
+++ b/python/tvm/topi/x86/roi_align.py
@@ -21,7 +21,7 @@ import tvm
from tvm.te import hybrid
from ..tensor import full
-from ..util import get_const_tuple
+from ..utils import get_const_tuple
@hybrid.script
diff --git a/python/tvm/topi/x86/sparse.py b/python/tvm/topi/x86/sparse.py
index 8c4a387..b629108 100644
--- a/python/tvm/topi/x86/sparse.py
+++ b/python/tvm/topi/x86/sparse.py
@@ -18,8 +18,8 @@
"""sparse_dense schedule on x86"""
from tvm import te
-from ..util import traverse_inline, get_const_int
-from .util import get_fp32_len
+from ..utils import traverse_inline, get_const_int
+from .utils import get_fp32_len
def schedule_sparse_dense(outs):
diff --git a/python/tvm/topi/x86/util.py b/python/tvm/topi/x86/utils.py
similarity index 100%
rename from python/tvm/topi/x86/util.py
rename to python/tvm/topi/x86/utils.py
diff --git a/src/topi/schedule.cc b/src/topi/schedule.cc
index 83457ce..c315d40 100644
--- a/src/topi/schedule.cc
+++ b/src/topi/schedule.cc
@@ -182,11 +182,11 @@ TVM_REGISTER_GLOBAL("topi.cuda.schedule_lrn").set_body([](TVMArgs args, TVMRetVa
});
/* Utility functions */
-TVM_REGISTER_GLOBAL("topi.util.is_empty_shape").set_body([](TVMArgs args, TVMRetValue* rv) {
+TVM_REGISTER_GLOBAL("topi.utils.is_empty_shape").set_body([](TVMArgs args, TVMRetValue* rv) {
*rv = topi::detail::is_empty_shape(args[0]);
});
-TVM_REGISTER_GLOBAL("topi.util.bilinear_sample_nchw").set_body([](TVMArgs args, TVMRetValue* rv) {
+TVM_REGISTER_GLOBAL("topi.utils.bilinear_sample_nchw").set_body([](TVMArgs args, TVMRetValue* rv) {
*rv = detail::bilinear_sample_nchw(args[0], args[1], args[2], args[3]);
});
diff --git a/tests/micro/qemu/test_zephyr.py b/tests/micro/qemu/test_zephyr.py
index 67943ce..a5fff78 100644
--- a/tests/micro/qemu/test_zephyr.py
+++ b/tests/micro/qemu/test_zephyr.py
@@ -30,7 +30,7 @@ import tvm.micro
import tvm.relay
from tvm.micro.contrib import zephyr
-from tvm.contrib import util
+from tvm.contrib import utils
BUILD = True
DEBUG = False
@@ -93,7 +93,7 @@ def _make_session(mod):
os.unlink(prev_build)
session_kw["binary"].archive(prev_build, metadata_only=True)
else:
- unarchive_dir = util.tempdir()
+ unarchive_dir = utils.tempdir()
session_kw["binary"] = tvm.micro.MicroBinary.unarchive(
prev_build, unarchive_dir.relpath("binary")
)
diff --git a/tests/micro/test_runtime_micro_on_arm.py b/tests/micro/test_runtime_micro_on_arm.py
index cc4066d..45ca8e7 100644
--- a/tests/micro/test_runtime_micro_on_arm.py
+++ b/tests/micro/test_runtime_micro_on_arm.py
@@ -19,7 +19,7 @@ import os
import numpy as np
import tvm
from tvm import te
-from tvm.contrib import graph_runtime, util
+from tvm.contrib import graph_runtime, utils
from tvm import relay
import tvm.micro as micro
from tvm.micro import create_micro_mod
diff --git a/tests/python/all-platform-minimal-test/test_minimal_target_codegen_llvm.py b/tests/python/all-platform-minimal-test/test_minimal_target_codegen_llvm.py
index 6c2897b..9861a1c 100644
--- a/tests/python/all-platform-minimal-test/test_minimal_target_codegen_llvm.py
+++ b/tests/python/all-platform-minimal-test/test_minimal_target_codegen_llvm.py
@@ -20,7 +20,7 @@ import tvm
import tvm.testing
from tvm import te
from tvm import topi
-from tvm.contrib import util, clang
+from tvm.contrib import utils, clang
import numpy as np
import ctypes
import math
@@ -86,7 +86,7 @@ def test_llvm_import():
if not clang.find_clang(required=False):
print("skip because clang is not available")
return
- temp = util.tempdir()
+ temp = utils.tempdir()
ll_path = temp.relpath("temp.ll")
ll_code = clang.create_llvm(cc_code, output=ll_path)
s = te.create_schedule(B.op)
diff --git a/tests/python/contrib/test_arm_compute_lib/infrastructure.py b/tests/python/contrib/test_arm_compute_lib/infrastructure.py
index 42b111b..0e44480 100644
--- a/tests/python/contrib/test_arm_compute_lib/infrastructure.py
+++ b/tests/python/contrib/test_arm_compute_lib/infrastructure.py
@@ -26,7 +26,7 @@ from tvm import relay
from tvm import rpc
from tvm.contrib import graph_runtime
from tvm.relay.op.contrib import arm_compute_lib
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.autotvm.measure import request_remote
@@ -226,7 +226,7 @@ def build_and_run(
def update_lib(lib, device, cross_compile):
"""Export the library to the remote/local device."""
lib_name = "mod.so"
- temp = util.tempdir()
+ temp = utils.tempdir()
lib_path = temp.relpath(lib_name)
if cross_compile:
lib.export_library(lib_path, cc=cross_compile)
diff --git a/tests/python/contrib/test_binutil.py b/tests/python/contrib/test_binutils.py
similarity index 96%
rename from tests/python/contrib/test_binutil.py
rename to tests/python/contrib/test_binutils.py
index 83b220f..f0aa2d1 100644
--- a/tests/python/contrib/test_binutil.py
+++ b/tests/python/contrib/test_binutils.py
@@ -26,9 +26,9 @@ Specifically, we test the following capabilities:
import tvm
from tvm import te
import subprocess
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.contrib import cc
-from tvm.contrib.binutil import *
+from tvm.contrib.binutils import *
TOOLCHAIN_PREFIX = ""
@@ -39,7 +39,7 @@ def make_binary():
int b = 5; \
return 0; \
}"
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_source = tmp_dir.relpath("source.c")
tmp_obj = tmp_dir.relpath("obj.obj")
with open(tmp_source, "w") as f:
@@ -52,7 +52,7 @@ def make_binary():
def test_tvm_callback_get_section_size(binary=None):
if binary is None:
binary = make_binary()
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_bin = tmp_dir.relpath("obj.bin")
with open(tmp_bin, "wb") as f:
f.write(binary)
@@ -76,7 +76,7 @@ def test_tvm_callback_get_section_size(binary=None):
def test_tvm_callback_relocate_binary():
binary = make_binary()
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_bin = tmp_dir.relpath("obj.bin")
with open(tmp_bin, "wb") as f:
f.write(binary)
@@ -133,7 +133,7 @@ def test_tvm_callback_read_binary_section():
def test_tvm_callback_get_symbol_map():
binary = make_binary()
- tmp_dir = util.tempdir()
+ tmp_dir = utils.tempdir()
tmp_bin = tmp_dir.relpath("obj.bin")
with open(tmp_bin, "wb") as f:
f.write(binary)
diff --git a/tests/python/contrib/test_coreml_runtime.py b/tests/python/contrib/test_coreml_runtime.py
index f6b9d9e..c0076d6 100644
--- a/tests/python/contrib/test_coreml_runtime.py
+++ b/tests/python/contrib/test_coreml_runtime.py
@@ -18,7 +18,7 @@ import tvm
from tvm import te
import numpy as np
from tvm import rpc
-from tvm.contrib import util, xcode, coreml_runtime
+from tvm.contrib import utils, xcode, coreml_runtime
import pytest
import os
@@ -82,7 +82,7 @@ def test_coreml_runtime():
np.testing.assert_almost_equal(c_out, t_out, 3)
def check_remote(coreml_model):
- temp = util.tempdir()
+ temp = utils.tempdir()
compiled_model = xcode.compile_coreml(coreml_model, out_dir=temp.temp_dir)
xcode.popen_test_rpc(
proxy_host, proxy_port, key, destination=destination, libs=[compiled_model]
@@ -93,7 +93,7 @@ def test_coreml_runtime():
verify(coreml_model, compiled_model, ctx)
def check_local(coreml_model):
- temp = util.tempdir()
+ temp = utils.tempdir()
compiled_model = xcode.compile_coreml(coreml_model, out_dir=temp.temp_dir)
ctx = tvm.cpu(0)
verify(coreml_model, compiled_model, ctx)
diff --git a/tests/python/contrib/test_edgetpu_runtime.py b/tests/python/contrib/test_edgetpu_runtime.py
index eef9e0b..8c6113c 100644
--- a/tests/python/contrib/test_edgetpu_runtime.py
+++ b/tests/python/contrib/test_edgetpu_runtime.py
@@ -19,7 +19,7 @@ import tvm
from tvm import te
import numpy as np
from tvm import rpc
-from tvm.contrib import util, tflite_runtime
+from tvm.contrib import utils, tflite_runtime
# import tflite_runtime.interpreter as tflite
diff --git a/tests/python/contrib/test_ethosn/infrastructure.py b/tests/python/contrib/test_ethosn/infrastructure.py
index 8f07a37..905d066 100644
--- a/tests/python/contrib/test_ethosn/infrastructure.py
+++ b/tests/python/contrib/test_ethosn/infrastructure.py
@@ -20,7 +20,7 @@
from __future__ import absolute_import, print_function
import tvm
from tvm import relay
-from tvm.contrib import util, graph_runtime, download
+from tvm.contrib import utils, graph_runtime, download
from hashlib import md5
from itertools import zip_longest, combinations
import numpy as np
@@ -61,7 +61,7 @@ def assert_lib_hash(lib, golden):
if isinstance(golden, str):
golden = {golden}
- temp = util.tempdir()
+ temp = utils.tempdir()
path = temp.relpath("lib.cmm")
hash_set = set()
for mod in lib.imported_modules:
@@ -207,7 +207,7 @@ def run(lib, inputs, outputs, npu=True):
"""
# Export and load lib to confirm this works
lib_name = "mod.so"
- temp = util.tempdir()
+ temp = utils.tempdir()
lib_path = temp.relpath(lib_name)
lib.export_library(lib_path)
lib = tvm.runtime.load_module(lib_path)
diff --git a/tests/python/contrib/test_nnpack.py b/tests/python/contrib/test_nnpack.py
index a92b930..bcb4358 100644
--- a/tests/python/contrib/test_nnpack.py
+++ b/tests/python/contrib/test_nnpack.py
@@ -19,7 +19,7 @@ import tvm.testing
from tvm import te
import numpy as np
import scipy.signal
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.nn.utils import get_pad_tuple
from tvm.contrib import nnpack
import pytest
diff --git a/tests/python/contrib/test_tflite_runtime.py b/tests/python/contrib/test_tflite_runtime.py
index c24747d..39d8881 100644
--- a/tests/python/contrib/test_tflite_runtime.py
+++ b/tests/python/contrib/test_tflite_runtime.py
@@ -20,7 +20,7 @@ import tvm
from tvm import te
import numpy as np
from tvm import rpc
-from tvm.contrib import util, tflite_runtime
+from tvm.contrib import utils, tflite_runtime
def _create_tflite_model():
@@ -70,7 +70,7 @@ def test_local():
tflite_fname = "model.tflite"
tflite_model = _create_tflite_model()
- temp = util.tempdir()
+ temp = utils.tempdir()
tflite_model_path = temp.relpath(tflite_fname)
open(tflite_model_path, "wb").write(tflite_model)
@@ -111,7 +111,7 @@ def test_remote():
tflite_fname = "model.tflite"
tflite_model = _create_tflite_model()
- temp = util.tempdir()
+ temp = utils.tempdir()
tflite_model_path = temp.relpath(tflite_fname)
open(tflite_model_path, "wb").write(tflite_model)
diff --git a/tests/python/contrib/test_util.py b/tests/python/contrib/test_util.py
index 29c6fbf..5078450 100644
--- a/tests/python/contrib/test_util.py
+++ b/tests/python/contrib/test_util.py
@@ -19,7 +19,7 @@
import datetime
import os
import shutil
-from tvm.contrib import util
+from tvm.contrib import utils
def validate_debug_dir_path(temp_dir, expected_basename):
@@ -32,55 +32,55 @@ def validate_debug_dir_path(temp_dir, expected_basename):
def test_tempdir():
- assert util.TempDirectory._KEEP_FOR_DEBUG == False, "don't submit with KEEP_FOR_DEBUG == True"
+ assert utils.TempDirectory._KEEP_FOR_DEBUG == False, "don't submit with KEEP_FOR_DEBUG == True"
- temp_dir = util.tempdir()
+ temp_dir = utils.tempdir()
assert os.path.exists(temp_dir.temp_dir)
- old_debug_mode = util.TempDirectory._KEEP_FOR_DEBUG
- old_tempdirs = util.TempDirectory.TEMPDIRS
+ old_debug_mode = utils.TempDirectory._KEEP_FOR_DEBUG
+ old_tempdirs = utils.TempDirectory.TEMPDIRS
try:
for temp_dir_number in range(0, 3):
- with util.TempDirectory.set_keep_for_debug():
- debug_temp_dir = util.tempdir()
+ with utils.TempDirectory.set_keep_for_debug():
+ debug_temp_dir = utils.tempdir()
try:
validate_debug_dir_path(debug_temp_dir, "0000" + str(temp_dir_number))
finally:
shutil.rmtree(debug_temp_dir.temp_dir)
- with util.TempDirectory.set_keep_for_debug():
+ with utils.TempDirectory.set_keep_for_debug():
# Create 2 temp_dir within the same session.
- debug_temp_dir = util.tempdir()
+ debug_temp_dir = utils.tempdir()
try:
validate_debug_dir_path(debug_temp_dir, "00003")
finally:
shutil.rmtree(debug_temp_dir.temp_dir)
- debug_temp_dir = util.tempdir()
+ debug_temp_dir = utils.tempdir()
try:
validate_debug_dir_path(debug_temp_dir, "00004")
finally:
shutil.rmtree(debug_temp_dir.temp_dir)
- with util.TempDirectory.set_keep_for_debug(False):
- debug_temp_dir = util.tempdir() # This one should get deleted.
+ with utils.TempDirectory.set_keep_for_debug(False):
+ debug_temp_dir = utils.tempdir() # This one should get deleted.
# Simulate atexit hook
- util.TempDirectory.remove_tempdirs()
+ utils.TempDirectory.remove_tempdirs()
# Calling twice should be a no-op.
- util.TempDirectory.remove_tempdirs()
+ utils.TempDirectory.remove_tempdirs()
# Creating a new TempDirectory should fail now
try:
- util.tempdir()
+ utils.tempdir()
assert False, "creation should fail"
- except util.DirectoryCreatedPastAtExit:
+ except utils.DirectoryCreatedPastAtExit:
pass
finally:
- util.TempDirectory.DEBUG_MODE = old_debug_mode
- util.TempDirectory.TEMPDIRS = old_tempdirs
+ utils.TempDirectory.DEBUG_MODE = old_debug_mode
+ utils.TempDirectory.TEMPDIRS = old_tempdirs
if __name__ == "__main__":
diff --git a/tests/python/frontend/caffe/test_forward.py b/tests/python/frontend/caffe/test_forward.py
index 2005090..d75ecd8 100644
--- a/tests/python/frontend/caffe/test_forward.py
+++ b/tests/python/frontend/caffe/test_forward.py
@@ -36,7 +36,7 @@ from caffe.proto import caffe_pb2 as pb
import tvm
from tvm import relay
-from tvm.contrib import util, graph_runtime
+from tvm.contrib import utils, graph_runtime
from tvm.contrib.download import download_testdata
CURRENT_DIR = os.path.join(os.path.expanduser("~"), ".tvm_test_data", "caffe_test")
diff --git a/tests/python/frontend/tensorflow/test_forward.py b/tests/python/frontend/tensorflow/test_forward.py
index 0bcac7f..e8e38b8 100644
--- a/tests/python/frontend/tensorflow/test_forward.py
+++ b/tests/python/frontend/tensorflow/test_forward.py
@@ -2848,11 +2848,11 @@ def test_forward_inception_v1():
# Build an image from random data.
from PIL import Image
- from tvm.contrib import util
+ from tvm.contrib import utils
img_array = np.random.uniform(size=(1, 600, 600, 3)).astype("uint8")
img = Image.frombuffer("RGB", (600, 600), img_array.tostring(), "raw", "RGB", 0, 1)
- temp = util.tempdir()
+ temp = utils.tempdir()
img_path = temp.relpath("tf-test.jpg")
img.save(img_path)
diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py
index 3f860a3..89ae348 100644
--- a/tests/python/frontend/tflite/test_forward.py
+++ b/tests/python/frontend/tflite/test_forward.py
@@ -3724,7 +3724,7 @@ def test_forward_qnn_coco_ssd_mobilenet_v1():
"""Test the quantized Coco SSD Mobilenet V1 TF Lite model."""
pytest.skip(
"LLVM bug - getExtendedVectorNumElements - "
- + "https://discuss.tvm.ai/t/segfault-in-llvm/3567. The workaround is to use a "
+ + "https://discuss.tvm.apache.org/t/segfault-in-llvm/3567. The workaround is to use a "
+ "specific target, for example, llvm -mpcu=core-avx2"
)
diff --git a/tests/python/integration/test_winograd_nnpack.py b/tests/python/integration/test_winograd_nnpack.py
index f29d1fb..d326993 100644
--- a/tests/python/integration/test_winograd_nnpack.py
+++ b/tests/python/integration/test_winograd_nnpack.py
@@ -23,7 +23,7 @@ from tvm.contrib import nnpack
from tvm.contrib.pickle_memoize import memoize
from tvm import topi
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from pytest import skip
import tvm.testing
diff --git a/tests/python/relay/test_any.py b/tests/python/relay/test_any.py
index d39e04e..8784b97 100644
--- a/tests/python/relay/test_any.py
+++ b/tests/python/relay/test_any.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import relay
from tvm.relay.loops import while_loop
from tvm.relay.testing import run_infer_type as infer_type
-from util.assert_diagnostic import DiagnosticTesting
+from utils.assert_diagnostic import DiagnosticTesting
import tvm.topi.testing
diff --git a/tests/python/relay/test_external_codegen.py b/tests/python/relay/test_external_codegen.py
index c919e7c..b2c4dd9 100644
--- a/tests/python/relay/test_external_codegen.py
+++ b/tests/python/relay/test_external_codegen.py
@@ -25,7 +25,7 @@ import tvm.relay.testing
import tvm.relay.transform
from tvm import relay
from tvm import runtime
-from tvm.contrib import util
+from tvm.contrib import utils
def check_result(mod, map_inputs, out_shape, result, tol=1e-5, target="llvm", ctx=tvm.cpu()):
@@ -40,7 +40,7 @@ def check_result(mod, map_inputs, out_shape, result, tol=1e-5, target="llvm", ct
kwargs = {}
kwargs["options"] = ["-O2", "-std=c++14", "-I" + contrib_path]
- tmp_path = util.tempdir()
+ tmp_path = utils.tempdir()
lib_name = "lib.so"
lib_path = tmp_path.relpath(lib_name)
lib.export_library(lib_path, fcompile=False, **kwargs)
diff --git a/tests/python/relay/test_json_runtime.py b/tests/python/relay/test_json_runtime.py
index c09dab3..df4dff8 100644
--- a/tests/python/relay/test_json_runtime.py
+++ b/tests/python/relay/test_json_runtime.py
@@ -24,7 +24,7 @@ import tvm
import tvm.relay.op as reg
import tvm.relay.testing
from tvm import relay, runtime
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.relay import transform
from tvm.relay.backend import compile_engine
from tvm.relay.build_module import bind_params_by_name
diff --git a/tests/python/relay/test_op_grad_level2.py b/tests/python/relay/test_op_grad_level2.py
index 85332da..80a567d 100644
--- a/tests/python/relay/test_op_grad_level2.py
+++ b/tests/python/relay/test_op_grad_level2.py
@@ -38,7 +38,7 @@ def verify_max_pool2d_grad(x_shape, pool_size, strides, padding, ceil_mode):
data = np.random.rand(*x_shape).astype("float32")
ph, pw = padding
- y_shape = topi.util.get_const_tuple(fwd_func.ret_type.shape)
+ y_shape = topi.utils.get_const_tuple(fwd_func.ret_type.shape)
out_grad = np.ones(shape=y_shape)
ref_grad = tvm.topi.testing.pool_grad_nchw(
data,
@@ -87,7 +87,7 @@ def verify_avg_pool2d_grad(
data = np.random.rand(*x_shape).astype(dtype)
ph, pw = padding
- y_shape = topi.util.get_const_tuple(fwd_func.ret_type.shape)
+ y_shape = topi.utils.get_const_tuple(fwd_func.ret_type.shape)
out_grad = np.ones(shape=y_shape)
ref_grad = tvm.topi.testing.pool_grad_nchw(
data,
@@ -143,7 +143,7 @@ def verify_global_avg_pool2d_grad(x_shape):
bwd_func = run_infer_type(gradient(fwd_func))
data = np.random.rand(*x_shape).astype("float32")
- y_shape = topi.util.get_const_tuple(fwd_func.ret_type.shape)
+ y_shape = topi.utils.get_const_tuple(fwd_func.ret_type.shape)
out_grad = np.ones(shape=y_shape)
ref_grad = tvm.topi.testing.pool_grad_nchw(
data,
diff --git a/tests/python/relay/test_op_level2.py b/tests/python/relay/test_op_level2.py
index 546ea60..a2b791d 100644
--- a/tests/python/relay/test_op_level2.py
+++ b/tests/python/relay/test_op_level2.py
@@ -23,7 +23,7 @@ from tvm import autotvm
from tvm import relay
from tvm.relay import transform
from tvm.relay.testing import run_infer_type
-from tvm.contrib import util
+from tvm.contrib import utils
import tvm.topi.testing
from tvm.topi.cuda.conv3d_winograd import _infer_tile_size
import tvm.testing
@@ -258,7 +258,7 @@ def test_conv2d_run():
["data_pad_inline", "ot", 4], ["data_vec_inline", "ot", 1], \
["conv_inline", "ot", 0]]}], "r": [[0.0002933163], \
0, 3.1976189613342285, 1570811630.6058347], "v": 0.1}'
- temp = util.tempdir()
+ temp = utils.tempdir()
with open(temp.relpath("temp.log"), "w") as log_file:
log_file.write(test_schedule)
with autotvm.apply_history_best(temp.relpath("temp.log")):
diff --git a/tests/python/relay/test_op_qnn_conv2d.py b/tests/python/relay/test_op_qnn_conv2d.py
index e14bba2..67d4c6f 100644
--- a/tests/python/relay/test_op_qnn_conv2d.py
+++ b/tests/python/relay/test_op_qnn_conv2d.py
@@ -176,7 +176,7 @@ def get_funcs(
def verify(ref_func, qnn_func, data_shape, data_dtype, kernel_shape, kernel_dtype):
def get_inputs(data_shape, data_dtype, kernel_shape, kernel_dtype):
# Keeping inputs multiple of 4 because of a bug in Average Pool2d
- # https://discuss.tvm.ai/t/pool2d-gives-bad-output-for-integer-inputs/3377
+ # https://discuss.tvm.apache.org/t/pool2d-gives-bad-output-for-integer-inputs/3377
low = -128
high = 127
if data_dtype == "uint8":
diff --git a/tests/python/relay/test_param_dict.py b/tests/python/relay/test_param_dict.py
index 68e4b50..74c9ebc 100644
--- a/tests/python/relay/test_param_dict.py
+++ b/tests/python/relay/test_param_dict.py
@@ -24,7 +24,7 @@ from tvm._ffi.base import py_str
from tvm.relay.op import add
from tvm import relay
from tvm import rpc
-from tvm.contrib import util, graph_runtime
+from tvm.contrib import utils, graph_runtime
def test_save_load():
@@ -70,7 +70,7 @@ def test_bigendian_rpc_param():
params = {"x": x_in}
graph, lib, params = relay.build(func, target=target, params=params)
- temp = util.tempdir()
+ temp = utils.tempdir()
path_dso = temp.relpath("dev_lib.o")
lib.save(path_dso)
remote.upload(path_dso)
diff --git a/tests/python/relay/test_pass_annotate_target.py b/tests/python/relay/test_pass_annotate_target.py
index 30b35fb..b99e3bc 100644
--- a/tests/python/relay/test_pass_annotate_target.py
+++ b/tests/python/relay/test_pass_annotate_target.py
@@ -25,7 +25,7 @@ import tvm.relay.testing
import tvm.relay.transform as transform
from tvm import relay
from tvm import runtime
-from tvm.contrib import util
+from tvm.contrib import utils
def check_result(
@@ -42,7 +42,7 @@ def check_result(
kwargs = {}
kwargs["options"] = ["-O2", "-std=c++14", "-I" + contrib_path]
- tmp_path = util.tempdir()
+ tmp_path = utils.tempdir()
lib_name = "lib.so"
lib_path = tmp_path.relpath(lib_name)
lib.export_library(lib_path, fcompile=False, **kwargs)
diff --git a/tests/python/relay/test_pass_auto_quantize.py b/tests/python/relay/test_pass_auto_quantize.py
index 034cb48..8a7c4cb 100644
--- a/tests/python/relay/test_pass_auto_quantize.py
+++ b/tests/python/relay/test_pass_auto_quantize.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import relay
from tvm.relay import testing
from tvm.relay.expr import Call
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
def quantize_and_build(out):
diff --git a/tests/python/relay/test_pass_merge_compiler_regions.py b/tests/python/relay/test_pass_merge_compiler_regions.py
index 8447eef..ba94021 100644
--- a/tests/python/relay/test_pass_merge_compiler_regions.py
+++ b/tests/python/relay/test_pass_merge_compiler_regions.py
@@ -89,7 +89,7 @@ def test_diamond_graph_fanouts():
def test_example_graph():
"""This tests the merging algorithm on the example used in the RFC.
- See the RFC here: https://discuss.tvm.ai/t/relay-improved-graph-partitioning-algorithm/5830
+ See the RFC here: https://discuss.tvm.apache.org/t/relay-improved-graph-partitioning-algorithm/5830
Blue nodes are adds (target: test), red nodes are subtracts (target: default).
"""
diff --git a/tests/python/relay/test_pass_partition_graph.py b/tests/python/relay/test_pass_partition_graph.py
index 2fd440e..8d0e2d5 100644
--- a/tests/python/relay/test_pass_partition_graph.py
+++ b/tests/python/relay/test_pass_partition_graph.py
@@ -27,7 +27,7 @@ import tvm.relay.op as reg
from tvm import relay
from tvm import runtime
from tvm.relay import transform
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.relay.backend import compile_engine
from tvm.relay.expr_functor import ExprMutator
from tvm.relay.op.annotation import compiler_begin, compiler_end
@@ -186,7 +186,7 @@ def check_result(
kwargs = {}
kwargs["options"] = ["-O2", "-std=c++14", "-I" + contrib_path]
- tmp_path = util.tempdir()
+ tmp_path = utils.tempdir()
lib_name = "lib.so"
lib_path = tmp_path.relpath(lib_name)
lib.export_library(lib_path, fcompile=False, **kwargs)
diff --git a/tests/python/relay/test_vm_serialization.py b/tests/python/relay/test_vm_serialization.py
index 14f003e..b2a695d 100644
--- a/tests/python/relay/test_vm_serialization.py
+++ b/tests/python/relay/test_vm_serialization.py
@@ -27,7 +27,7 @@ from tvm import relay
from tvm.relay.scope_builder import ScopeBuilder
from tvm.relay import transform
from tvm.relay.prelude import Prelude
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.relay import testing
@@ -129,7 +129,7 @@ def test_save_load():
assert isinstance(code, bytearray)
# save and load the code and lib file.
- tmp = util.tempdir()
+ tmp = utils.tempdir()
path_lib = tmp.relpath("lib.so")
lib.export_library(path_lib)
with open(tmp.relpath("code.ro"), "wb") as fo:
diff --git a/tests/python/relay/util/assert_diagnostic.py b/tests/python/relay/utils/assert_diagnostic.py
similarity index 100%
rename from tests/python/relay/util/assert_diagnostic.py
rename to tests/python/relay/utils/assert_diagnostic.py
diff --git a/tests/python/topi/python/test_topi_basic.py b/tests/python/topi/python/test_topi_basic.py
index 0743198..108b92d 100644
--- a/tests/python/topi/python/test_topi_basic.py
+++ b/tests/python/topi/python/test_topi_basic.py
@@ -17,13 +17,13 @@
import tvm
from tvm import te
from tvm import topi
-from tvm.topi import util
+from tvm.topi import utils
def test_util():
x = tvm.tir.const(100, "int32")
- assert util.get_const_int(x) == 100
- assert util.get_const_tuple((x, x)) == (100, 100)
+ assert utils.get_const_int(x) == 100
+ assert utils.get_const_tuple((x, x)) == (100, 100)
def test_ewise():
diff --git a/tests/python/topi/python/test_topi_batch_matmul.py b/tests/python/topi/python/test_topi_batch_matmul.py
index 0d82ee6..e939f6c 100644
--- a/tests/python/topi/python/test_topi_batch_matmul.py
+++ b/tests/python/topi/python/test_topi_batch_matmul.py
@@ -20,7 +20,7 @@ import tvm
from tvm import te
from tvm import topi
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_bitserial_conv2d.py b/tests/python/topi/python/test_topi_bitserial_conv2d.py
index 8e55c7b..b0bce44 100644
--- a/tests/python/topi/python/test_topi_bitserial_conv2d.py
+++ b/tests/python/topi/python/test_topi_bitserial_conv2d.py
@@ -20,7 +20,7 @@ from tvm import te
from tvm import topi
import tvm.testing
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
diff --git a/tests/python/topi/python/test_topi_bitserial_conv2d_rasp.py b/tests/python/topi/python/test_topi_bitserial_conv2d_rasp.py
index 76f3422..1cd982d 100644
--- a/tests/python/topi/python/test_topi_bitserial_conv2d_rasp.py
+++ b/tests/python/topi/python/test_topi_bitserial_conv2d_rasp.py
@@ -21,7 +21,7 @@ import tvm
from tvm import te
from tvm import topi
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
def generate_quantized_np(shape, bits, out_dtype):
diff --git a/tests/python/topi/python/test_topi_bitserial_dense.py b/tests/python/topi/python/test_topi_bitserial_dense.py
index 8b565ac..a624b1b 100644
--- a/tests/python/topi/python/test_topi_bitserial_dense.py
+++ b/tests/python/topi/python/test_topi_bitserial_dense.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import topi
import tvm.testing
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
_bitserial_dense_implement = {
diff --git a/tests/python/topi/python/test_topi_bnn.py b/tests/python/topi/python/test_topi_bnn.py
index 1bec2d0..fbd9ac5 100644
--- a/tests/python/topi/python/test_topi_bnn.py
+++ b/tests/python/topi/python/test_topi_bnn.py
@@ -20,7 +20,7 @@ import tvm
import tvm.testing
from tvm import te
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
diff --git a/tests/python/topi/python/test_topi_clip.py b/tests/python/topi/python/test_topi_clip.py
index bee31a5..704ffe7 100644
--- a/tests/python/topi/python/test_topi_clip.py
+++ b/tests/python/topi/python/test_topi_clip.py
@@ -21,7 +21,7 @@ from tvm import te
from tvm import topi
import tvm.testing
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
diff --git a/tests/python/topi/python/test_topi_conv1d.py b/tests/python/topi/python/test_topi_conv1d.py
index 5339103..aad029c 100644
--- a/tests/python/topi/python/test_topi_conv1d.py
+++ b/tests/python/topi/python/test_topi_conv1d.py
@@ -23,7 +23,7 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
_conv1d_ncw_implement = {
diff --git a/tests/python/topi/python/test_topi_conv1d_transpose_ncw.py b/tests/python/topi/python/test_topi_conv1d_transpose_ncw.py
index 5b02d58..c251283 100644
--- a/tests/python/topi/python/test_topi_conv1d_transpose_ncw.py
+++ b/tests/python/topi/python/test_topi_conv1d_transpose_ncw.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
_conv1d_transpose_ncw_implement = {
diff --git a/tests/python/topi/python/test_topi_conv2d_NCHWc.py b/tests/python/topi/python/test_topi_conv2d_NCHWc.py
index a21790d..b1955ef 100644
--- a/tests/python/topi/python/test_topi_conv2d_NCHWc.py
+++ b/tests/python/topi/python/test_topi_conv2d_NCHWc.py
@@ -24,8 +24,8 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
def _transform_data(data, bn):
diff --git a/tests/python/topi/python/test_topi_conv2d_hwcn.py b/tests/python/topi/python/test_topi_conv2d_hwcn.py
index a16499a..bd88839 100644
--- a/tests/python/topi/python/test_topi_conv2d_hwcn.py
+++ b/tests/python/topi/python/test_topi_conv2d_hwcn.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv2d_hwnc_tensorcore.py b/tests/python/topi/python/test_topi_conv2d_hwnc_tensorcore.py
index 7589764..9d63175 100644
--- a/tests/python/topi/python/test_topi_conv2d_hwnc_tensorcore.py
+++ b/tests/python/topi/python/test_topi_conv2d_hwnc_tensorcore.py
@@ -25,8 +25,8 @@ import tvm.topi.testing
from tvm import te, autotvm, topi
from tvm.contrib.pickle_memoize import memoize
from tvm.contrib import nvcc
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
_conv2d_hwnc_tensorcore_implement = {
"cuda": (topi.cuda.conv2d_hwnc_tensorcore, topi.cuda.schedule_conv2d_hwnc_tensorcore)
diff --git a/tests/python/topi/python/test_topi_conv2d_int8.py b/tests/python/topi/python/test_topi_conv2d_int8.py
index b2f9835..e5b0689 100644
--- a/tests/python/topi/python/test_topi_conv2d_int8.py
+++ b/tests/python/topi/python/test_topi_conv2d_int8.py
@@ -24,8 +24,8 @@ from tvm.autotvm.task.space import FallbackConfigEntity
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.topi.arm_cpu.conv2d_gemm import is_aarch64_arm
from common import Int8Fallback
diff --git a/tests/python/topi/python/test_topi_conv2d_nchw.py b/tests/python/topi/python/test_topi_conv2d_nchw.py
index fef46e3..1b75752 100644
--- a/tests/python/topi/python/test_topi_conv2d_nchw.py
+++ b/tests/python/topi/python/test_topi_conv2d_nchw.py
@@ -23,8 +23,8 @@ from tvm import autotvm
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv2d_nhwc.py b/tests/python/topi/python/test_topi_conv2d_nhwc.py
index 747bd4f..8c3b9e9 100644
--- a/tests/python/topi/python/test_topi_conv2d_nhwc.py
+++ b/tests/python/topi/python/test_topi_conv2d_nhwc.py
@@ -22,7 +22,7 @@ from tvm import te
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv2d_nhwc_pack_int8.py b/tests/python/topi/python/test_topi_conv2d_nhwc_pack_int8.py
index f661737..c547ec7 100644
--- a/tests/python/topi/python/test_topi_conv2d_nhwc_pack_int8.py
+++ b/tests/python/topi/python/test_topi_conv2d_nhwc_pack_int8.py
@@ -25,7 +25,7 @@ from tvm.autotvm.task.space import FallbackConfigEntity
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
def verify_conv2d_1x1_nhwc_pack_int8(
diff --git a/tests/python/topi/python/test_topi_conv2d_nhwc_tensorcore.py b/tests/python/topi/python/test_topi_conv2d_nhwc_tensorcore.py
index 8d881b0..eab7341 100644
--- a/tests/python/topi/python/test_topi_conv2d_nhwc_tensorcore.py
+++ b/tests/python/topi/python/test_topi_conv2d_nhwc_tensorcore.py
@@ -24,8 +24,8 @@ import tvm.topi.testing
from tvm import te
from tvm.contrib.pickle_memoize import memoize
from tvm.contrib import nvcc
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv2d_nhwc_winograd.py b/tests/python/topi/python/test_topi_conv2d_nhwc_winograd.py
index 3ffa4ac..ac29fd6 100644
--- a/tests/python/topi/python/test_topi_conv2d_nhwc_winograd.py
+++ b/tests/python/topi/python/test_topi_conv2d_nhwc_winograd.py
@@ -24,8 +24,8 @@ from tvm import topi
import tvm.topi.testing
from tvm import te
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv2d_transpose_nchw.py b/tests/python/topi/python/test_topi_conv2d_transpose_nchw.py
index 267cfbe..5cc2c2e 100644
--- a/tests/python/topi/python/test_topi_conv2d_transpose_nchw.py
+++ b/tests/python/topi/python/test_topi_conv2d_transpose_nchw.py
@@ -21,7 +21,7 @@ from tvm import te
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv2d_winograd.py b/tests/python/topi/python/test_topi_conv2d_winograd.py
index 69ef4f7..9f07dbd 100644
--- a/tests/python/topi/python/test_topi_conv2d_winograd.py
+++ b/tests/python/topi/python/test_topi_conv2d_winograd.py
@@ -24,8 +24,8 @@ from tvm.autotvm.task.space import FallbackConfigEntity
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.nn.util import get_pad_tuple
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv3d_ncdhw.py b/tests/python/topi/python/test_topi_conv3d_ncdhw.py
index 58f30fb..094a710 100644
--- a/tests/python/topi/python/test_topi_conv3d_ncdhw.py
+++ b/tests/python/topi/python/test_topi_conv3d_ncdhw.py
@@ -24,8 +24,8 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.nn.util import get_pad_tuple3d
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple3d
+from tvm.topi.utils import get_const_tuple
_conv3d_ncdhw_implement = {
"generic": (topi.nn.conv3d_ncdhw, topi.generic.schedule_conv3d_ncdhw),
diff --git a/tests/python/topi/python/test_topi_conv3d_ndhwc.py b/tests/python/topi/python/test_topi_conv3d_ndhwc.py
index 2baacc0..2d2541a 100644
--- a/tests/python/topi/python/test_topi_conv3d_ndhwc.py
+++ b/tests/python/topi/python/test_topi_conv3d_ndhwc.py
@@ -23,7 +23,7 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
_conv3d_ndhwc_implement = {
diff --git a/tests/python/topi/python/test_topi_conv3d_ndhwc_tensorcore.py b/tests/python/topi/python/test_topi_conv3d_ndhwc_tensorcore.py
index 9a7d99a..1e027ab 100644
--- a/tests/python/topi/python/test_topi_conv3d_ndhwc_tensorcore.py
+++ b/tests/python/topi/python/test_topi_conv3d_ndhwc_tensorcore.py
@@ -24,8 +24,8 @@ import tvm.topi.testing
from tvm import te
from tvm.contrib.pickle_memoize import memoize
from tvm.contrib import nvcc
-from tvm.topi.nn.util import get_pad_tuple3d
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple3d
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_conv3d_transpose_ncdhw.py b/tests/python/topi/python/test_topi_conv3d_transpose_ncdhw.py
index 480ec19..2ac7ccc 100644
--- a/tests/python/topi/python/test_topi_conv3d_transpose_ncdhw.py
+++ b/tests/python/topi/python/test_topi_conv3d_transpose_ncdhw.py
@@ -22,7 +22,7 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
_conv3d_transpose_ncdhw_implement = {
diff --git a/tests/python/topi/python/test_topi_conv3d_winograd.py b/tests/python/topi/python/test_topi_conv3d_winograd.py
index fbb2995..d00249b 100644
--- a/tests/python/topi/python/test_topi_conv3d_winograd.py
+++ b/tests/python/topi/python/test_topi_conv3d_winograd.py
@@ -24,8 +24,8 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.nn.util import get_pad_tuple3d
-from tvm.topi.util import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple3d
+from tvm.topi.utils import get_const_tuple
_conv3d_ncdhw_implement = {
diff --git a/tests/python/topi/python/test_topi_correlation.py b/tests/python/topi/python/test_topi_correlation.py
index 17c21d6..4709fb7 100644
--- a/tests/python/topi/python/test_topi_correlation.py
+++ b/tests/python/topi/python/test_topi_correlation.py
@@ -23,7 +23,7 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
_correlation_implement = {
"generic": (topi.nn.correlation_nchw, topi.generic.schedule_correlation_nchw),
diff --git a/tests/python/topi/python/test_topi_deformable_conv2d.py b/tests/python/topi/python/test_topi_deformable_conv2d.py
index f57f421..34bfae7 100644
--- a/tests/python/topi/python/test_topi_deformable_conv2d.py
+++ b/tests/python/topi/python/test_topi_deformable_conv2d.py
@@ -21,7 +21,7 @@ from tvm import autotvm
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_dense.py b/tests/python/topi/python/test_topi_dense.py
index f46a271..95ebce4 100644
--- a/tests/python/topi/python/test_topi_dense.py
+++ b/tests/python/topi/python/test_topi_dense.py
@@ -20,7 +20,7 @@ import tvm
from tvm import te
from tvm import topi
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
from common import Int8Fallback
diff --git a/tests/python/topi/python/test_topi_dense_tensorcore.py b/tests/python/topi/python/test_topi_dense_tensorcore.py
index 07dab35..3ffdea5 100644
--- a/tests/python/topi/python/test_topi_dense_tensorcore.py
+++ b/tests/python/topi/python/test_topi_dense_tensorcore.py
@@ -20,7 +20,7 @@ import numpy as np
import tvm
from tvm import topi
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm import te
from tvm.contrib.pickle_memoize import memoize
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_depthwise_conv2d.py b/tests/python/topi/python/test_topi_depthwise_conv2d.py
index 07ddeab..d5fbef9 100644
--- a/tests/python/topi/python/test_topi_depthwise_conv2d.py
+++ b/tests/python/topi/python/test_topi_depthwise_conv2d.py
@@ -20,8 +20,8 @@ from tvm import autotvm
from tvm import topi
import tvm.topi.testing
import numpy as np
-from tvm.topi.util import get_const_tuple
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
from tvm.contrib.pickle_memoize import memoize
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_depthwise_conv2d_back_input.py b/tests/python/topi/python/test_topi_depthwise_conv2d_back_input.py
index 8b4575f..72ad1e2 100644
--- a/tests/python/topi/python/test_topi_depthwise_conv2d_back_input.py
+++ b/tests/python/topi/python/test_topi_depthwise_conv2d_back_input.py
@@ -20,8 +20,8 @@ from tvm import topi
import numpy as np
from tvm.contrib.pickle_memoize import memoize
from scipy import signal
-from tvm.topi.util import get_const_tuple
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
import tvm.topi.testing
from tvm.topi.cuda.depthwise_conv2d import schedule_depthwise_conv2d_backward_input_nhwc
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_depthwise_conv2d_back_weight.py b/tests/python/topi/python/test_topi_depthwise_conv2d_back_weight.py
index 3826f6f..5332811 100644
--- a/tests/python/topi/python/test_topi_depthwise_conv2d_back_weight.py
+++ b/tests/python/topi/python/test_topi_depthwise_conv2d_back_weight.py
@@ -21,8 +21,8 @@ import tvm.topi.testing
import numpy as np
from tvm.contrib.pickle_memoize import memoize
from scipy import signal
-from tvm.topi.util import get_const_tuple
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
from tvm.topi.cuda.depthwise_conv2d import schedule_depthwise_conv2d_backward_weight_nhwc
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_dilate.py b/tests/python/topi/python/test_topi_dilate.py
index 0ee51a6..27e7173 100644
--- a/tests/python/topi/python/test_topi_dilate.py
+++ b/tests/python/topi/python/test_topi_dilate.py
@@ -39,7 +39,7 @@ def test_dilate():
else:
output_np = tvm.topi.testing.dilate_python(input_np, strides, dilation_value)
input_tvm = tvm.nd.array(input_np, ctx=ctx)
- output_size = topi.util.get_const_tuple(Output.shape)
+ output_size = topi.utils.get_const_tuple(Output.shape)
output_tvm = tvm.nd.array(np.zeros(shape=output_size).astype(Output.dtype), ctx=ctx)
f = tvm.build(schedule, [Input, Output], target)
f(input_tvm, output_tvm)
diff --git a/tests/python/topi/python/test_topi_group_conv2d.py b/tests/python/topi/python/test_topi_group_conv2d.py
index 45e77d1..9c4da5c 100644
--- a/tests/python/topi/python/test_topi_group_conv2d.py
+++ b/tests/python/topi/python/test_topi_group_conv2d.py
@@ -24,7 +24,7 @@ from tvm.autotvm.task.space import FallbackConfigEntity
from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from common import Int8Fallback
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_group_conv2d_NCHWc_int8.py b/tests/python/topi/python/test_topi_group_conv2d_NCHWc_int8.py
index 89e0e04..b6cef2e 100644
--- a/tests/python/topi/python/test_topi_group_conv2d_NCHWc_int8.py
+++ b/tests/python/topi/python/test_topi_group_conv2d_NCHWc_int8.py
@@ -25,7 +25,7 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import pytest
diff --git a/tests/python/topi/python/test_topi_lrn.py b/tests/python/topi/python/test_topi_lrn.py
index 7e3300c..2789264 100644
--- a/tests/python/topi/python/test_topi_lrn.py
+++ b/tests/python/topi/python/test_topi_lrn.py
@@ -19,7 +19,7 @@ import numpy as np
import tvm
from tvm import te
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.topi.testing
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_math.py b/tests/python/topi/python/test_topi_math.py
index 149ed82..6e119e7 100644
--- a/tests/python/topi/python/test_topi_math.py
+++ b/tests/python/topi/python/test_topi_math.py
@@ -22,13 +22,13 @@ from tvm import te
from tvm import topi
import tvm.testing
import tvm.topi.testing
-from tvm.topi import util
+from tvm.topi import utils
def test_util():
x = tvm.tir.const(100, "int32")
- assert util.get_const_int(x) == 100
- assert util.get_const_tuple((x, x)) == (100, 100)
+ assert utils.get_const_int(x) == 100
+ assert utils.get_const_tuple((x, x)) == (100, 100)
@tvm.testing.uses_gpu
diff --git a/tests/python/topi/python/test_topi_matmul.py b/tests/python/topi/python/test_topi_matmul.py
index f6933d7..26ba6f8 100644
--- a/tests/python/topi/python/test_topi_matmul.py
+++ b/tests/python/topi/python/test_topi_matmul.py
@@ -19,7 +19,7 @@ import tvm
import tvm.testing
from tvm import te
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
def with_tvm(lam, *args):
diff --git a/tests/python/topi/python/test_topi_pooling.py b/tests/python/topi/python/test_topi_pooling.py
index 251172f..6f62b8a 100644
--- a/tests/python/topi/python/test_topi_pooling.py
+++ b/tests/python/topi/python/test_topi_pooling.py
@@ -23,7 +23,7 @@ from tvm import te
from tvm import topi
import tvm.testing
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
_pool_schedule = {
diff --git a/tests/python/topi/python/test_topi_relu.py b/tests/python/topi/python/test_topi_relu.py
index aa68f23..7c45aca 100644
--- a/tests/python/topi/python/test_topi_relu.py
+++ b/tests/python/topi/python/test_topi_relu.py
@@ -21,7 +21,7 @@ import tvm
from tvm import te
from tvm import topi
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.contrib.nvcc import have_fp16
import tvm.testing
diff --git a/tests/python/topi/python/test_topi_reorg.py b/tests/python/topi/python/test_topi_reorg.py
index 37a0eb9..93464d9 100644
--- a/tests/python/topi/python/test_topi_reorg.py
+++ b/tests/python/topi/python/test_topi_reorg.py
@@ -17,7 +17,7 @@
"""Example code to do reorg."""
import numpy as np
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm
from tvm import te
import tvm.topi.testing
diff --git a/tests/python/topi/python/test_topi_softmax.py b/tests/python/topi/python/test_topi_softmax.py
index df4c4ea..66c44f9 100644
--- a/tests/python/topi/python/test_topi_softmax.py
+++ b/tests/python/topi/python/test_topi_softmax.py
@@ -23,7 +23,7 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
import logging
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
_softmax_schedule = {
diff --git a/tests/python/topi/python/test_topi_sparse.py b/tests/python/topi/python/test_topi_sparse.py
index 9426eb7..62f49e2 100644
--- a/tests/python/topi/python/test_topi_sparse.py
+++ b/tests/python/topi/python/test_topi_sparse.py
@@ -21,7 +21,7 @@ from tvm import te
from tvm import topi
from tvm import relay
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.contrib.sparse as tvmsp
from collections import namedtuple
import time
diff --git a/tests/python/topi/python/test_topi_upsampling.py b/tests/python/topi/python/test_topi_upsampling.py
index 85042c0..0408220 100644
--- a/tests/python/topi/python/test_topi_upsampling.py
+++ b/tests/python/topi/python/test_topi_upsampling.py
@@ -22,7 +22,7 @@ from tvm import topi
import tvm.testing
import tvm.topi.testing
import math
-from tvm.topi.util import nchw_pack_layout
+from tvm.topi.utils import nchw_pack_layout
def verify_upsampling(
diff --git a/tests/python/topi/python/test_topi_util.py b/tests/python/topi/python/test_topi_util.py
index 18182dc..bd7585e 100644
--- a/tests/python/topi/python/test_topi_util.py
+++ b/tests/python/topi/python/test_topi_util.py
@@ -20,7 +20,7 @@ from tvm import topi
def verify_get_shape(src_shape, src_layout, dst_layout, expect_shape):
- dst_shape = topi.util.get_shape(src_shape, src_layout, dst_layout)
+ dst_shape = topi.utils.get_shape(src_shape, src_layout, dst_layout)
assert dst_shape == expect_shape, "Shape mismatch: expecting %s but got %s" % (
expect_shape,
dst_shape,
diff --git a/tests/python/topi/python/test_topi_vision.py b/tests/python/topi/python/test_topi_vision.py
index 0d02dd8..24035ba 100644
--- a/tests/python/topi/python/test_topi_vision.py
+++ b/tests/python/topi/python/test_topi_vision.py
@@ -24,7 +24,7 @@ from tvm import topi
import tvm.topi.testing
from tvm.contrib.pickle_memoize import memoize
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.topi.vision import ssd, non_max_suppression, get_valid_counts
import pytest
import tvm.testing
diff --git a/tests/python/unittest/test_auto_scheduler_common.py b/tests/python/unittest/test_auto_scheduler_common.py
index 764099e..6a3fe4e 100644
--- a/tests/python/unittest/test_auto_scheduler_common.py
+++ b/tests/python/unittest/test_auto_scheduler_common.py
@@ -23,7 +23,7 @@ import tvm
from tvm import te, auto_scheduler
from tvm import topi
from tvm.topi.nn.winograd_util import winograd_transform_matrices
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
@auto_scheduler.register_workload
diff --git a/tests/python/unittest/test_autotvm_record.py b/tests/python/unittest/test_autotvm_record.py
index c9d2c49..51cc907 100644
--- a/tests/python/unittest/test_autotvm_record.py
+++ b/tests/python/unittest/test_autotvm_record.py
@@ -19,7 +19,7 @@ import time
import tvm
from tvm import te
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm import autotvm
from tvm.autotvm.measure import MeasureInput, MeasureResult, MeasureErrorNo
@@ -50,7 +50,7 @@ def test_load_dump():
def test_file_io():
- temp = util.tempdir()
+ temp = utils.tempdir()
file_path = temp.relpath("temp.log")
tsk, target = get_sample_task()
diff --git a/tests/python/unittest/test_crt.py b/tests/python/unittest/test_crt.py
index 04018da..3b5471d 100644
--- a/tests/python/unittest/test_crt.py
+++ b/tests/python/unittest/test_crt.py
@@ -29,7 +29,7 @@ import numpy as np
import tvm
import tvm.relay
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
from tvm.topi.testing import conv2d_nchw_python
BUILD = True
diff --git a/tests/python/unittest/test_format_si_prefix.py b/tests/python/unittest/test_format_si_prefix.py
index b655654..4df5c2b 100644
--- a/tests/python/unittest/test_format_si_prefix.py
+++ b/tests/python/unittest/test_format_si_prefix.py
@@ -17,7 +17,7 @@
from numpy import isclose
import random
-from tvm.autotvm import util
+from tvm.autotvm import utils
SI_PREFIXES = "yzafpn\xb5m kMGTPEZY"
@@ -25,16 +25,16 @@ SI_PREFIXES = "yzafpn\xb5m kMGTPEZY"
def test_format_si_prefix():
# test float conversion
- assert util.format_si_prefix(1024, "k") == 1.024
+ assert utils.format_si_prefix(1024, "k") == 1.024
for i, prefix in enumerate(SI_PREFIXES):
integer, decimal = random.randint(0, 1000), random.randint(0, 1000)
exp = -24 + 3 * i # 0th prefix (yocto) is 10^-24
number = integer * (10 ** exp) + decimal * (10 ** (exp - 3))
expected = integer + decimal / 1000
- assert isclose(util.format_si_prefix(number, prefix), expected)
+ assert isclose(utils.format_si_prefix(number, prefix), expected)
- assert util.format_si_prefix(0, "y") == 0
+ assert utils.format_si_prefix(0, "y") == 0
if __name__ == "__main__":
diff --git a/tests/python/unittest/test_micro_artifact.py b/tests/python/unittest/test_micro_artifact.py
index 80d34db..d757f09 100644
--- a/tests/python/unittest/test_micro_artifact.py
+++ b/tests/python/unittest/test_micro_artifact.py
@@ -22,7 +22,7 @@ import os
import shutil
import tvm
-from tvm.contrib import util
+from tvm.contrib import utils
FILE_LIST = ["label1", "label2", "label12", "unlabelled"]
@@ -58,7 +58,7 @@ def build_artifact(artifact_path, immobile=False):
@tvm.testing.requires_micro
def test_basic_functionality():
- temp_dir = util.tempdir()
+ temp_dir = utils.tempdir()
artifact_path = temp_dir.relpath("foo")
art = build_artifact(artifact_path)
@@ -73,7 +73,7 @@ def test_basic_functionality():
def test_archive():
from tvm.micro import artifact
- temp_dir = util.tempdir()
+ temp_dir = utils.tempdir()
art = build_artifact(temp_dir.relpath("foo"))
# Create archive
@@ -110,7 +110,7 @@ def test_archive():
def test_metadata_only():
from tvm.micro import artifact
- temp_dir = util.tempdir()
+ temp_dir = utils.tempdir()
base_dir = temp_dir.relpath("foo")
art = build_artifact(base_dir)
diff --git a/tests/python/unittest/test_runtime_graph.py b/tests/python/unittest/test_runtime_graph.py
index 5968f0b..c43a359 100644
--- a/tests/python/unittest/test_runtime_graph.py
+++ b/tests/python/unittest/test_runtime_graph.py
@@ -20,7 +20,7 @@ from tvm import te
import numpy as np
import json
from tvm import rpc
-from tvm.contrib import util, graph_runtime
+from tvm.contrib import utils, graph_runtime
@tvm.testing.requires_llvm
@@ -68,7 +68,7 @@ def test_graph_simple():
mlib = tvm.build(s, [A, B], "llvm", name="myadd")
server = rpc.Server("localhost")
remote = rpc.connect(server.host, server.port)
- temp = util.tempdir()
+ temp = utils.tempdir()
ctx = remote.cpu(0)
path_dso = temp.relpath("dev_lib.so")
mlib.export_library(path_dso)
diff --git a/tests/python/unittest/test_runtime_graph_debug.py b/tests/python/unittest/test_runtime_graph_debug.py
index 25dadbd..8aeaf1a 100644
--- a/tests/python/unittest/test_runtime_graph_debug.py
+++ b/tests/python/unittest/test_runtime_graph_debug.py
@@ -21,7 +21,7 @@ import tvm.testing
from tvm import te
import numpy as np
from tvm import rpc
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.contrib.debugger import debug_runtime as graph_runtime
@@ -120,7 +120,7 @@ def test_graph_simple():
mlib = tvm.build(s, [A, B], "llvm", name="myadd")
server = rpc.Server("localhost")
remote = rpc.connect(server.host, server.port)
- temp = util.tempdir()
+ temp = utils.tempdir()
ctx = remote.cpu(0)
path_dso = temp.relpath("dev_lib.so")
mlib.export_library(path_dso)
diff --git a/tests/python/unittest/test_runtime_heterogeneous.py b/tests/python/unittest/test_runtime_heterogeneous.py
index 80b330c..161f944 100644
--- a/tests/python/unittest/test_runtime_heterogeneous.py
+++ b/tests/python/unittest/test_runtime_heterogeneous.py
@@ -21,7 +21,7 @@ import numpy as np
import tvm
from tvm import te
-from tvm.contrib import graph_runtime, util
+from tvm.contrib import graph_runtime, utils
from tvm import topi
@@ -415,7 +415,7 @@ def test_duplex_data_transferring():
np.testing.assert_equal(out.asnumpy(), tensor_a + tensor_b - tensor_c + tensor_d)
def check_load_module():
- temp = util.tempdir()
+ temp = utils.tempdir()
path_lib = temp.relpath("deploy.so")
mhost.export_library(path_lib)
with open(temp.relpath("deploy.json"), "w") as out_file:
diff --git a/tests/python/unittest/test_runtime_measure.py b/tests/python/unittest/test_runtime_measure.py
index 77f32a0..0d02f91 100644
--- a/tests/python/unittest/test_runtime_measure.py
+++ b/tests/python/unittest/test_runtime_measure.py
@@ -19,7 +19,7 @@ import ctypes
import tvm
from tvm import te
-from tvm.contrib.util import tempdir
+from tvm.contrib.utils import tempdir
def test_min_repeat_ms():
diff --git a/tests/python/unittest/test_runtime_module_based_interface.py b/tests/python/unittest/test_runtime_module_based_interface.py
index 1d682d2..56ebb29 100644
--- a/tests/python/unittest/test_runtime_module_based_interface.py
+++ b/tests/python/unittest/test_runtime_module_based_interface.py
@@ -126,9 +126,9 @@ def test_mod_export():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "llvm", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -165,9 +165,9 @@ def test_mod_export():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "cuda", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -204,9 +204,9 @@ def test_mod_export():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "llvm", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -248,9 +248,9 @@ def test_mod_export():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "cuda", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -302,9 +302,9 @@ def test_remove_package_params():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "llvm", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -349,9 +349,9 @@ def test_remove_package_params():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "cuda", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -396,9 +396,9 @@ def test_remove_package_params():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "llvm", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -449,9 +449,9 @@ def test_remove_package_params():
with relay.build_config(opt_level=3):
complied_graph_lib = relay.build_module.build(mod, "cuda", params=params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
diff --git a/tests/python/unittest/test_runtime_module_export.py b/tests/python/unittest/test_runtime_module_export.py
index fcdd906..88b7af9 100644
--- a/tests/python/unittest/test_runtime_module_export.py
+++ b/tests/python/unittest/test_runtime_module_export.py
@@ -21,9 +21,9 @@ from tvm import te
import tvm.testing
-from tvm.contrib import util
+from tvm.contrib import utils
-header_file_dir_path = util.tempdir()
+header_file_dir_path = utils.tempdir()
def gen_engine_header():
@@ -80,9 +80,9 @@ def test_mod_export():
synthetic_llvm_mod, "llvm", params=synthetic_llvm_params
)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -112,9 +112,9 @@ def test_mod_export():
B = te.compute(A.shape, lambda *i: A(*i) + 1.0, name="B")
s = te.create_schedule(B.op)
f = tvm.build(s, [A, B], "llvm", name="myadd")
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
if obj_format == ".so":
file_name = "deploy_lib.so"
else:
@@ -153,9 +153,9 @@ def test_mod_export():
+ "mul 6 inputs: 5 3 shape: 10 10"
)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
subgraph_path = temp.relpath("subgraph.examplejson")
with open(subgraph_path, "w") as f:
f.write(subgraph_json)
@@ -204,9 +204,9 @@ def test_mod_export():
s = te.create_schedule(B.op)
f = tvm.build(s, [A, B], "c", name="myadd")
engine_module = generate_engine_module()
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
file_name = "deploy_lib.so"
path_lib = temp.relpath(file_name)
synthetic_cpu_lib.import_module(f)
diff --git a/tests/python/unittest/test_runtime_module_load.py b/tests/python/unittest/test_runtime_module_load.py
index 81aa2ba..7befed3 100644
--- a/tests/python/unittest/test_runtime_module_load.py
+++ b/tests/python/unittest/test_runtime_module_load.py
@@ -16,7 +16,7 @@
# under the License.
import tvm
from tvm import te
-from tvm.contrib import cc, util
+from tvm.contrib import cc, utils
import ctypes
import os
import sys
@@ -47,7 +47,7 @@ def test_dso_module_load():
if not tvm.testing.device_enabled("llvm"):
return
dtype = "int64"
- temp = util.tempdir()
+ temp = utils.tempdir()
def save_object(names):
n = te.size_var("n")
@@ -105,7 +105,7 @@ def test_device_module_dump():
if not tvm.testing.device_enabled(device):
print("Skip because %s is not enabled" % device)
return
- temp = util.tempdir()
+ temp = utils.tempdir()
name = "myadd_%s" % device
if sys.platform == "darwin" or sys.platform.startswith("linux"):
f = tvm.build(s, [A, B], device, "llvm -system-lib", name=name)
@@ -133,7 +133,7 @@ def test_device_module_dump():
if not tvm.testing.device_enabled(device):
print("Skip because %s is not enabled" % device)
return
- temp = util.tempdir()
+ temp = utils.tempdir()
name = "myadd_%s" % device
f = tvm.build(s, [A, B], device, "stackvm", name=name)
path_dso = temp.relpath("dev_lib.stackvm")
@@ -163,7 +163,7 @@ def test_combine_module_llvm():
if not tvm.testing.device_enabled("llvm"):
print("Skip because llvm is not enabled")
return
- temp = util.tempdir()
+ temp = utils.tempdir()
fadd1 = tvm.build(s, [A, B], "llvm", name="myadd1")
fadd2 = tvm.build(s, [A, B], "llvm", name="myadd2")
path1 = temp.relpath("myadd1.o")
@@ -188,7 +188,7 @@ def test_combine_module_llvm():
if not tvm.testing.device_enabled("llvm"):
print("Skip because llvm is not enabled")
return
- temp = util.tempdir()
+ temp = utils.tempdir()
fadd1 = tvm.build(s, [A, B], "llvm -system-lib", name="myadd1")
fadd2 = tvm.build(s, [A, B], "llvm -system-lib", name="myadd2")
path1 = temp.relpath("myadd1.o")
diff --git a/tests/python/unittest/test_runtime_rpc.py b/tests/python/unittest/test_runtime_rpc.py
index d25eff2..e0fe8b5 100644
--- a/tests/python/unittest/test_runtime_rpc.py
+++ b/tests/python/unittest/test_runtime_rpc.py
@@ -26,7 +26,7 @@ import multiprocessing
import pytest
import numpy as np
from tvm import rpc
-from tvm.contrib import util, cc
+from tvm.contrib import utils, cc
from tvm.rpc.tracker import Tracker
@@ -46,7 +46,7 @@ def test_bigendian_rpc():
ctx = remote.cpu(0)
a = tvm.nd.array(np.random.randint(0, 256, size=shape).astype(A.dtype), ctx=ctx)
b = tvm.nd.array(np.zeros(shape).astype(A.dtype), ctx=ctx)
- temp = util.tempdir()
+ temp = utils.tempdir()
path_dso = temp.relpath("dev_lib.o")
f.save(path_dso)
remote.upload(path_dso)
@@ -164,7 +164,7 @@ def test_rpc_echo():
if tvm.get_global_func("rpc.CreatePipeClient", allow_missing=True) is None:
return
# Test minrpc server.
- temp = util.tempdir()
+ temp = utils.tempdir()
minrpc_exec = temp.relpath("minrpc")
tvm.rpc.with_minrpc(cc.create_executable)(minrpc_exec, [])
check(rpc.PopenSession(minrpc_exec))
@@ -212,7 +212,7 @@ def test_rpc_remote_module():
)
def check_remote(remote):
- temp = util.tempdir()
+ temp = utils.tempdir()
ctx = remote.cpu(0)
f = tvm.build(s, [A, B], "llvm", name="myadd")
path_dso = temp.relpath("dev_lib.so")
@@ -243,7 +243,7 @@ def test_rpc_remote_module():
if tvm.get_global_func("rpc.CreatePipeClient", allow_missing=True) is None:
return
# export to minrpc
- temp = util.tempdir()
+ temp = utils.tempdir()
f = tvm.build(s, [A, B], "llvm --system-lib", name="myadd")
path_minrpc = temp.relpath("dev_lib.minrpc")
f.export_library(path_minrpc, rpc.with_minrpc(cc.create_executable))
@@ -278,7 +278,7 @@ def test_rpc_remote_module():
if not tvm.testing.device_enabled("opencl"):
print("Skip because opencl is not enabled")
return
- temp = util.tempdir()
+ temp = utils.tempdir()
ctx = remote.cl(0)
s = te.create_schedule(B.op)
xo, xi = s[B].split(B.op.axis[0], factor=32)
diff --git a/tests/python/unittest/test_target_codegen_blob.py b/tests/python/unittest/test_target_codegen_blob.py
index 8189d13..dc42381 100644
--- a/tests/python/unittest/test_target_codegen_blob.py
+++ b/tests/python/unittest/test_target_codegen_blob.py
@@ -49,9 +49,9 @@ def test_synthetic():
with tvm.transform.PassContext(opt_level=3):
synthetic_gpu_lib = relay.build_module.build(synthetic_mod, "cuda", params=synthetic_params)
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
path_lib = temp.relpath("deploy_lib.so")
synthetic_gpu_lib.export_library(path_lib)
@@ -82,9 +82,9 @@ def test_cuda_lib():
s[B].bind(bx, te.thread_axis("blockIdx.x"))
s[B].bind(tx, te.thread_axis("threadIdx.x"))
- from tvm.contrib import util
+ from tvm.contrib import utils
- temp = util.tempdir()
+ temp = utils.tempdir()
fn_add = tvm.build(s, [A, B], target="cuda", target_host="llvm", name="add")
path_lib = temp.relpath("deploy_lib.so")
fn_add.export_library(path_lib)
diff --git a/tests/python/unittest/test_target_codegen_c_host.py b/tests/python/unittest/test_target_codegen_c_host.py
index a2ed634..3178d6d 100644
--- a/tests/python/unittest/test_target_codegen_c_host.py
+++ b/tests/python/unittest/test_target_codegen_c_host.py
@@ -18,7 +18,7 @@ import tvm
import tvm.testing
from tvm import te
import numpy as np
-from tvm.contrib import util
+from tvm.contrib import utils
def test_add():
@@ -31,7 +31,7 @@ def test_add():
def check_c():
mhost = tvm.build(s, [A, B, C], "c", name="fadd")
- temp = util.tempdir()
+ temp = utils.tempdir()
path_dso = temp.relpath("temp.so")
mhost.export_library(path_dso)
m = tvm.runtime.load_module(path_dso)
@@ -76,7 +76,7 @@ def test_add_pipeline():
f1 = tvm.lower(s, [A, B, C], name="fadd_pipeline")
mhost = tvm.build(f1, target="c")
- temp = util.tempdir()
+ temp = utils.tempdir()
path_dso = temp.relpath("temp.so")
mhost.export_library(path_dso)
m = tvm.runtime.load_module(path_dso)
@@ -104,7 +104,7 @@ def test_reinterpret():
def check_c():
mhost = tvm.build(s, [A, B], "c", name="reinterpret")
- temp = util.tempdir()
+ temp = utils.tempdir()
path_dso = temp.relpath("temp.so")
mhost.export_library(path_dso)
m = tvm.runtime.load_module(path_dso)
diff --git a/tests/python/unittest/test_target_codegen_cross_llvm.py b/tests/python/unittest/test_target_codegen_cross_llvm.py
index c0ab651..a55530a 100644
--- a/tests/python/unittest/test_target_codegen_cross_llvm.py
+++ b/tests/python/unittest/test_target_codegen_cross_llvm.py
@@ -21,7 +21,7 @@ from tvm import te
import os
import struct
from tvm import rpc
-from tvm.contrib import util, cc
+from tvm.contrib import utils, cc
import numpy as np
@@ -46,7 +46,7 @@ def test_llvm_add_pipeline():
assert struct.unpack(endian + "h", arr[0x12:0x14])[0] == e_machine
def build_i386():
- temp = util.tempdir()
+ temp = utils.tempdir()
target = "llvm -mtriple=i386-pc-linux-gnu"
f = tvm.build(s, [A, B, C], target)
path = temp.relpath("myadd.o")
@@ -58,7 +58,7 @@ def test_llvm_add_pipeline():
if not tvm.runtime.enabled(target):
print("Skip because %s is not enabled.." % target)
return
- temp = util.tempdir()
+ temp = utils.tempdir()
f = tvm.build(s, [A, B, C], target)
path = temp.relpath("myadd.o")
f.save(path)
diff --git a/tests/python/unittest/test_target_codegen_device.py b/tests/python/unittest/test_target_codegen_device.py
index 3cdcb2d..3b764c6 100644
--- a/tests/python/unittest/test_target_codegen_device.py
+++ b/tests/python/unittest/test_target_codegen_device.py
@@ -16,7 +16,7 @@
# under the License.
import tvm
from tvm import te
-from tvm.contrib import util
+from tvm.contrib import utils
import numpy as np
import tvm.testing
diff --git a/tests/python/unittest/test_target_codegen_llvm.py b/tests/python/unittest/test_target_codegen_llvm.py
index 19773e5..3599493 100644
--- a/tests/python/unittest/test_target_codegen_llvm.py
+++ b/tests/python/unittest/test_target_codegen_llvm.py
@@ -18,7 +18,7 @@ import tvm
import tvm.testing
from tvm import te
from tvm import topi
-from tvm.contrib import util, clang
+from tvm.contrib import utils, clang
import numpy as np
import ctypes
import math
@@ -594,7 +594,7 @@ def test_dwarf_debug_information():
f2 = tvm.lower(s, [A, B, C], name="fadd1")
f1 = tvm.lower(s, [A, B, C], name="fadd2")
m = tvm.build([f1, f2], "llvm")
- temp = util.tempdir()
+ temp = utils.tempdir()
o_path = temp.relpath("temp.o")
m.save(o_path)
import shutil
diff --git a/tests/python/unittest/test_te_autodiff.py b/tests/python/unittest/test_te_autodiff.py
index 7b591dc..6031182 100644
--- a/tests/python/unittest/test_te_autodiff.py
+++ b/tests/python/unittest/test_te_autodiff.py
@@ -19,7 +19,7 @@ import tvm
from tvm import te
from tvm.testing import assert_allclose
from tvm import topi
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import pytest
import numpy as np
diff --git a/tests/python/unittest/test_te_hybrid_script.py b/tests/python/unittest/test_te_hybrid_script.py
index 3afdb66..06d4099 100644
--- a/tests/python/unittest/test_te_hybrid_script.py
+++ b/tests/python/unittest/test_te_hybrid_script.py
@@ -17,7 +17,7 @@
import tvm, inspect, sys, traceback, numpy, pytest, types, os
from tvm import te
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.te.hybrid import script
from tvm.te.hybrid.runtime import HYBRID_GLOBALS
@@ -147,7 +147,7 @@ def test_outer_product():
assert mul.b.producer.name == "b"
func, ins, outs = run_and_check(outer_product, [n, m, a, b], {n: 99, m: 101})
- temp = util.tempdir()
+ temp = utils.tempdir()
path = temp.relpath("%s.py" % func.name)
func.save(path)
func_ = te.hybrid.HybridModule()
diff --git a/tests/python/unittest/test_te_tensor_overload.py b/tests/python/unittest/test_te_tensor_overload.py
index a8339154..3126d84 100644
--- a/tests/python/unittest/test_te_tensor_overload.py
+++ b/tests/python/unittest/test_te_tensor_overload.py
@@ -19,7 +19,7 @@ import tvm
from tvm import te
from tvm import topi
import tvm.topi.testing
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
import tvm.testing
diff --git a/tests/python/unittest/test_tir_data_layout.py b/tests/python/unittest/test_tir_data_layout.py
index 22c24fa..5c2eb8f 100644
--- a/tests/python/unittest/test_tir_data_layout.py
+++ b/tests/python/unittest/test_tir_data_layout.py
@@ -18,7 +18,7 @@
import tvm
from tvm import te
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
def test_layout():
diff --git a/tests/python/unittest/test_tir_intrin.py b/tests/python/unittest/test_tir_intrin.py
index 3d54175..76390da 100644
--- a/tests/python/unittest/test_tir_intrin.py
+++ b/tests/python/unittest/test_tir_intrin.py
@@ -18,7 +18,7 @@ import tvm
import tvm.testing
from tvm import te
from tvm import topi
-from tvm.contrib import util, clang
+from tvm.contrib import utils, clang
import numpy as np
import ctypes
import math
diff --git a/tests/scripts/task_golang.sh b/tests/scripts/task_golang.sh
index 7a93b47..5b01eec 100755
--- a/tests/scripts/task_golang.sh
+++ b/tests/scripts/task_golang.sh
@@ -28,5 +28,7 @@ export PYTHONPATH="$tvm_root/python"
export TVM_BIND_THREADS=0
export OMP_NUM_THREADS=1
+make -C golang clean
+
# Golang tests
make -C golang tests
diff --git a/tutorials/autotvm/tune_relay_arm.py b/tutorials/autotvm/tune_relay_arm.py
index 31fda54..7514ee7 100644
--- a/tutorials/autotvm/tune_relay_arm.py
+++ b/tutorials/autotvm/tune_relay_arm.py
@@ -71,7 +71,7 @@ from tvm import autotvm
from tvm import relay
import tvm.relay.testing
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
-from tvm.contrib.util import tempdir
+from tvm.contrib.utils import tempdir
import tvm.contrib.graph_runtime as runtime
#################################################################
@@ -416,4 +416,4 @@ def tune_and_evaluate(tuning_opt):
# import logging
# logging.getLogger('autotvm').setLevel(logging.DEBUG)
#
-# Finally, always feel free to ask our community for help on https://discuss.tvm.ai
+# Finally, always feel free to ask our community for help on https://discuss.tvm.apache.org
diff --git a/tutorials/autotvm/tune_relay_cuda.py b/tutorials/autotvm/tune_relay_cuda.py
index e864307..f9b8921 100644
--- a/tutorials/autotvm/tune_relay_cuda.py
+++ b/tutorials/autotvm/tune_relay_cuda.py
@@ -69,7 +69,7 @@ from tvm import autotvm
from tvm import relay
import tvm.relay.testing
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
-from tvm.contrib.util import tempdir
+from tvm.contrib.utils import tempdir
import tvm.contrib.graph_runtime as runtime
#################################################################
@@ -317,7 +317,7 @@ def tune_and_evaluate(tuning_opt):
# import logging
# logging.getLogger('autotvm').setLevel(logging.DEBUG)
#
-# Finally, always feel free to ask our community for help on https://discuss.tvm.ai
+# Finally, always feel free to ask our community for help on https://discuss.tvm.apache.org
#################################################################
diff --git a/tutorials/autotvm/tune_relay_mobile_gpu.py b/tutorials/autotvm/tune_relay_mobile_gpu.py
index 9a112e1..b7fbf89 100644
--- a/tutorials/autotvm/tune_relay_mobile_gpu.py
+++ b/tutorials/autotvm/tune_relay_mobile_gpu.py
@@ -70,7 +70,7 @@ from tvm import autotvm
from tvm import relay
import tvm.relay.testing
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
-from tvm.contrib.util import tempdir
+from tvm.contrib.utils import tempdir
import tvm.contrib.graph_runtime as runtime
#################################################################
@@ -421,4 +421,4 @@ def tune_and_evaluate(tuning_opt):
# import logging
# logging.getLogger('autotvm').setLevel(logging.DEBUG)
#
-# Finally, always feel free to ask our community for help on https://discuss.tvm.ai
+# Finally, always feel free to ask our community for help on https://discuss.tvm.apache.org
diff --git a/tutorials/frontend/deploy_model_on_android.py b/tutorials/frontend/deploy_model_on_android.py
index 851810a..35f989c 100644
--- a/tutorials/frontend/deploy_model_on_android.py
+++ b/tutorials/frontend/deploy_model_on_android.py
@@ -34,7 +34,7 @@ import tvm
from tvm import te
import tvm.relay as relay
from tvm import rpc
-from tvm.contrib import util, ndk, graph_runtime as runtime
+from tvm.contrib import utils, ndk, graph_runtime as runtime
from tvm.contrib.download import download_testdata
@@ -282,7 +282,7 @@ with tvm.transform.PassContext(opt_level=3):
# change the parameters but keep the result of model as the same.
# Save the library at local temporary directory.
-tmp = util.tempdir()
+tmp = utils.tempdir()
lib_fname = tmp.relpath("net.so")
fcompile = ndk.create_shared if not local_demo else None
lib.export_library(lib_fname, fcompile)
diff --git a/tutorials/frontend/deploy_model_on_rasp.py b/tutorials/frontend/deploy_model_on_rasp.py
index 8b49a21..3687991 100644
--- a/tutorials/frontend/deploy_model_on_rasp.py
+++ b/tutorials/frontend/deploy_model_on_rasp.py
@@ -30,7 +30,7 @@ import tvm
from tvm import te
import tvm.relay as relay
from tvm import rpc
-from tvm.contrib import util, graph_runtime as runtime
+from tvm.contrib import utils, graph_runtime as runtime
from tvm.contrib.download import download_testdata
######################################################################
@@ -193,7 +193,7 @@ with tvm.transform.PassContext(opt_level=3):
# change the parameters but keep the result of model as the same.
# Save the library at local temporary directory.
-tmp = util.tempdir()
+tmp = utils.tempdir()
lib_fname = tmp.relpath("net.tar")
lib.export_library(lib_fname)
diff --git a/tutorials/frontend/deploy_prequantized.py b/tutorials/frontend/deploy_prequantized.py
index e9f1a4c..beba332 100644
--- a/tutorials/frontend/deploy_prequantized.py
+++ b/tutorials/frontend/deploy_prequantized.py
@@ -22,7 +22,7 @@ Deploy a Framework-prequantized Model with TVM
This is a tutorial on loading models quantized by deep learning frameworks into TVM.
Pre-quantized model import is one of the quantization support we have in TVM. More details on
the quantization story in TVM can be found
-`here <https://discuss.tvm.ai/t/quantization-story/3920>`_.
+`here <https://discuss.tvm.apache.org/t/quantization-story/3920>`_.
Here, we demonstrate how to load and run models quantized by PyTorch, MXNet, and TFLite.
Once loaded, we can run compiled, quantized models on any hardware TVM supports.
diff --git a/tutorials/frontend/deploy_quantized.py b/tutorials/frontend/deploy_quantized.py
index 093bd73..e75f6e9 100644
--- a/tutorials/frontend/deploy_quantized.py
+++ b/tutorials/frontend/deploy_quantized.py
@@ -22,7 +22,7 @@ Deploy a Quantized Model on Cuda
This article is an introductory tutorial of automatic quantization with TVM.
Automatic quantization is one of the quantization modes in TVM. More details on
the quantization story in TVM can be found
-`here <https://discuss.tvm.ai/t/quantization-story/3920>`_.
+`here <https://discuss.tvm.apache.org/t/quantization-story/3920>`_.
In this tutorial, we will import a GluonCV pre-trained model on ImageNet to
Relay, quantize the Relay model and then perform the inference.
"""
diff --git a/tutorials/frontend/from_onnx.py b/tutorials/frontend/from_onnx.py
index 141defe..1557ea5 100644
--- a/tutorials/frontend/from_onnx.py
+++ b/tutorials/frontend/from_onnx.py
@@ -111,4 +111,4 @@ plt.show()
# retains that dynamism upon import, and the compiler attemps to convert the model
# into a static shapes at compile time. If this fails, there may still be dynamic
# operations in the model. Not all TVM kernels currently support dynamic shapes,
-# please file an issue on discuss.tvm.ai if you hit an error with dynamic kernels.
+# please file an issue on discuss.tvm.apache.org if you hit an error with dynamic kernels.
diff --git a/tutorials/get_started/cross_compilation_and_rpc.py b/tutorials/get_started/cross_compilation_and_rpc.py
index 572ebb8..69284c0 100644
--- a/tutorials/get_started/cross_compilation_and_rpc.py
+++ b/tutorials/get_started/cross_compilation_and_rpc.py
@@ -98,7 +98,7 @@ import numpy as np
import tvm
from tvm import te
from tvm import rpc
-from tvm.contrib import util
+from tvm.contrib import utils
n = tvm.runtime.convert(1024)
A = te.placeholder((n,), name="A")
@@ -120,7 +120,7 @@ else:
func = tvm.build(s, [A, B], target=target, name="add_one")
# save the lib at a local temp folder
-temp = util.tempdir()
+temp = utils.tempdir()
path = temp.relpath("lib.tar")
func.export_library(path)
diff --git a/tutorials/get_started/relay_quick_start.py b/tutorials/get_started/relay_quick_start.py
index cece7ab..6da62f5 100644
--- a/tutorials/get_started/relay_quick_start.py
+++ b/tutorials/get_started/relay_quick_start.py
@@ -129,9 +129,9 @@ print(out.flatten()[0:10])
####################################################
# save the graph, lib and params into separate files
-from tvm.contrib import util
+from tvm.contrib import utils
-temp = util.tempdir()
+temp = utils.tempdir()
path_lib = temp.relpath("deploy_lib.tar")
lib.export_library(path_lib)
print(temp.listdir())
diff --git a/tutorials/get_started/tensor_expr_get_started.py b/tutorials/get_started/tensor_expr_get_started.py
index 0ca2243..7f1bb6a 100644
--- a/tutorials/get_started/tensor_expr_get_started.py
+++ b/tutorials/get_started/tensor_expr_get_started.py
@@ -210,9 +210,9 @@ else:
# - cc.create_shared calls a compiler (gcc) to create a shared library
#
from tvm.contrib import cc
-from tvm.contrib import util
+from tvm.contrib import utils
-temp = util.tempdir()
+temp = utils.tempdir()
fadd.save(temp.relpath("myadd.o"))
if tgt == "cuda":
fadd.imported_modules[0].save(temp.relpath("myadd.ptx"))
diff --git a/tutorials/language/tensorize.py b/tutorials/language/tensorize.py
index 601adb8..e91cfe4 100644
--- a/tutorials/language/tensorize.py
+++ b/tutorials/language/tensorize.py
@@ -160,9 +160,9 @@ def gemv_impl():
return 0;
}
"""
- from tvm.contrib import util, clang
+ from tvm.contrib import utils, clang
- temp = util.tempdir()
+ temp = utils.tempdir()
ll_path = temp.relpath("temp.ll")
# Create LLVM ir from c source code
ll_code = clang.create_llvm(cc_code, output=ll_path)
@@ -182,7 +182,7 @@ print(tvm.lower(s, [A, B, C], simple_mode=True))
#
func = tvm.build(s, [A, B, C], target="llvm", name="gemv")
-from tvm.topi.util import get_const_tuple
+from tvm.topi.utils import get_const_tuple
dtype = A.dtype
ctx = tvm.context("cpu", 0)
@@ -228,9 +228,9 @@ def gemv_impl():
return 0;
}
"""
- from tvm.contrib import util, clang
+ from tvm.contrib import utils, clang
- temp = util.tempdir()
+ temp = utils.tempdir()
ll_path = temp.relpath("temp.ll")
# Create LLVM ir from c source code
ll_code = clang.create_llvm(cc_code, output=ll_path)
diff --git a/tutorials/micro/micro_tflite.py b/tutorials/micro/micro_tflite.py
index 6fd2de1..293f95c 100644
--- a/tutorials/micro/micro_tflite.py
+++ b/tutorials/micro/micro_tflite.py
@@ -98,7 +98,7 @@ import numpy as np
import tvm
import tvm.micro as micro
from tvm.contrib.download import download_testdata
-from tvm.contrib import graph_runtime, util
+from tvm.contrib import graph_runtime, utils
from tvm import relay
# %%
diff --git a/version.py b/version.py
index 461b81a..f3af420 100644
--- a/version.py
+++ b/version.py
@@ -85,7 +85,7 @@ def git_describe_version():
msg = py_str(out)
if msg.find("not a git repository") != -1:
return __version__, __version__
- logging.warning("git describe error: %", msg)
+ logging.warning("git describe: %s, use %s", msg, __version__)
return __version__, __version__
describe = py_str(out).strip()
arr_info = describe.split("-")
diff --git a/vta/python/vta/__init__.py b/vta/python/vta/__init__.py
index d39f982..d143c4d 100644
--- a/vta/python/vta/__init__.py
+++ b/vta/python/vta/__init__.py
@@ -20,8 +20,6 @@
Besides the compiler toolchain, it also includes utility functions to
configure the hardware environment and access remote device through RPC.
"""
-from __future__ import absolute_import as _abs
-
import sys
from .bitstream import get_bitstream_path, download_bitstream
diff --git a/vta/python/vta/testing/__init__.py b/vta/python/vta/testing/__init__.py
index fbc50b0..8d294c2 100644
--- a/vta/python/vta/testing/__init__.py
+++ b/vta/python/vta/testing/__init__.py
@@ -17,4 +17,4 @@
"""Testing utilities, this namespace is not imported by default."""
-from .util import run
+from .utils import run
diff --git a/vta/python/vta/testing/util.py b/vta/python/vta/testing/utils.py
similarity index 100%
rename from vta/python/vta/testing/util.py
rename to vta/python/vta/testing/utils.py
diff --git a/vta/python/vta/top/__init__.py b/vta/python/vta/top/__init__.py
index 6f62aff..b9ebe55 100644
--- a/vta/python/vta/top/__init__.py
+++ b/vta/python/vta/top/__init__.py
@@ -24,4 +24,4 @@ from .vta_conv2d import conv2d_packed, schedule_conv2d_packed
from .vta_conv2d_transpose import conv2d_transpose_packed, schedule_conv2d_transpose_packed
from .vta_group_conv2d import group_conv2d_packed, schedule_group_conv2d_packed
from .vta_dense import dense_packed, schedule_dense_packed
-from . import util
+from . import utils
diff --git a/vta/python/vta/top/bitpack.py b/vta/python/vta/top/bitpack.py
index 52bd13d..50b3729 100644
--- a/vta/python/vta/top/bitpack.py
+++ b/vta/python/vta/top/bitpack.py
@@ -21,7 +21,7 @@ from __future__ import absolute_import as _abs
import tvm
from tvm import te
-from tvm.topi import util
+from tvm.topi import utils
from tvm.relay.op.op import register_compute, register_injective_schedule
from tvm.relay.op.op import register_pattern, OpPattern
@@ -55,7 +55,7 @@ def bitpack(data, bits, pack_type="int8", name="bitpack"):
lanes = data_width // bits
# Data must be in multiples of the data_width
- assert util.get_const_int(shape_vec[-1]) % lanes == 0, "Not a multiple of word size"
+ assert utils.get_const_int(shape_vec[-1]) % lanes == 0, "Not a multiple of word size"
shape_vec[-1] = shape_vec[-1] // lanes
oshape = tuple(shape_vec)
diff --git a/vta/python/vta/top/op.py b/vta/python/vta/top/op.py
index 2710557..f3b808a 100644
--- a/vta/python/vta/top/op.py
+++ b/vta/python/vta/top/op.py
@@ -26,7 +26,7 @@ from tvm.relay.op import op as reg
from tvm.relay.op import strategy as _strategy
from tvm.relay.op.op import OpPattern, OpStrategy
-from .util import is_packed_layout
+from .utils import is_packed_layout
from .vta_conv2d import conv2d_packed, schedule_conv2d_packed
from .vta_conv2d_transpose import conv2d_transpose_packed, schedule_conv2d_transpose_packed
from .vta_group_conv2d import group_conv2d_packed, schedule_group_conv2d_packed
@@ -69,7 +69,7 @@ def conv2d_strategy_vta(attrs, inputs, out_type, target):
"""conv2d vta strategy"""
strategy = OpStrategy()
kernel = inputs[1]
- dilation = topi.util.get_const_tuple(attrs.dilation)
+ dilation = topi.utils.get_const_tuple(attrs.dilation)
groups = attrs.groups
layout = attrs.data_layout
@@ -102,7 +102,7 @@ def conv2d_strategy_vta(attrs, inputs, out_type, target):
@_strategy.conv2d_transpose_strategy.register("vta")
def conv2d_transpose_strategy_vta(attrs, inputs, out_type, target):
"""conv2d_transpose vta strategy"""
- dilation = topi.util.get_const_tuple(attrs.dilation)
+ dilation = topi.utils.get_const_tuple(attrs.dilation)
layout = attrs.data_layout
assert dilation == (1, 1), "support for dilation limited to (1, 1)"
diff --git a/vta/python/vta/top/util.py b/vta/python/vta/top/utils.py
similarity index 100%
rename from vta/python/vta/top/util.py
rename to vta/python/vta/top/utils.py
diff --git a/vta/python/vta/top/vta_conv2d.py b/vta/python/vta/top/vta_conv2d.py
index e155565..0b9cb71 100644
--- a/vta/python/vta/top/vta_conv2d.py
+++ b/vta/python/vta/top/vta_conv2d.py
@@ -23,7 +23,7 @@ from tvm import te
from tvm import autotvm
from tvm import topi
-from .util import is_packed_layout
+from .utils import is_packed_layout
from ..environment import get_env
@@ -40,12 +40,12 @@ def conv2d_packed(cfg, data, kernel, strides, padding, dilation, layout, out_dty
pad_data = data
assert len(data.shape) == 6
assert len(kernel.shape) == 6
- oheight = topi.util.get_const_int((pad_data.shape[2] - kernel.shape[2]) // strides[0] + 1)
- owidth = topi.util.get_const_int((pad_data.shape[3] - kernel.shape[3]) // strides[1] + 1)
+ oheight = topi.utils.get_const_int((pad_data.shape[2] - kernel.shape[2]) // strides[0] + 1)
+ owidth = topi.utils.get_const_int((pad_data.shape[3] - kernel.shape[3]) // strides[1] + 1)
oshape = (data.shape[0], kernel.shape[0], oheight, owidth, data.shape[4], kernel.shape[4])
- ishape = topi.util.get_const_tuple(data.shape)
- kshape = topi.util.get_const_tuple(kernel.shape)
+ ishape = topi.utils.get_const_tuple(data.shape)
+ kshape = topi.utils.get_const_tuple(kernel.shape)
d_i = te.reduce_axis((0, kshape[2]), name="d_i")
d_j = te.reduce_axis((0, kshape[3]), name="d_j")
k_o = te.reduce_axis((0, ishape[1]), name="k_o")
@@ -64,7 +64,7 @@ def conv2d_packed(cfg, data, kernel, strides, padding, dilation, layout, out_dty
cfg.add_flop(
2
- * np.prod(topi.util.get_const_tuple(oshape))
+ * np.prod(topi.utils.get_const_tuple(oshape))
* kshape[2]
* kshape[3]
* ishape[1]
diff --git a/vta/python/vta/top/vta_conv2d_transpose.py b/vta/python/vta/top/vta_conv2d_transpose.py
index c020747..5a44104 100644
--- a/vta/python/vta/top/vta_conv2d_transpose.py
+++ b/vta/python/vta/top/vta_conv2d_transpose.py
@@ -22,8 +22,8 @@ import tvm
from tvm import te
from tvm import autotvm
from tvm import topi
-from tvm.topi.util import get_const_tuple
-from tvm.topi.nn.util import get_pad_tuple
+from tvm.topi.utils import get_const_tuple
+from tvm.topi.nn.utils import get_pad_tuple
from ..environment import get_env
@@ -75,7 +75,7 @@ def conv2d_transpose_packed(cfg, data, kernel, strides, padding, out_dtype, outp
cfg.add_flop(
2
- * np.prod(topi.util.get_const_tuple(oshape))
+ * np.prod(topi.utils.get_const_tuple(oshape))
* kshape[2]
* kshape[3]
* ishape[1]
diff --git a/vta/python/vta/top/vta_dense.py b/vta/python/vta/top/vta_dense.py
index 4a618f1..5e06cf9 100644
--- a/vta/python/vta/top/vta_dense.py
+++ b/vta/python/vta/top/vta_dense.py
@@ -44,8 +44,8 @@ def dense_packed(cfg, data, weight, bias=None, out_dtype=None):
raise topi.InvalidShapeError()
# Derive shapes
- ishape = topi.util.get_const_tuple(data.shape)
- wshape = topi.util.get_const_tuple(weight.shape)
+ ishape = topi.utils.get_const_tuple(data.shape)
+ wshape = topi.utils.get_const_tuple(weight.shape)
oshape = (data.shape[0], weight.shape[0], data.shape[2], weight.shape[2])
# Reduction axes (input channel)
@@ -64,7 +64,7 @@ def dense_packed(cfg, data, weight, bias=None, out_dtype=None):
tag="dense_pack",
)
- cfg.add_flop(2 * np.prod(topi.util.get_const_tuple(oshape)) * ishape[1] * ishape[3])
+ cfg.add_flop(2 * np.prod(topi.utils.get_const_tuple(oshape)) * ishape[1] * ishape[3])
return res
diff --git a/vta/python/vta/top/vta_group_conv2d.py b/vta/python/vta/top/vta_group_conv2d.py
index b2661b3..deb4ea7 100644
--- a/vta/python/vta/top/vta_group_conv2d.py
+++ b/vta/python/vta/top/vta_group_conv2d.py
@@ -41,12 +41,12 @@ def group_conv2d_packed(cfg, data, kernel, strides, padding, dilation, group, ou
assert kernel.dtype == "int8", kernel.dtype
assert out_dtype == "int32", out_dtype
- oheight = topi.util.get_const_int((pad_data.shape[2] - kernel.shape[2]) // strides[0] + 1)
- owidth = topi.util.get_const_int((pad_data.shape[3] - kernel.shape[3]) // strides[1] + 1)
+ oheight = topi.utils.get_const_int((pad_data.shape[2] - kernel.shape[2]) // strides[0] + 1)
+ owidth = topi.utils.get_const_int((pad_data.shape[3] - kernel.shape[3]) // strides[1] + 1)
oshape = (data.shape[0], kernel.shape[0], oheight, owidth, data.shape[4], kernel.shape[4])
- ishape = topi.util.get_const_tuple(data.shape)
- kshape = topi.util.get_const_tuple(kernel.shape)
+ ishape = topi.utils.get_const_tuple(data.shape)
+ kshape = topi.utils.get_const_tuple(kernel.shape)
assert group * kshape[1] == ishape[1]
assert kshape[0] % group == 0
d_i = te.reduce_axis((0, kshape[2]), name="d_i")
@@ -74,7 +74,7 @@ def group_conv2d_packed(cfg, data, kernel, strides, padding, dilation, group, ou
cfg.add_flop(
2
- * np.prod(topi.util.get_const_tuple(oshape))
+ * np.prod(topi.utils.get_const_tuple(oshape))
* kshape[2]
* kshape[3]
* ishape[1]
diff --git a/vta/python/vta/transform.py b/vta/python/vta/transform.py
index ed64ba3..a485d2c 100644
--- a/vta/python/vta/transform.py
+++ b/vta/python/vta/transform.py
@@ -18,7 +18,7 @@
# pylint: disable=len-as-condition, no-else-return, unused-argument, invalid-name
import tvm
from tvm import te
-from tvm.topi import util
+from tvm.topi import utils
from .environment import get_env
@@ -346,7 +346,7 @@ def InjectDMAIntrin():
ndim = len(buf.shape)
size = tvm.tir.const(1, buf.shape[0].dtype)
for i in reversed(range(ndim)):
- if not util.equal_const_int(size - buf.strides[i], 0):
+ if not utils.equal_const_int(size - buf.strides[i], 0):
raise RuntimeError(
"Cannot prove compact: shape=%s, strides=%s" % (buf.shape, buf.strides)
)
@@ -357,10 +357,10 @@ def InjectDMAIntrin():
x_size = 1
base = 0
for i in range(1, ndim + 1):
- if not util.equal_const_int(buf.strides[ndim - i] - x_size, 0):
+ if not utils.equal_const_int(buf.strides[ndim - i] - x_size, 0):
raise RuntimeError("scope %s needs to have block=%d" % (scope, elem_block))
x_size = x_size * buf.shape[ndim - i]
- if util.equal_const_int(x_size - elem_block, 0):
+ if utils.equal_const_int(x_size - elem_block, 0):
base = i + 1
break
if base == 0:
@@ -370,7 +370,7 @@ def InjectDMAIntrin():
shape = [elem_block]
strides = [1]
- if base < ndim + 1 and not util.equal_const_int(buf.strides[ndim - base], elem_block):
+ if base < ndim + 1 and not utils.equal_const_int(buf.strides[ndim - base], elem_block):
shape.append(1)
strides.append(elem_block)
@@ -379,14 +379,14 @@ def InjectDMAIntrin():
x_size = 1
x_stride = buf.strides[ndim - base]
next_base = base
- if not util.equal_const_int(idxm(x_stride, elem_block), 0):
+ if not utils.equal_const_int(idxm(x_stride, elem_block), 0):
raise RuntimeError(
"scope %s need to have block=%d, shape=%s, strides=%s"
% (scope, elem_block, buf.shape, buf.strides)
)
for i in range(base, ndim + 1):
k = ndim - i
- if not util.equal_const_int(x_size * x_stride - buf.strides[k], 0):
+ if not utils.equal_const_int(x_size * x_stride - buf.strides[k], 0):
break
x_size = x_size * buf.shape[k]
next_base = i + 1
@@ -404,7 +404,7 @@ def InjectDMAIntrin():
if buf.dtype != dtype:
raise RuntimeError("Expect buffer type to be %s instead of %s" % (dtype, buf.dtype))
shape, strides = buf.shape, buf.strides
- if not util.equal_const_int(idxm(buf.elem_offset, elem_block), 0):
+ if not utils.equal_const_int(idxm(buf.elem_offset, elem_block), 0):
raise RuntimeError("scope %s need to have block=%d" % (scope, elem_block))
if allow_fold:
shape, strides = _fold_buffer_dim(buf, scope, elem_block)
@@ -425,10 +425,10 @@ def InjectDMAIntrin():
ndim = len(shape)
# Check if the inner-tensor is already flat
- flat = util.equal_const_int(shape[-1], elem_block)
+ flat = utils.equal_const_int(shape[-1], elem_block)
if flat:
- if not util.equal_const_int(strides[-1], 1):
+ if not utils.equal_const_int(strides[-1], 1):
raise_error()
if ndim == 1:
@@ -436,7 +436,7 @@ def InjectDMAIntrin():
x_stride = 1
y_size = 1
return x_size, y_size, x_stride, idxd(buf.elem_offset, elem_block)
- if not util.equal_const_int(strides[-2] - elem_block, 0):
+ if not utils.equal_const_int(strides[-2] - elem_block, 0):
raise_error()
if ndim == 2:
@@ -444,7 +444,7 @@ def InjectDMAIntrin():
x_stride = shape[-2]
y_size = 1
return x_size, y_size, x_stride, idxd(buf.elem_offset, elem_block)
- if not util.equal_const_int(idxm(strides[-3], elem_block), 0):
+ if not utils.equal_const_int(idxm(strides[-3], elem_block), 0):
raise_error()
if ndim == 3:
@@ -454,11 +454,11 @@ def InjectDMAIntrin():
return x_size, y_size, x_stride, idxd(buf.elem_offset, elem_block)
else:
- if not util.equal_const_int(strides[-1], 1):
+ if not utils.equal_const_int(strides[-1], 1):
raise_error()
- if not util.equal_const_int(strides[-2] - shape[-1], 0):
+ if not utils.equal_const_int(strides[-2] - shape[-1], 0):
raise_error()
- if not util.equal_const_int(shape[-1] * shape[-2], elem_block):
+ if not utils.equal_const_int(shape[-1] * shape[-2], elem_block):
raise_error()
if ndim == 2:
@@ -466,7 +466,7 @@ def InjectDMAIntrin():
x_stride = 1
y_size = 1
return x_size, y_size, x_stride, idxd(buf.elem_offset, elem_block)
- if not util.equal_const_int(strides[-3], elem_block):
+ if not utils.equal_const_int(strides[-3], elem_block):
raise_error()
if ndim == 3:
@@ -474,7 +474,7 @@ def InjectDMAIntrin():
x_stride = shape[-3]
y_size = 1
return x_size, y_size, x_stride, idxd(buf.elem_offset, elem_block)
- if not util.equal_const_int(idxm(strides[-4], elem_block), 0):
+ if not utils.equal_const_int(idxm(strides[-4], elem_block), 0):
raise_error()
if ndim == 4:
@@ -556,9 +556,9 @@ def InjectDMAIntrin():
y_pad_after = pad_after[1]
x_pad_after = pad_after[2]
for dim in range(3, ndim):
- if not util.equal_const_int(pad_before[dim], 0):
+ if not utils.equal_const_int(pad_before[dim], 0):
raise ValueError("Do not support pad on the innermost block")
- if not util.equal_const_int(pad_after[dim], 0):
+ if not utils.equal_const_int(pad_after[dim], 0):
raise ValueError("Do not support pad on the innermost block")
else:
y_pad_before = pad_before[0]
@@ -566,9 +566,9 @@ def InjectDMAIntrin():
y_pad_after = pad_after[0]
x_pad_after = pad_after[1]
for dim in range(2, ndim):
- if not util.equal_const_int(pad_before[dim], 0):
+ if not utils.equal_const_int(pad_before[dim], 0):
raise ValueError("Do not support pad on the innermost block")
- if not util.equal_const_int(pad_after[dim], 0):
+ if not utils.equal_const_int(pad_after[dim], 0):
raise ValueError("Do not support pad on the innermost block")
allow_fold = False
else:
diff --git a/vta/scripts/tune_resnet.py b/vta/scripts/tune_resnet.py
index 6d64904..04f430e 100644
--- a/vta/scripts/tune_resnet.py
+++ b/vta/scripts/tune_resnet.py
@@ -28,7 +28,7 @@ from tvm import te
from tvm import rpc, autotvm, relay
from tvm.autotvm.measure.measure_methods import request_remote
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
-from tvm.contrib import graph_runtime, util, download
+from tvm.contrib import graph_runtime, utils, download
from tvm.contrib.debugger import debug_runtime
import vta
from vta.testing import simulator
@@ -318,7 +318,7 @@ if __name__ == "__main__":
)
# Export library
- temp = util.tempdir()
+ temp = utils.tempdir()
lib.save(temp.relpath("graphlib.o"))
remote.upload(temp.relpath("graphlib.o"))
lib = remote.load_module("graphlib.o")
diff --git a/vta/tests/python/integration/test_benchmark_gemm.py b/vta/tests/python/integration/test_benchmark_gemm.py
index 432d6f7..3ce2d9c 100644
--- a/vta/tests/python/integration/test_benchmark_gemm.py
+++ b/vta/tests/python/integration/test_benchmark_gemm.py
@@ -18,7 +18,7 @@ import tvm
import tvm.testing
from tvm import te
import numpy as np
-from tvm.contrib import util
+from tvm.contrib import utils
import vta.testing
from vta.testing import simulator
@@ -61,7 +61,7 @@ def test_gemm():
def verify(s, check_correctness=True):
mod = vta.build(s, [data, weight, res], "ext_dev", env.target_host, name="gemm")
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("gemm.o"))
remote.upload(temp.relpath("gemm.o"))
f = remote.load_module("gemm.o")
diff --git a/vta/tests/python/integration/test_benchmark_topi_conv2d.py b/vta/tests/python/integration/test_benchmark_topi_conv2d.py
index 004cc6b..cad560c 100644
--- a/vta/tests/python/integration/test_benchmark_topi_conv2d.py
+++ b/vta/tests/python/integration/test_benchmark_topi_conv2d.py
@@ -28,7 +28,7 @@ import tvm
from tvm import te
from tvm import relay
from tvm import autotvm
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.contrib.pickle_memoize import memoize
from tvm import topi
import tvm.topi.testing
@@ -224,13 +224,13 @@ def run_conv2d(env, remote, wl, target, check_correctness=True, print_ir=False,
mod = tvm.build(
s, [data, kernel, bias, res], target=target, target_host=env.target_host, name="conv2d"
)
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("conv2d.o"))
remote.upload(temp.relpath("conv2d.o"))
f = remote.load_module("conv2d.o")
ctx = remote.context(str(target))
- res_np = np.zeros(topi.util.get_const_tuple(res.shape)).astype(res.dtype)
+ res_np = np.zeros(topi.utils.get_const_tuple(res.shape)).astype(res.dtype)
data_arr = tvm.nd.array(data_np, ctx)
kernel_arr = tvm.nd.array(kernel_np, ctx)
bias_arr = tvm.nd.array(bias_np, ctx)
diff --git a/vta/tests/python/integration/test_benchmark_topi_conv2d_transpose.py b/vta/tests/python/integration/test_benchmark_topi_conv2d_transpose.py
index 23c4a5c..f750225 100644
--- a/vta/tests/python/integration/test_benchmark_topi_conv2d_transpose.py
+++ b/vta/tests/python/integration/test_benchmark_topi_conv2d_transpose.py
@@ -28,7 +28,7 @@ import tvm
from tvm import te
from tvm import relay
from tvm import autotvm
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.contrib.pickle_memoize import memoize
from tvm import topi
import tvm.topi.testing
@@ -220,13 +220,13 @@ def run_conv2d_transpose(
target_host=env.target_host,
name="conv2d_transpose",
)
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("conv2d_transpose.o"))
remote.upload(temp.relpath("conv2d_transpose.o"))
f = remote.load_module("conv2d_transpose.o")
ctx = remote.context(str(target))
- res_np = np.zeros(topi.util.get_const_tuple(res.shape)).astype(res.dtype)
+ res_np = np.zeros(topi.utils.get_const_tuple(res.shape)).astype(res.dtype)
data_arr = tvm.nd.array(data_np, ctx)
kernel_arr = tvm.nd.array(kernel_np, ctx)
res_arr = tvm.nd.array(res_np, ctx)
diff --git a/vta/tests/python/integration/test_benchmark_topi_dense.py b/vta/tests/python/integration/test_benchmark_topi_dense.py
index 37cfac1..0b60410 100644
--- a/vta/tests/python/integration/test_benchmark_topi_dense.py
+++ b/vta/tests/python/integration/test_benchmark_topi_dense.py
@@ -26,7 +26,7 @@ import numpy as np
import tvm
from tvm import te
from tvm import autotvm
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm.contrib.pickle_memoize import memoize
from tvm import topi
import tvm.topi.testing
@@ -131,13 +131,13 @@ def run_gemm(
mod = tvm.build(
s, [data, kernel, res], target=target, target_host=env.target_host, name="dense"
)
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("dense.o"))
remote.upload(temp.relpath("dense.o"))
f = remote.load_module("dense.o")
ctx = remote.context(str(target))
- res_np = np.zeros(topi.util.get_const_tuple(res.shape)).astype(res.dtype)
+ res_np = np.zeros(topi.utils.get_const_tuple(res.shape)).astype(res.dtype)
data_arr = tvm.nd.array(data_np, ctx)
kernel_arr = tvm.nd.array(kernel_np, ctx)
res_arr = tvm.nd.array(res_np, ctx)
diff --git a/vta/tests/python/integration/test_benchmark_topi_group_conv2d.py b/vta/tests/python/integration/test_benchmark_topi_group_conv2d.py
index 08d5e4b..da6ba5b 100644
--- a/vta/tests/python/integration/test_benchmark_topi_group_conv2d.py
+++ b/vta/tests/python/integration/test_benchmark_topi_group_conv2d.py
@@ -28,7 +28,7 @@ import tvm
from tvm import te
from tvm import relay
from tvm import autotvm
-from tvm.contrib import util
+from tvm.contrib import utils
from tvm import topi
import tvm.topi.testing
import vta
@@ -218,13 +218,13 @@ def run_group_conv2d(env, remote, wl, target, check_correctness=True, print_ir=F
mod = tvm.build(
s, [data, kernel, bias, res], target=target, target_host=env.target_host, name="conv2d"
)
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("conv2d.o"))
remote.upload(temp.relpath("conv2d.o"))
f = remote.load_module("conv2d.o")
ctx = remote.context(str(target))
- res_np = np.zeros(topi.util.get_const_tuple(res.shape)).astype(res.dtype)
+ res_np = np.zeros(topi.utils.get_const_tuple(res.shape)).astype(res.dtype)
data_arr = tvm.nd.array(data_np, ctx)
kernel_arr = tvm.nd.array(kernel_np, ctx)
bias_arr = tvm.nd.array(bias_np, ctx)
diff --git a/vta/tests/python/unittest/test_vta_insn.py b/vta/tests/python/unittest/test_vta_insn.py
index fb0acf1..b83510f 100644
--- a/vta/tests/python/unittest/test_vta_insn.py
+++ b/vta/tests/python/unittest/test_vta_insn.py
@@ -19,7 +19,7 @@ import tvm
from tvm import te
import numpy as np
from tvm import topi
-from tvm.contrib import util
+from tvm.contrib import utils
import vta
import vta.testing
@@ -54,7 +54,7 @@ def test_save_load_out():
if not remote:
return
- temp = util.tempdir()
+ temp = utils.tempdir()
m.save(temp.relpath("load_act.o"))
remote.upload(temp.relpath("load_act.o"))
f = remote.load_module("load_act.o")
@@ -125,7 +125,7 @@ def test_padded_load():
if not remote:
return
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("padded_load.o"))
remote.upload(temp.relpath("padded_load.o"))
f = remote.load_module("padded_load.o")
@@ -209,7 +209,7 @@ def test_gemm():
def verify(s, name=None):
mod = vta.build(s, [x, w, y], "ext_dev", env.target_host)
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("gemm.o"))
remote.upload(temp.relpath("gemm.o"))
f = remote.load_module("gemm.o")
@@ -371,7 +371,7 @@ def test_alu():
mod = vta.build(s, [a, res], "ext_dev", env.target_host)
else:
mod = vta.build(s, [a, b, res], "ext_dev", env.target_host)
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("load_act.o"))
remote.upload(temp.relpath("load_act.o"))
f = remote.load_module("load_act.o")
@@ -454,7 +454,7 @@ def test_relu():
mod = vta.build(s, [a, res], "ext_dev", env.target_host)
if not remote:
return
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("load_act.o"))
remote.upload(temp.relpath("load_act.o"))
f = remote.load_module("load_act.o")
@@ -516,7 +516,7 @@ def test_shift_and_scale():
mod = vta.build(s, [a, res], "ext_dev", env.target_host)
if not remote:
return
- temp = util.tempdir()
+ temp = utils.tempdir()
mod.save(temp.relpath("load_act.o"))
remote.upload(temp.relpath("load_act.o"))
f = remote.load_module("load_act.o")
diff --git a/vta/tutorials/autotvm/tune_relay_vta.py b/vta/tutorials/autotvm/tune_relay_vta.py
index cb36040..7f04424 100644
--- a/vta/tutorials/autotvm/tune_relay_vta.py
+++ b/vta/tutorials/autotvm/tune_relay_vta.py
@@ -62,7 +62,7 @@ from tvm import topi
import tvm
from tvm import te
from tvm import rpc, autotvm, relay
-from tvm.contrib import graph_runtime, util, download
+from tvm.contrib import graph_runtime, utils, download
from tvm.autotvm.measure.measure_methods import request_remote
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
@@ -424,7 +424,7 @@ def tune_and_evaluate(tuning_opt):
# Export library
print("Upload...")
- temp = util.tempdir()
+ temp = utils.tempdir()
lib.save(temp.relpath("graphlib.o"))
remote.upload(temp.relpath("graphlib.o"))
lib = remote.load_module("graphlib.o")
@@ -507,4 +507,4 @@ tune_and_evaluate(tuning_option)
# import logging
# logging.getLogger('autotvm').setLevel(logging.DEBUG)
#
-# Finally, always feel free to ask our community for help on https://discuss.tvm.ai
+# Finally, always feel free to ask our community for help on https://discuss.tvm.apache.org
diff --git a/vta/tutorials/frontend/deploy_classification.py b/vta/tutorials/frontend/deploy_classification.py
index 582eb03..1bf4161 100644
--- a/vta/tutorials/frontend/deploy_classification.py
+++ b/vta/tutorials/frontend/deploy_classification.py
@@ -52,7 +52,7 @@ from matplotlib import pyplot as plt
import tvm
from tvm import te
from tvm import rpc, autotvm, relay
-from tvm.contrib import graph_runtime, util, download
+from tvm.contrib import graph_runtime, utils, download
from tvm.contrib.debugger import debug_runtime
from tvm.relay import transform
@@ -204,7 +204,7 @@ with autotvm.tophub.context(target):
print(model + " inference graph built in {0:.2f}s!".format(build_time))
# Send the inference library over to the remote RPC server
- temp = util.tempdir()
+ temp = utils.tempdir()
lib.export_library(temp.relpath("graphlib.tar"))
remote.upload(temp.relpath("graphlib.tar"))
lib = remote.load_module("graphlib.tar")
diff --git a/vta/tutorials/frontend/legacy/deploy_detection.py b/vta/tutorials/frontend/legacy/deploy_detection.py
index f2c42c1..7a4aba9 100644
--- a/vta/tutorials/frontend/legacy/deploy_detection.py
+++ b/vta/tutorials/frontend/legacy/deploy_detection.py
@@ -241,7 +241,7 @@ with autotvm.tophub.context(target):
print(MODEL_NAME + " inference graph built in {0:.2f}s!".format(build_time))
# Send the inference library over to the remote RPC server
- temp = util.tempdir()
+ temp = utils.tempdir()
lib.export_library(temp.relpath("graphlib.tar"))
remote.upload(temp.relpath("graphlib.tar"))
lib = remote.load_module("graphlib.tar")
diff --git a/vta/tutorials/matrix_multiply.py b/vta/tutorials/matrix_multiply.py
index 71a8f67..60ea9ca 100644
--- a/vta/tutorials/matrix_multiply.py
+++ b/vta/tutorials/matrix_multiply.py
@@ -40,7 +40,7 @@ from tvm import te
import vta
import numpy as np
from tvm import rpc
-from tvm.contrib import util
+from tvm.contrib import utils
from vta.testing import simulator
# Load VTA parameters from the 3rdparty/vta-hw/config/vta_config.json file
@@ -389,7 +389,7 @@ print(vta.lower(s, [A, B, C], simple_mode=True))
my_gemm = vta.build(s, [A, B, C], "ext_dev", env.target_host, name="my_gemm")
# Write the compiled module into an object file.
-temp = util.tempdir()
+temp = utils.tempdir()
my_gemm.save(temp.relpath("gemm.o"))
# Send the executable over RPC
diff --git a/vta/tutorials/optimize/convolution_opt.py b/vta/tutorials/optimize/convolution_opt.py
index 2888f34..e991ffe 100644
--- a/vta/tutorials/optimize/convolution_opt.py
+++ b/vta/tutorials/optimize/convolution_opt.py
@@ -45,7 +45,7 @@ import vta
import numpy as np
from tvm import rpc
-from tvm.contrib import util
+from tvm.contrib import utils
from vta.testing import simulator
# Load VTA parameters from the 3rdparty/vta-hw/config/vta_config.json file
@@ -370,7 +370,7 @@ from tvm.topi.testing import conv2d_nchw_python
# Compile the TVM module
my_conv = vta.build(s, [data, kernel, res], "ext_dev", env.target_host, name="my_conv")
-temp = util.tempdir()
+temp = utils.tempdir()
my_conv.save(temp.relpath("conv2d.o"))
remote.upload(temp.relpath("conv2d.o"))
f = remote.load_module("conv2d.o")
diff --git a/vta/tutorials/optimize/matrix_multiply_opt.py b/vta/tutorials/optimize/matrix_multiply_opt.py
index 8797c3e..44552db 100644
--- a/vta/tutorials/optimize/matrix_multiply_opt.py
+++ b/vta/tutorials/optimize/matrix_multiply_opt.py
@@ -43,7 +43,7 @@ from tvm import te
import vta
import numpy as np
from tvm import rpc
-from tvm.contrib import util
+from tvm.contrib import utils
from vta.testing import simulator
# Load VTA parameters from the 3rdparty/vta-hw/config/vta_config.json file
@@ -311,7 +311,7 @@ print(vta.lower(s, [data, weight, res], simple_mode=True))
# Compile the TVM module
my_gemm = vta.build(s, [data, weight, res], "ext_dev", env.target_host, name="my_gemm")
-temp = util.tempdir()
+temp = utils.tempdir()
my_gemm.save(temp.relpath("gemm.o"))
remote.upload(temp.relpath("gemm.o"))
f = remote.load_module("gemm.o")
diff --git a/vta/tutorials/vta_get_started.py b/vta/tutorials/vta_get_started.py
index 8f37b2d..16d6135 100644
--- a/vta/tutorials/vta_get_started.py
+++ b/vta/tutorials/vta_get_started.py
@@ -67,7 +67,7 @@ env = vta.get_env()
# We'll need the TVM RPC module and the VTA simulator module
from tvm import rpc
-from tvm.contrib import util
+from tvm.contrib import utils
from vta.testing import simulator
# We read the Pynq RPC host IP address and port number from the OS environment
@@ -320,7 +320,7 @@ my_vadd = vta.build(s, [A, B, C], "ext_dev", env.target_host, name="my_vadd")
# execution.
# Write the compiled module into an object file.
-temp = util.tempdir()
+temp = utils.tempdir()
my_vadd.save(temp.relpath("vadd.o"))
# Send the executable over RPC
diff --git a/web/tests/python/webgpu_rpc_test.py b/web/tests/python/webgpu_rpc_test.py
index 5de8cf8..5efc85c 100644
--- a/web/tests/python/webgpu_rpc_test.py
+++ b/web/tests/python/webgpu_rpc_test.py
@@ -23,7 +23,7 @@ Connect javascript end to the websocket port and connect to the RPC.
import tvm
from tvm import te
from tvm import rpc
-from tvm.contrib import util, emcc
+from tvm.contrib import utils, emcc
import numpy as np
proxy_host = "localhost"
@@ -50,7 +50,7 @@ def test_rpc():
s[B].bind(xo, te.thread_axis("blockIdx.x"))
fadd = tvm.build(s, [A, B], target_device, target_host=target_host, name="addone")
- temp = util.tempdir()
+ temp = utils.tempdir()
wasm_path = temp.relpath("addone_gpu.wasm")
fadd.export_library(wasm_path, emcc.create_tvmjs_wasm)
diff --git a/web/tests/python/websock_rpc_test.py b/web/tests/python/websock_rpc_test.py
index 6729964..48603e8 100644
--- a/web/tests/python/websock_rpc_test.py
+++ b/web/tests/python/websock_rpc_test.py
@@ -23,7 +23,7 @@ Connect javascript end to the websocket port and connect to the RPC.
import tvm
from tvm import te
from tvm import rpc
-from tvm.contrib import util, emcc
+from tvm.contrib import utils, emcc
import numpy as np
proxy_host = "localhost"
@@ -43,7 +43,7 @@ def test_rpc():
s = te.create_schedule(B.op)
fadd = tvm.build(s, [A, B], target, name="addone")
- temp = util.tempdir()
+ temp = utils.tempdir()
wasm_path = temp.relpath("addone.wasm")
fadd.export_library(wasm_path, emcc.create_tvmjs_wasm)