Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions python/tvm/driver/tvmc/composite_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,41 +52,49 @@
"compute-library": {
"config_key": None,
"pass_default": False,
"default_target": None,
"pass_pipeline": partition_for_arm_compute_lib,
},
"cmsis-nn": {
"config_key": "relay.ext.cmsisnn.options",
"pass_default": False,
"default_target": None,
"pass_pipeline": partition_for_cmsisnn,
},
"ethos-n": {
"config_key": "relay.ext.ethos-n.options",
"pass_default": False,
"default_target": None,
"pass_pipeline": partition_for_ethosn,
},
"ethos-u": {
"config_key": "relay.ext.ethos-u.options",
"pass_default": False,
"default_target": None,
"pass_pipeline": partition_for_ethosu,
},
"bnns": {
"config_key": None,
"pass_default": False,
"default_target": None,
"pass_pipeline": partition_for_bnns,
},
"vitis-ai": {
"config_key": "relay.ext.vitis_ai.options",
"pass_default": False,
"default_target": None,
"pass_pipeline": partition_for_vitis_ai,
},
"clml": {
"config_key": None,
"pass_default": False,
"default_target": None,
"pass_pipeline": partition_for_clml,
},
"mrvl": {
"config_key": "relay.ext.mrvl.options",
"pass_default": True,
"default_target": "llvm",
"pass_pipeline": partition_for_mrvl,
},
}
Expand Down
5 changes: 5 additions & 0 deletions python/tvm/driver/tvmc/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def _reconstruct_codegen_args(args, codegen_name):
codegen = get_codegen_by_target(codegen_name)
pass_configs = PassContext.list_configs()
codegen_options = {}
default_tgt = codegen["default_target"]

# Do not fetch codegen options, if the default target alone is choosen by user
if codegen_name not in args.target and default_tgt is not None and default_tgt in args.target:
return codegen_options

if codegen["config_key"] is not None and codegen["config_key"] in pass_configs:
attrs = make_node(pass_configs[codegen["config_key"]]["type"])
Expand Down
13 changes: 13 additions & 0 deletions tests/python/driver/tvmc/test_target_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ def test_default_arg_for_mrvl_hybrid():
assert parsed.target_mrvl_num_tiles == 8


@tvm.testing.requires_mrvl
# Test for default(LLVM) target, when built with USE_MRVL=ON
def test_mrvl_build_with_llvm_only_target():
parser = argparse.ArgumentParser()
generate_target_args(parser)
parsed, _ = parser.parse_known_args(
[
"--target=llvm",
]
)
assert parsed.target == "llvm"


@tvm.testing.requires_cmsisnn
def test_mapping_target_args():
parser = argparse.ArgumentParser()
Expand Down