Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled with Default Target(LLVM) and Built with USE_MRVL=ON #17455

Merged
merged 14 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
6 changes: 6 additions & 0 deletions python/tvm/driver/tvmc/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ def validate_targets(parse_targets, additional_target_options=None):
if additional_target_options is not None:
for target_name in additional_target_options:
if not any([target for target in parse_targets if target["name"] == target_name]):
# When built with USE_MRVL=ON, add-on target options are passed from MRVL codegen's
# config which has pass_default=True and compiled with default target, don't error
# Use case: --target="llvm" cnn.onnx
if (len(tvm_targets) == 1) and (target_name == "mrvl"):
leandron marked this conversation as resolved.
Show resolved Hide resolved
return

first_option = list(additional_target_options[target_name].keys())[0]
raise TVMCException(
f"Passed --target-{target_name}-{first_option}"
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",
leandron marked this conversation as resolved.
Show resolved Hide resolved
]
)
assert parsed.target == "llvm"
leandron marked this conversation as resolved.
Show resolved Hide resolved


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