Skip to content
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 tests/test_inference_perf_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
merge_capture_trace_into_graph,
)

from conftest import update_reference_csvs

pytestmark = pytest.mark.filterwarnings(
"ignore:Input list of events is empty.*:UserWarning",
"ignore:Input DataFrame is empty.*:UserWarning",
Expand Down Expand Up @@ -222,7 +224,13 @@ def _clear_capture_tree_cache():
find_inference_test_cases(),
)
def test_inference_perf_report(
dirpath, trace_gz, capture_folder, gpu_arch_path, tmp_path, tol=1e-6
dirpath,
trace_gz,
capture_folder,
gpu_arch_path,
tmp_path,
update_references,
tol=1e-6,
):
"""
Directly call generate_perf_report_pytorch (from the inference module)
Expand Down Expand Up @@ -272,6 +280,10 @@ def test_inference_perf_report(
csv_path
), f"CSV output for sheet '{sheet_name}' was not written to {csv_path}"

if update_references:
update_reference_csvs(output_csvs_dir, ref_csvs_dir)
return

# Compare each generated CSV against the reference CSV in perf_csvs/
ref_csv_files = [f for f in os.listdir(ref_csvs_dir) if f.endswith(".csv")]
for csv_file in ref_csv_files:
Expand Down
Loading