Skip to content

Commit

Permalink
Add flag --perf_analysis to enable performance data collection
Browse files Browse the repository at this point in the history
  • Loading branch information
milank94 committed Jun 5, 2024
1 parent 306fff2 commit 1cbeb9b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ def run(
elif args.save_tti or args.load_tti:
raise Exception(f"{args.model} currently cannot be compiled to TTI.")

# Enable perf analysis, if selected
if args.perf_analysis:
args.loop_count = 1
if "PYBUDA_OP_PERF" not in os.environ:
os.environ["PYBUDA_OP_PERF"] = "1"
if "TT_BACKEND_PERF_ANALYZER" not in os.environ:
os.environ["TT_BACKEND_PERF_ANALYZER"] = "1"

# Set PyBUDA configurations
pybuda.set_configuration_options(
math_fidelity=mf_from_str(args.math_fidelity),
Expand Down Expand Up @@ -479,6 +487,9 @@ def pop_outputs_thread(output_q):
type=str,
help="Save compilation for TTDevice into a TTI-archive configured for silicon to file and exit program. (specify path to save to).",
)
parser.add_argument(
"--perf_analysis", action="store_true", help="Enable backend perf analyzer and op estimates in compiler"
)
parser.add_argument(
"--model_output",
action="store_true",
Expand Down

0 comments on commit 1cbeb9b

Please sign in to comment.