Skip to content

[Backend Tester] Report PTE size #13249

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

Open
wants to merge 2 commits into
base: gh/GregoryComer/93/head
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions backends/test/suite/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ class TestCaseSummary:
undelegated_op_counts: Counter | None = None
""" The number of undelegated occurances of each operator in the graph. """

pte_size_bytes: int | None = None
""" The size of the PTE file in bytes. """


class TestSessionState:
test_case_summaries: list[TestCaseSummary]
Expand Down Expand Up @@ -302,6 +305,7 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
"Undelegated Nodes",
"Delegated Ops",
"Undelegated Ops",
"PTE Size (Kb)",
]
)

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

writer.writerow(row)
1 change: 1 addition & 0 deletions backends/test/suite/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def build_result(
if is_delegated:
try:
tester.to_executorch().serialize()
extra_stats["pte_size_bytes"] = len(tester.get_artifact())
except Exception as e:
# We could introduce a result value for this, but I'm not sure it's necessary.
# We can do this if we ever see to_executorch() or serialize() fail due a backend issue.
Expand Down
Loading