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 fd20ca2f6ce01bd03abb5918f05374d4ece77359 Merge: 773620f267 9999114e70 Author: tqchen <[email protected]> AuthorDate: Sun May 14 22:43:09 2023 -0400 [MERGE] Merge main into unity 2023-05-14 apps/cpp_rtvm/tvm_runner.h | 3 +- cmake/config.cmake | 13 - cmake/modules/LibInfo.cmake | 1 + cmake/modules/OpenCL.cmake | 1 + cmake/modules/Vulkan.cmake | 1 + docker/Dockerfile.ci_cpu | 4 + include/tvm/ir/module.h | 29 ++ include/tvm/runtime/module.h | 2 - include/tvm/target/codegen.h | 9 +- include/tvm/tir/usmp/utils.h | 2 +- python/tvm/contrib/cutlass/build.py | 1 + python/tvm/ir/memory_pools.py | 2 +- python/tvm/relay/backend/interpreter.py | 11 +- python/tvm/relay/backend/te_compiler.py | 4 +- python/tvm/relay/build_module.py | 2 +- python/tvm/relay/expr.py | 69 ++-- python/tvm/relay/expr_functor.py | 8 +- python/tvm/relay/frontend/caffe.py | 16 +- python/tvm/relay/frontend/caffe2.py | 24 +- python/tvm/relay/frontend/common.py | 28 +- python/tvm/relay/frontend/coreml.py | 22 +- python/tvm/relay/frontend/darknet.py | 9 +- python/tvm/relay/frontend/keras.py | 119 +++--- python/tvm/relay/frontend/mxnet.py | 62 ++-- python/tvm/relay/frontend/mxnet_qnn_op_utils.py | 4 +- python/tvm/relay/frontend/nnvm_common.py | 2 +- python/tvm/relay/frontend/oneflow.py | 72 ++-- python/tvm/relay/frontend/onnx.py | 408 +++++++-------------- python/tvm/relay/frontend/paddlepaddle.py | 48 +-- python/tvm/relay/frontend/pytorch.py | 183 ++++----- python/tvm/relay/frontend/qnn_torch.py | 25 +- python/tvm/relay/frontend/tensorflow.py | 38 +- python/tvm/relay/frontend/tensorflow2.py | 31 +- python/tvm/relay/frontend/tensorflow2_ops.py | 2 +- python/tvm/relay/frontend/tensorflow_ops.py | 136 +++---- python/tvm/relay/frontend/tflite.py | 73 ++-- python/tvm/relay/loops.py | 2 +- python/tvm/relay/op/annotation/annotation.py | 2 +- python/tvm/relay/op/contrib/clml.py | 45 ++- python/tvm/relay/op/contrib/cutlass.py | 2 +- python/tvm/relay/op/contrib/dnnl.py | 19 +- python/tvm/relay/op/nn/_nn.py | 15 +- python/tvm/relay/op/nn/utils.py | 6 +- python/tvm/relay/op/op.py | 10 +- python/tvm/relay/op/strategy/adreno.py | 10 +- python/tvm/relay/op/strategy/arm_cpu.py | 32 +- python/tvm/relay/op/strategy/bifrost.py | 10 +- python/tvm/relay/op/strategy/cuda.py | 37 +- python/tvm/relay/op/strategy/generic.py | 83 ++--- python/tvm/relay/op/strategy/hexagon.py | 4 +- python/tvm/relay/op/strategy/hls.py | 6 +- python/tvm/relay/op/strategy/intel_graphics.py | 4 +- python/tvm/relay/op/strategy/mali.py | 12 +- python/tvm/relay/op/strategy/x86.py | 28 +- python/tvm/relay/op/tensor.py | 2 +- python/tvm/relay/op/transform.py | 4 +- python/tvm/relay/op/vision/_rcnn.py | 4 +- python/tvm/relay/prelude.py | 76 ++-- python/tvm/relay/qnn/op/layout_conversions.py | 4 +- python/tvm/relay/qnn/op/qnn.py | 81 +--- python/tvm/relay/quantize/_calibrate.py | 4 +- python/tvm/relay/quantize/quantize.py | 4 +- python/tvm/relay/testing/dcgan.py | 4 +- python/tvm/relay/testing/densenet.py | 12 +- python/tvm/relay/testing/inception_v3.py | 100 +++-- python/tvm/relay/testing/init.py | 11 +- python/tvm/relay/testing/layers.py | 12 +- python/tvm/relay/testing/lstm.py | 20 +- python/tvm/relay/testing/mobilenet.py | 2 +- python/tvm/relay/testing/py_converter.py | 21 +- python/tvm/relay/testing/resnet.py | 8 +- python/tvm/relay/testing/resnet_3d.py | 8 +- python/tvm/relay/testing/squeezenet.py | 17 +- python/tvm/relay/testing/tf.py | 8 +- python/tvm/relay/testing/tflite.py | 2 +- python/tvm/relay/testing/vgg.py | 8 +- .../transform/fake_quantization_to_integer.py | 30 +- python/tvm/relay/type_functor.py | 2 +- python/tvm/runtime/module.py | 27 +- python/tvm/script/parser/core/entry.py | 18 +- .../default.py => script/parser/core/error.py} | 24 +- python/tvm/script/parser/core/evaluator.py | 7 +- python/tvm/script/parser/core/parser.py | 8 +- python/tvm/script/parser/tir/parser.py | 52 ++- python/tvm/testing/utils.py | 17 +- python/tvm/topi/adreno/conv2d_alter_op.py | 77 ++-- python/tvm/topi/adreno/pooling.py | 4 +- python/tvm/topi/arm_cpu/bitserial_dense.py | 2 +- python/tvm/topi/arm_cpu/conv2d.py | 15 +- python/tvm/topi/arm_cpu/conv2d_alter_op.py | 26 +- python/tvm/topi/arm_cpu/tensor_intrin.py | 69 +--- python/tvm/topi/bifrost/conv2d.py | 2 +- python/tvm/topi/cuda/batch_matmul.py | 2 +- python/tvm/topi/cuda/batch_matmul_tensorcore.py | 2 +- python/tvm/topi/cuda/conv2d.py | 2 +- python/tvm/topi/cuda/conv2d_hwcn.py | 2 +- python/tvm/topi/cuda/conv2d_int8.py | 4 +- python/tvm/topi/cuda/conv3d.py | 2 +- python/tvm/topi/cuda/conv3d_direct.py | 2 +- python/tvm/topi/cuda/dense.py | 18 +- python/tvm/topi/cuda/dense_tensorcore.py | 2 +- python/tvm/topi/cuda/group_conv2d_nchw.py | 12 +- python/tvm/topi/cuda/pooling.py | 4 +- python/tvm/topi/cuda/reduction.py | 4 +- python/tvm/topi/cuda/scan.py | 2 +- python/tvm/topi/cuda/softmax.py | 5 +- python/tvm/topi/cuda/sparse.py | 7 +- python/tvm/topi/generic/conv2d.py | 34 +- python/tvm/topi/generic/default.py | 2 +- python/tvm/topi/generic/injective.py | 2 +- python/tvm/topi/hexagon/conv2d_alter_op.py | 6 +- python/tvm/topi/hexagon/qnn/conv2d_alter_op.py | 6 +- python/tvm/topi/hls/nn.py | 15 +- python/tvm/topi/image/resize.py | 55 +-- python/tvm/topi/intel_graphics/conv2d_alter_op.py | 10 +- python/tvm/topi/mali/conv2d.py | 18 +- python/tvm/topi/nn/conv2d.py | 70 +--- python/tvm/topi/nn/depthwise_conv2d.py | 32 +- python/tvm/topi/nn/dilate.py | 2 +- python/tvm/topi/nn/fifo_buffer.py | 10 +- python/tvm/topi/nn/pad.py | 12 +- python/tvm/topi/nn/sparse.py | 2 +- python/tvm/topi/nn/upsampling.py | 4 +- python/tvm/topi/nn/utils.py | 17 +- python/tvm/topi/nn/winograd_util.py | 4 +- python/tvm/topi/random/kernel.py | 13 +- python/tvm/topi/reduction.py | 2 +- python/tvm/topi/sparse/csrmm.py | 7 +- python/tvm/topi/sparse/csrmv.py | 7 +- python/tvm/topi/sparse/dense.py | 10 +- python/tvm/topi/testing/dilate_python.py | 5 +- python/tvm/topi/testing/poolnd_python.py | 12 +- python/tvm/topi/testing/resize_python.py | 2 +- python/tvm/topi/transform.py | 11 +- python/tvm/topi/utils.py | 21 +- python/tvm/topi/x86/binarize_pack.py | 2 +- python/tvm/topi/x86/binary_dense.py | 2 +- python/tvm/topi/x86/bitserial_dense.py | 2 +- python/tvm/topi/x86/conv2d.py | 13 +- python/tvm/topi/x86/conv2d_alter_op.py | 18 +- python/tvm/topi/x86/conv2d_avx_1x1.py | 4 +- python/tvm/topi/x86/conv2d_avx_common.py | 2 +- python/tvm/topi/x86/conv2d_int8.py | 6 +- python/tvm/topi/x86/conv3d.py | 31 +- python/tvm/topi/x86/dense_alter_op.py | 15 +- python/tvm/topi/x86/depthwise_conv2d.py | 6 +- python/tvm/topi/x86/nn.py | 5 +- python/tvm/topi/x86/pooling.py | 4 +- python/tvm/topi/x86/reduction.py | 4 +- src/arith/const_int_bound.cc | 2 + src/relay/backend/contrib/clml/codegen.cc | 40 +- src/runtime/contrib/clml/clml_runtime.cc | 176 +++++---- src/runtime/library_module.h | 2 + src/runtime/opencl/opencl_common.h | 60 +-- src/runtime/opencl/opencl_module.cc | 36 +- src/runtime/opencl/opencl_module.h | 14 +- src/runtime/opencl/opencl_module_spirv.cc | 137 +++++++ .../vulkan_shader.h => spirv/spirv_shader.h} | 16 +- src/runtime/system_library.cc | 58 ++- src/runtime/vulkan/vulkan_module.cc | 6 +- src/runtime/vulkan/vulkan_module.h | 4 +- src/runtime/vulkan/vulkan_wrapped_func.h | 6 +- src/script/printer/ir/relay.cc | 48 +++ src/script/printer/tir/usmp.cc | 58 +++ src/support/libinfo.cc | 1 + src/support/ring_buffer.h | 12 +- src/target/codegen.cc | 31 +- src/target/llvm/codegen_amdgpu.cc | 2 +- src/target/llvm/codegen_blob.cc | 22 +- src/target/llvm/codegen_blob.h | 4 +- src/target/llvm/codegen_cpu.cc | 22 +- src/target/llvm/codegen_cpu.h | 9 +- src/target/llvm/codegen_hexagon.cc | 14 +- src/target/llvm/codegen_llvm.cc | 5 +- src/target/llvm/codegen_llvm.h | 7 +- src/target/llvm/codegen_nvptx.cc | 2 +- src/target/llvm/llvm_module.cc | 53 ++- src/target/opt/build_opencl_off.cc | 7 + src/target/source/codegen_metal.cc | 5 + src/target/source/codegen_metal.h | 1 + src/target/source/codegen_opencl.cc | 15 +- src/target/spirv/build_vulkan.cc | 134 +------ src/target/spirv/codegen_spirv.cc | 5 +- src/target/spirv/codegen_spirv.h | 6 +- src/target/spirv/spirv_support.cc | 5 +- .../spirv/{build_vulkan.cc => spirv_utils.cc} | 64 ++-- .../{llvm/codegen_blob.h => spirv/spirv_utils.h} | 43 +-- src/tir/transforms/arg_binder.cc | 2 +- src/tir/transforms/flatten_buffer.cc | 2 + src/tir/transforms/lower_intrin.cc | 10 +- src/tir/transforms/make_packed_api.cc | 22 +- tests/cpp/support/ring_buffer_test.cc | 68 ++++ tests/python/contrib/test_clml/infrastructure.py | 2 + tests/python/contrib/test_clml/test_ops.py | 107 +++++- tests/python/frontend/keras/test_forward.py | 1 + tests/python/frontend/pytorch/test_forward.py | 10 + .../relay/aot/test_crt_forward_declarations.py | 4 +- .../python/unittest/test_arith_const_int_bound.py | 18 + tests/python/unittest/test_runtime_dlpack.py | 52 +++ tests/python/unittest/test_runtime_module_load.py | 58 ++- tests/python/unittest/test_runtime_rpc.py | 18 +- tests/python/unittest/test_target_codegen_blob.py | 85 +++-- tests/python/unittest/test_target_codegen_metal.py | 46 ++- .../python/unittest/test_target_codegen_opencl.py | 32 +- .../unittest/test_tvmscript_meta_programming.py | 67 ++-- 205 files changed, 2408 insertions(+), 2486 deletions(-) diff --cc python/tvm/script/parser/core/entry.py index d8a11f5b46,5315c0f675..a4362b00ae --- a/python/tvm/script/parser/core/entry.py +++ b/python/tvm/script/parser/core/entry.py @@@ -52,12 -52,21 +53,23 @@@ def parse(program: Union[doc.AST, Any, "ir": ir, "T": tir, "tir": tir, + "relax": relax, + "R": relax, } + ann = {} + if inspect.isfunction(program): + ann = {program.__name__: program.__annotations__} + elif inspect.isclass(program): + for name, func in program.__dict__.items(): + if inspect.isfunction(func): + ann[name] = func.__annotations__ + source = Source(program) - parser = Parser(source) + parser = Parser(source, ann) with IRBuilder() as builder: - parser.parse(extra_vars=extra_vars) + try: + parser.parse(extra_vars=extra_vars) + except ParserError as err: + parser.report_error(err.node, err.args[0]) return builder.get()
