Skip to content

Add script to fetch benchmark results for execuTorch #11734

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 45 commits into
base: main
Choose a base branch
from
Open

Conversation

yangw-dev
Copy link
Contributor

@yangw-dev yangw-dev commented Jun 16, 2025

Summary

Provide methods and script to fetch all execuTorch benchamrk data from HUD API into two dataset,private and public, the script will:

  • fetch all data from HUD API from input time range in UTC
  • clean out records and tables with only FAILURE_REPORT due to job-level failures
  • get all private table metrics, generate table_name and find intersected public table metrics
  • generate private and public table groups
  • output data

OutputType:

  • run with excel-sheet export
  • run with csv export
  • run with dataframe format print
  • run with json format print

See more guidance in README.md

the data is similar to the excel sheet generated manually in #10982
The result should be the same as the hud per model datatable:
image

helper methods: common.py

provide common.py helper method to convert back csv and excel sheets back to {"groupInfo":{}, "df":df.DataFrame} format.

Signed-off-by: Yang Wang <[email protected]>
Copy link

pytorch-bot bot commented Jun 16, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11734

Note: Links to docs will display an error until the docs builds have been completed.

❌ 5 New Failures

As of commit 99df0fe with merge base 9bb0735 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 16, 2025
Signed-off-by: Yang Wang <[email protected]>
@yangw-dev yangw-dev changed the title final Add script to fetch benchmark results for execuTorch Jun 17, 2025
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
@yangw-dev yangw-dev requested review from guangy10 and huydhn June 17, 2025 00:54
@yangw-dev
Copy link
Contributor Author

FYI, this method can be more general, but since only execuTorch is using it, i just make it execuTorch specific @huydhn

Signed-off-by: Yang Wang <[email protected]>
@yangw-dev yangw-dev marked this pull request as ready for review June 17, 2025 01:02
@yangw-dev
Copy link
Contributor Author

yangw-dev commented Jun 17, 2025

the excel sheet has limit of sheet name len < 31, which can be easy to break in the future. @huydhn @guangy10 , I think instead of generate one file per category, maybe we can generate list of excel files stored in folders [private, public]

But right now with the hard-coded abbreviation, this works fine. THe excel sheet option is there in case people want to use it.

@yangw-dev yangw-dev requested a review from huydhn June 17, 2025 17:41
@yangw-dev yangw-dev self-assigned this Jun 17, 2025
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Copy link
Contributor

@huydhn huydhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamped to unblock! Let's start using the script and improve it along the way

@guangy10
Copy link
Contributor

We configured a fixed list of matching names to list limited tables

I think we should make it more flexible as there are always new models, recipes, devices added. For example, we recently add more models (see on dash) from huggingface/optimum-executorch to the benchmark infra, and the list will keep expanding.

Similarly with new "devices" or "backends" available, we want to be able to query the results via the script as well.

the excel sheet has limit of sheet name len < 31, which can be easy to break in the future. @huydhn @guangy10 , I think instead of generate one file per category, maybe we can generate list of excel files stored in folders [private, public]

Yeah noticed the limits when I manually created the excel sheet. Ideally I'd like to get rid of the excel sheet by wiring the outputs from db to the analysis script directly. Given what is currently supported in this PR, what does the workflow look like if I want to rerun the analysis? That is, how is this script interfaced to the analysis script?

@yangw-dev
Copy link
Contributor Author

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot bot added the release notes: none Do not include this in the release notes label Jun 18, 2025
Notice, the filter needs full name matchings with correct format, to see all the options of the filter choices, please run the script with `--print-all-table-info`, and pay attention to section `Full list of table info from HUD API` with the field 'info', which contains normalized data we use to filter records from the original metadata 'groupInfo'.
The filter block any record if it does not in any of the filter keywords.

- `--devices`: Filter by specific device names (e.g., "samsung-galaxy-s22-5g", "samsung-galaxy-s22plus-5g")
Copy link
Contributor

@guangy10 guangy10 Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Is this field always refer to private device?
  2. What is the format to specify multiple devices? comma-separated or something else, should it be clarified here?
  3. All supported devices can be found here (Note it's mixing of private and public), should --help list all supported devices so users can copy/paste easily.
  4. We should be consistent on names of these devices in all places. https://github.com/pytorch/executorch/blob/main/.ci/scripts/gather_benchmark_configs.py#L20-L29

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be general, I can associate with the list to provide list of choices when user try to add to it, if underscore needs to be consistent, i can change some thing, but

Copy link
Contributor Author

@yangw-dev yangw-dev Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed everything to private devices now since we first filter wiht private devices, i only add two private_device_pool options there

Copy link
Contributor

@guangy10 guangy10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for iterating on this! There are few critical issues to be fixed in order to merge

@yangw-dev yangw-dev requested a review from guangy10 June 18, 2025 21:30
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
@yangw-dev
Copy link
Contributor Author

yangw-dev commented Jun 19, 2025

@guangy10
I updated logics
Fetch and process benchmark data from HUD API for ExecutorchBenchmark.

This class provides methods to:
1. Fetch all benchmark data for a specified time range
2. Get all private device info within the time range
3. Filter the private device data if filter is provided, for backends and models we expect human-readable models, notice, everything is first based on private devices.
4. Then use the filtered private device data to find matched the public device data using [model, backend, device, arch]
3. Export results in various formats (JSON, DataFrame, Excel, CSV)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants