Skip to content

Commit

Permalink
[Frontend][ArgParse] Compile with default(LLVM) target and build with…
Browse files Browse the repository at this point in the history
… BYOC(apache#17454)

It is a unique use-case to check the default target(LLVM), though TVM is built with BYOC(MRVL-ON)
The config of Codegen(BYOC) contains default values for configuration/optons, it is extracted
during _generate_codegen_args. In command line processing, validate_target_args checks if there are add-on options and it expects that particular target to be given explicitly in command line.  Here, it is test for default (LLVM) path only, hence validate_target_args need to ignore the codegen's configuration
  • Loading branch information
M N Ganesan committed Oct 9, 2024
2 parents 50199bd + a3688d9 commit 75467ca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/tvm/driver/tvmc/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,13 @@ def validate_targets(parse_targets, additional_target_options=None):
)

if additional_target_options is not None:
# Add-on target options are passed from codegen's config(BYOC) which has pass_default=True
# Eg: --target="llvm"
if len(tvm_targets) == 1:
return
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, Eg: --target="llvm" cnn.onnx
if len(tvm_targets) == 1 && (target_name == 'mrvl'):
return

first_option = list(additional_target_options[target_name].keys())[0]
raise TVMCException(
f"Passed --target-{target_name}-{first_option}"
Expand Down

0 comments on commit 75467ca

Please sign in to comment.