[Target] Tags, Composite Target, Unified Interface (#6369)
authorJunru Shao <junrushao1994@gmail.com>
Thu, 10 Sep 2020 15:39:04 +0000 (08:39 -0700)
committerGitHub <noreply@github.com>
Thu, 10 Sep 2020 15:39:04 +0000 (08:39 -0700)
commit6b6661ed92ecd46dfbce5f112e4dfa95f0a1af33
tree0ec8eb52e04bbed03b0c0e8ce97f2413d0f58a2b
parentb05aa967fa599f75f3e257321cd078b5845c7d4f
[Target] Tags, Composite Target, Unified Interface (#6369)

* Add `set_attr_preprocessor` to TargetKind registry, which is used to pre-process attribute maps.
* Use `set_attr_preprocessor` for NVPTX and ROCm backend to check and add mcpu and mtriple.
* Add TargetTag registration and retrieval on C++ side and python side. Allow creation of Target using the tag name.
* Unify target creation on C++ side, replace Target::Create and Target::FromConfig with the constructor.
* Unify target creation on python side, deprecate tvm.target.create and encourage direct use of the constructor of tvm.target.Target instead.
* Add initial support for composite target.
145 files changed:
apps/benchmark/gpu_imagenet_bench.py
apps/topi_recipe/conv/test_conv_int8_arm.py
apps/topi_recipe/conv/test_conv_int8_intel.py
apps/topi_recipe/gemm/gemm_int8.py
include/tvm/target/tag.h [new file with mode: 0644]
include/tvm/target/target.h
include/tvm/target/target_kind.h
python/tvm/autotvm/feature.py
python/tvm/autotvm/graph_tuner/base_graph_tuner.py
python/tvm/autotvm/measure/measure_methods.py
python/tvm/autotvm/record.py
python/tvm/autotvm/task/dispatcher.py
python/tvm/autotvm/task/task.py
python/tvm/autotvm/task/topi_integration.py
python/tvm/autotvm/tophub.py
python/tvm/contrib/peak.py
python/tvm/driver/build_module.py
python/tvm/relay/backend/compile_engine.py
python/tvm/relay/backend/graph_runtime_codegen.py
python/tvm/relay/backend/vm.py
python/tvm/relay/build_module.py
python/tvm/relay/testing/py_converter.py
python/tvm/target/__init__.py
python/tvm/target/codegen.py
python/tvm/target/intrin.py
python/tvm/target/tag.py [new file with mode: 0644]
python/tvm/target/target.py
python/tvm/te/hybrid/calls.py
python/tvm/te/hybrid/runtime.py
python/tvm/topi/cuda/conv2d_hwnc_tensorcore.py
python/tvm/topi/cuda/softmax.py
python/tvm/topi/generic/__init__.py
python/tvm/topi/testing/common.py
rust/tvm/examples/resnet/src/build_resnet.py
src/auto_scheduler/measure_record.cc
src/driver/driver_api.cc
src/relay/backend/build_module.cc
src/relay/backend/compile_engine.cc
src/relay/backend/graph_runtime_codegen.cc
src/relay/backend/interpreter.cc
src/relay/backend/vm/compiler.cc
src/relay/transforms/fold_constant.cc
src/relay/transforms/partial_eval.cc
src/target/build_common.h
src/target/llvm/codegen_amdgpu.cc
src/target/llvm/codegen_blob.cc
src/target/llvm/codegen_nvptx.cc
src/target/llvm/llvm_module.cc
src/target/tag.cc [new file with mode: 0644]
src/target/target.cc
src/target/target_kind.cc
src/topi/schedule.cc
tests/cpp/build_module_test.cc
tests/cpp/relay_build_module_test.cc
tests/cpp/relay_transform_sequential_test.cc
tests/cpp/target_test.cc
tests/cpp/utvm_runtime_standalone_test.cc
tests/python/contrib/test_ethosn/infrastructure.py
tests/python/integration/test_ewise.py
tests/python/integration/test_gemm.py
tests/python/integration/test_winograd_nnpack.py
tests/python/relay/test_backend_compile_engine.py
tests/python/relay/test_backend_interpreter.py
tests/python/relay/test_pass_alter_op_layout.py
tests/python/relay/test_pass_auto_quantize.py
tests/python/relay/test_pass_fold_constant.py
tests/python/relay/test_pass_manager.py
tests/python/relay/test_pass_qnn_legalize.py
tests/python/topi/python/test_fifo_buffer.py
tests/python/topi/python/test_topi_batch_matmul.py
tests/python/topi/python/test_topi_bitserial_conv2d.py
tests/python/topi/python/test_topi_bitserial_conv2d_rasp.py
tests/python/topi/python/test_topi_bnn.py
tests/python/topi/python/test_topi_broadcast.py
tests/python/topi/python/test_topi_clip.py
tests/python/topi/python/test_topi_conv1d.py
tests/python/topi/python/test_topi_conv1d_transpose_ncw.py
tests/python/topi/python/test_topi_conv2d_NCHWc.py
tests/python/topi/python/test_topi_conv2d_hwcn.py
tests/python/topi/python/test_topi_conv2d_hwnc_tensorcore.py
tests/python/topi/python/test_topi_conv2d_int8.py
tests/python/topi/python/test_topi_conv2d_nchw.py
tests/python/topi/python/test_topi_conv2d_nhwc.py
tests/python/topi/python/test_topi_conv2d_nhwc_pack_int8.py
tests/python/topi/python/test_topi_conv2d_nhwc_tensorcore.py
tests/python/topi/python/test_topi_conv2d_nhwc_winograd.py
tests/python/topi/python/test_topi_conv2d_transpose_nchw.py
tests/python/topi/python/test_topi_conv2d_winograd.py
tests/python/topi/python/test_topi_conv3d_ncdhw.py
tests/python/topi/python/test_topi_conv3d_ndhwc.py
tests/python/topi/python/test_topi_conv3d_ndhwc_tensorcore.py
tests/python/topi/python/test_topi_conv3d_transpose_ncdhw.py
tests/python/topi/python/test_topi_conv3d_winograd.py
tests/python/topi/python/test_topi_correlation.py
tests/python/topi/python/test_topi_deformable_conv2d.py
tests/python/topi/python/test_topi_dense.py
tests/python/topi/python/test_topi_dense_tensorcore.py
tests/python/topi/python/test_topi_depth_to_space.py
tests/python/topi/python/test_topi_depthwise_conv2d.py
tests/python/topi/python/test_topi_group_conv2d.py
tests/python/topi/python/test_topi_group_conv2d_NCHWc_int8.py
tests/python/topi/python/test_topi_image.py
tests/python/topi/python/test_topi_lrn.py
tests/python/topi/python/test_topi_math.py
tests/python/topi/python/test_topi_pooling.py
tests/python/topi/python/test_topi_reduce.py
tests/python/topi/python/test_topi_relu.py
tests/python/topi/python/test_topi_reorg.py
tests/python/topi/python/test_topi_softmax.py
tests/python/topi/python/test_topi_sort.py
tests/python/topi/python/test_topi_space_to_depth.py
tests/python/topi/python/test_topi_sparse.py
tests/python/topi/python/test_topi_tensor.py
tests/python/topi/python/test_topi_transform.py
tests/python/topi/python/test_topi_upsampling.py
tests/python/topi/python/test_topi_vision.py
tests/python/unittest/test_auto_scheduler_cost_model.py
tests/python/unittest/test_auto_scheduler_evolutionary_search.py
tests/python/unittest/test_auto_scheduler_feature.py
tests/python/unittest/test_auto_scheduler_measure.py
tests/python/unittest/test_auto_scheduler_search_policy.py
tests/python/unittest/test_auto_scheduler_sketch_generation.py
tests/python/unittest/test_autotvm_common.py
tests/python/unittest/test_autotvm_measure.py
tests/python/unittest/test_runtime_heterogeneous.py
tests/python/unittest/test_target_codegen_cuda.py
tests/python/unittest/test_target_codegen_llvm.py
tests/python/unittest/test_target_custom_datatypes.py
tests/python/unittest/test_target_target.py
tests/python/unittest/test_te_hybrid_script.py
tests/python/unittest/test_te_tensor_overload.py
tests/python/unittest/test_tir_analysis_verify_memory.py
tests/python/unittest/test_tir_transform_lower_intrin.py
tests/python/unittest/test_tir_transform_lower_warp_memory.py
tests/python/unittest/test_tir_transform_make_packed_api.py
tests/python/unittest/test_tir_transform_thread_sync.py
tutorials/autotvm/tune_conv2d_cuda.py
tutorials/autotvm/tune_relay_arm.py
tutorials/autotvm/tune_relay_mobile_gpu.py
tutorials/autotvm/tune_simple_template.py
tutorials/dev/use_pass_infra.py
tutorials/frontend/deploy_model_on_rasp.py
tutorials/language/tedd.py
tutorials/optimize/opt_matmul_auto_tensorcore.py
tutorials/topi/intro_topi.py