Skip to content

Commit

Permalink
MLIR target & independent mlir nntc iter
Browse files Browse the repository at this point in the history
Change-Id: Ic733586be829fe49251cfc180990df2af2ed2535
  • Loading branch information
Jeffwhen committed Mar 22, 2023
1 parent 39e3cd7 commit 360e9d3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/tpu_perf/buildtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def __init__(self, root, args = None):
global_config['target'] = self.target = args.target
global_config['devices'] = args.devices

self.args = args

# Target specific configs
if self.target in global_config:
specific = global_config.pop(self.target)
Expand Down Expand Up @@ -229,6 +231,16 @@ def _read_dir(self, config_fn, context = dict()):

config = dict_override(config, context)

mlir_fields = ['mlir_transform', 'deploy', 'mlir_calibration']
if self.args.mlir and all(f not in config for f in mlir_fields):
return
nntc_fields = ['fp_compile_options', 'time_only_cali', 'cali', 'bmnetu_options']
if not self.args.mlir and all(f not in config for f in nntc_fields):
return

if self.args.mlir:
config['target'] = self.target.lower()

if 'name' not in config:
logging.error(f'Invalid config {config_fn}')
raise RuntimeError('Invalid config')
Expand Down

0 comments on commit 360e9d3

Please sign in to comment.