This is an automated email from the ASF dual-hosted git repository. tqchen pushed a commit to branch unity-staging in repository https://gitbox.apache.org/repos/asf/tvm.git
commit 9a3bbc1d379888151b31f401a2552d1a9f1a25a4 Merge: 201002e78e f4a7eaebd6 Author: tqchen <[email protected]> AuthorDate: Sat May 20 17:29:56 2023 -0400 [MERGE] merge main into unity 2023-05-20 CONTRIBUTORS.md | 1 + ci/jenkins/docker-images.ini | 20 +- include/tvm/script/printer/ir_docsifier_functor.h | 33 +++ include/tvm/tir/schedule/schedule.h | 7 + include/tvm/topi/nn.h | 6 +- include/tvm/topi/reduction.h | 8 +- python/tvm/auto_scheduler/cost_model/xgb_model.py | 20 +- python/tvm/auto_scheduler/dispatcher.py | 2 +- python/tvm/auto_scheduler/feature.py | 15 +- python/tvm/auto_scheduler/measure.py | 18 +- python/tvm/auto_scheduler/search_policy.py | 2 +- python/tvm/auto_scheduler/search_task.py | 23 +- python/tvm/auto_scheduler/task_scheduler.py | 15 +- python/tvm/auto_scheduler/utils.py | 8 +- python/tvm/auto_scheduler/workload_registry.py | 6 +- python/tvm/autotvm/feature.py | 9 +- python/tvm/autotvm/graph_tuner/base_graph_tuner.py | 10 +- python/tvm/autotvm/graph_tuner/pbqp_tuner.py | 4 +- .../autotvm/graph_tuner/utils/traverse_graph.py | 8 +- python/tvm/autotvm/measure/measure_methods.py | 52 +--- python/tvm/autotvm/record.py | 4 +- python/tvm/autotvm/task/dispatcher.py | 14 +- python/tvm/autotvm/task/space.py | 30 +-- python/tvm/autotvm/task/task.py | 10 +- python/tvm/autotvm/testing/tune_relay.py | 59 +---- python/tvm/autotvm/tophub.py | 10 +- python/tvm/autotvm/tuner/sa_model_optimizer.py | 2 +- python/tvm/autotvm/tuner/xgboost_cost_model.py | 28 +- python/tvm/contrib/cc.py | 34 ++- python/tvm/contrib/tar.py | 41 +++ python/tvm/ir/expr.py | 6 + python/tvm/ir/instrument.py | 2 +- .../tvm/relay/backend/contrib/ethosu/legalize.py | 77 ++++++ .../backend/contrib/ethosu/softmax_rewriter.py | 28 +- python/tvm/relay/backend/contrib/ethosu/util.py | 2 +- python/tvm/relay/frontend/paddlepaddle.py | 82 ++++++ python/tvm/relay/frontend/pytorch.py | 23 +- python/tvm/relay/op/__init__.py | 1 + python/tvm/relay/op/contrib/ethosu.py | 90 ++++++- python/tvm/relay/op/op.py | 21 ++ python/tvm/relay/qnn/op/qnn.py | 4 + .../transform/fake_quantization_to_integer.py | 18 +- python/tvm/relay/transform/transform.py | 11 +- python/tvm/target/target.py | 21 ++ python/tvm/tir/__init__.py | 2 +- python/tvm/tir/op.py | 12 + python/tvm/tir/schedule/schedule.py | 14 +- python/tvm/topi/arm_cpu/conv2d_spatial_pack.py | 20 +- src/relay/qnn/op/softmax.cc | 154 +++++++++++ src/relay/quantize/realize.cc | 21 +- .../transforms/fake_quantization_to_integer.cc | 73 ++++-- src/relay/transforms/pattern_utils.h | 4 + src/relay/transforms/simplify_expr.cc | 111 +++++--- src/runtime/crt/host/microtvm_api_server.py | 4 +- src/runtime/system_library.cc | 53 +++- src/runtime/vulkan/vulkan_device.cc | 5 +- src/runtime/vulkan/vulkan_device.h | 1 + src/runtime/vulkan/vulkan_device_api.cc | 4 + src/script/printer/ir/relay.cc | 48 ---- src/script/printer/ir_docsifier.cc | 5 + src/script/printer/tir/expr.cc | 5 +- src/script/printer/tir/function.cc | 20 ++ src/target/llvm/codegen_cpu.cc | 40 ++- src/target/llvm/codegen_llvm.cc | 23 +- src/target/parsers/aprofile.cc | 35 +-- src/target/source/codegen_cuda.cc | 23 +- src/target/spirv/codegen_spirv.cc | 193 ++++++++++++-- src/target/spirv/codegen_spirv.h | 14 + src/target/spirv/ir_builder.cc | 68 ++++- src/target/spirv/ir_builder.h | 25 +- src/target/spirv/spirv_support.cc | 4 + src/target/spirv/spirv_support.h | 14 + src/target/target_kind.cc | 1 + src/tir/ir/data_layout.cc | 2 +- src/tir/schedule/concrete_schedule.cc | 9 + src/tir/schedule/concrete_schedule.h | 1 + src/tir/schedule/primitive.h | 10 + src/tir/schedule/primitive/blockize_tensorize.cc | 287 +++++++++++++++++++-- src/tir/schedule/schedule.cc | 9 +- src/tir/schedule/traced_schedule.cc | 11 + src/tir/schedule/traced_schedule.h | 1 + src/tir/transforms/inject_rolling_buffer.cc | 2 +- src/tir/transforms/ir_utils.cc | 37 ++- src/tir/transforms/ir_utils.h | 8 + tests/cpp/target/parsers/aprofile_test.cc | 19 ++ tests/python/contrib/test_ethosu/infra.py | 6 +- tests/python/contrib/test_ethosu/test_codegen.py | 25 +- tests/python/contrib/test_ethosu/test_legalize.py | 241 ++++++++++++++++- .../metaschedule_e2e/test_resnet50_int8.py | 2 +- tests/python/driver/tvmc/test_frontends.py | 10 +- tests/python/driver/tvmc/test_parse_config_file.py | 2 +- tests/python/frontend/paddlepaddle/test_forward.py | 83 ++++++ tests/python/frontend/pytorch/test_forward.py | 17 ++ tests/python/relay/test_pass_convert_op_layout.py | 49 ++++ .../test_pass_fake_quantization_to_integer.py | 48 ++++ tests/python/relay/test_pass_simplify_expr.py | 22 ++ tests/python/topi/python/test_topi_reduce.py | 33 ++- .../unittest/test_meta_schedule_trace_apply.py | 18 +- tests/python/unittest/test_target_codegen_blob.py | 17 +- .../python/unittest/test_target_codegen_vulkan.py | 128 +++++++++ .../python/unittest/test_tir_schedule_blockize.py | 49 ++++ .../test_tir_transform_compact_buffer_region.py | 62 +++++ tests/python/unittest/test_tvmscript_roundtrip.py | 17 ++ 103 files changed, 2532 insertions(+), 574 deletions(-) diff --cc python/tvm/ir/expr.py index 721e12e7f8,1c775b461e..9c3e228f5d --- a/python/tvm/ir/expr.py +++ b/python/tvm/ir/expr.py @@@ -93,17 -84,13 +95,21 @@@ class GlobalVar(RelayExpr) A call taking the variable as a function. """ # pylint: disable=import-outside-toplevel + + # TODO(@relax-team): replace with Relax base class after it's introduced if all(isinstance(x, RelayExpr) for x in args): - from tvm import relay + if all(is_relax_expr(x) for x in args): + from tvm import relax + + return relax.Call(self, args) + else: + from tvm import relay + + return relay.Call(self, args) + - return relay.Call(self, args) + elif all(isinstance(x, (Number, PrimExpr)) for x in args): + return tvm.tir.call_tir(self, *args) + arg_types = [type(x) for x in args] raise RuntimeError( "Do not know how to handle GlobalVar.__call__ for types {}".format(arg_types)
