Skip to content

Commit

Permalink
toplev: Add --fp16 option
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Sep 28, 2023
1 parent bcf48e7 commit af906e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions toplev.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ def del_arg_val(arg, flag):
g.add_argument('--aux', help='Enable auxilliary hierarchy nodes on some models. '
'Auxiliary nodes offer alternate views of the same bottleneck component, which can impact observed bottleneck percentage totals',
action='store_true')
g.add_argument("--fp16", help='Enable FP16 support in some models', action='store_true')

g = p.add_argument_group('Query nodes')
g.add_argument('--list-metrics', help='List all metrics. Can be followed by prefixes to limit, ^ for full match',
Expand Down Expand Up @@ -3834,6 +3835,12 @@ def init_model(model, runner):
if "Num_CPUs" in model.__dict__:
model.Num_CPUs = lambda a, b, c: len(cpu.allcpus)

if args.fp16:
if "FP16" in model.__dict__:
model.FP16 = lambda a, b, c: True
else:
sys.exit("--fp16 option but no support in model")

tune_model(model)

return version
Expand Down

0 comments on commit af906e6

Please sign in to comment.