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

[Tests] Add a time unit flag for performance runs #988

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all 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
14 changes: 13 additions & 1 deletion build_tools/ci/cpu_comparison/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,14 @@ def generate_aie_output(config, aie_vmfb, input_args, function_name, name, outpu


def benchmark_aie_kernel_time(
config, aie_vmfb, input_args, function_name, name, n_repeats, n_kernel_runs
config,
aie_vmfb,
input_args,
function_name,
name,
n_repeats,
n_kernel_runs,
time_unit,
):
"""
Benchmark a compiled AIE module's (aie_vmfb) kernel time, average over the specified number of runs.
Expand All @@ -828,6 +835,7 @@ def benchmark_aie_kernel_time(
f"--benchmark_repetitions={n_repeats}",
f"--batch_size={n_kernel_runs}",
f"--xrt_lite_n_kernel_runs={n_kernel_runs}",
f"--time_unit={time_unit}",
]
if function_name:
run_args += [f"--function={function_name}"]
Expand Down Expand Up @@ -1199,6 +1207,7 @@ def benchmark_aie(
n_repeats,
n_kernel_runs,
seed=1,
time_unit="us",
):
"""
Arguments to the function are:
Expand All @@ -1224,6 +1233,8 @@ def benchmark_aie(
functions).
seed:
The seed to be used for generating the inputs.
time_unit:
The time unit to be shown in the benchmark output (ns, us, ms).
"""
if (
"--iree-amdaie-enable-infinite-loop-around-core-block=true"
Expand Down Expand Up @@ -1265,6 +1276,7 @@ def benchmark_aie(
name,
n_repeats,
n_kernel_runs,
time_unit,
)

if config.verbose:
Expand Down
Loading