Skip to content

Commit 82ebf25

Browse files
committed
[Backend Tester] Report PTE size
ghstack-source-id: 90c61a5 ghstack-comment-id: 3169524165 Pull-Request: #13249
1 parent 01a8ffd commit 82ebf25

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

backends/test/suite/reporting.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ class TestCaseSummary:
131131
undelegated_op_counts: Counter | None = None
132132
""" The number of undelegated occurances of each operator in the graph. """
133133

134+
pte_size_bytes: int | None = None
135+
""" The size of the PTE file in bytes. """
136+
134137

135138
class TestSessionState:
136139
test_case_summaries: list[TestCaseSummary]
@@ -302,6 +305,7 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
302305
"Undelegated Nodes",
303306
"Delegated Ops",
304307
"Undelegated Ops",
308+
"PTE Size (Kb)",
305309
]
306310
)
307311

@@ -336,5 +340,8 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
336340
row["Undelegated Nodes"] = _sum_op_counts(record.undelegated_op_counts)
337341
row["Delegated Ops"] = _serialize_op_counts(record.delegated_op_counts)
338342
row["Undelegated Ops"] = _serialize_op_counts(record.undelegated_op_counts)
343+
row["PTE Size (Kb)"] = (
344+
record.pte_size_bytes / 1000.0 if record.pte_size_bytes else ""
345+
)
339346

340347
writer.writerow(row)

backends/test/suite/runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def build_result(
129129
if is_delegated:
130130
try:
131131
tester.to_executorch().serialize()
132+
extra_stats["pte_size_bytes"] = len(tester.get_artifact())
132133
except Exception as e:
133134
# We could introduce a result value for this, but I'm not sure it's necessary.
134135
# We can do this if we ever see to_executorch() or serialize() fail due a backend issue.

0 commit comments

Comments
 (0)