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

#15979: Switch to google benchmark for pgm dispatch tests #16547

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

jbaumanTT
Copy link
Contributor

@jbaumanTT jbaumanTT commented Jan 9, 2025

Ticket

#15979

Problem description

The current output format works well with a smaller number of tests, but with a large number of tests it's hard to connect the resulting number to the test that created it. This particular hinders storing test results in a database and comparing them across runs.

What's changed

Switch to using the google benchmark framework, which outputs a JSON file containing the results of all tests. By default, running the binary runs all the benchmarks from sweep_pgm_dispatch.sh. The set of tests to be run can be filtered using the --benchmark_filter=<regex> command-line argument.

One-off test cases can be run by passing --custom and the command line arguments as before.

Checklist

  • Post commit CI passes
  • Blackhole Post commit (if applicable)
  • Model regression CI testing passes (if applicable)
  • Device performance regression CI testing passes (if applicable)
  • (For models and ops writers) Full new models tests passes
  • New/Existing tests provide coverage for changes

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

jbaumanTT added a commit that referenced this pull request Jan 9, 2025
The current output format works well with a smaller number of tests, but with a
large number of tests it's hard to connect the resulting number to the test
that created it. This particular hinders storing test results in a database and
comparing them across runs.

Switch to using the google benchmark framework, which outputs a JSON file
containing the results of all tests. By default, running the binary runs all
the benchmarks from sweep_pgm_dispatch.sh. The set of tests to be run can be
filtered using the `--benchmark_filter=<regex>` command-line argument.

One-off test cases can be run by passing `--custom` and the command line arguments as before.
@jbaumanTT jbaumanTT force-pushed the jbauman/googlebenchmark2 branch from 43eafb6 to c1c334e Compare January 9, 2025 07:05
@jbaumanTT jbaumanTT marked this pull request as ready for review January 9, 2025 17:14
Copy link
Contributor

@pgkeller pgkeller left a comment

Choose a reason for hiding this comment

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

I use filt_pgm_dispatch for the bw_and_latency test as well, so don't delete that.
I still want to dump these results to a spreadsheet, what does that flow look like?
Otherwise looks good

jbaumanTT added a commit that referenced this pull request Jan 9, 2025
The current output format works well with a smaller number of tests, but with a
large number of tests it's hard to connect the resulting number to the test
that created it. This particular hinders storing test results in a database and
comparing them across runs.

Switch to using the google benchmark framework, which outputs a JSON file
containing the results of all tests. By default, running the binary runs all
the benchmarks from sweep_pgm_dispatch.sh. The set of tests to be run can be
filtered using the `--benchmark_filter=<regex>` command-line argument.

One-off test cases can be run by passing `--custom` and the command line arguments as before.
@jbaumanTT jbaumanTT force-pushed the jbauman/googlebenchmark2 branch from c1c334e to a754edf Compare January 9, 2025 19:24
jbaumanTT added a commit that referenced this pull request Jan 9, 2025
The current output format works well with a smaller number of tests, but with a
large number of tests it's hard to connect the resulting number to the test
that created it. This particular hinders storing test results in a database and
comparing them across runs.

Switch to using the google benchmark framework, which outputs a JSON file
containing the results of all tests. By default, running the binary runs all
the benchmarks from sweep_pgm_dispatch.sh. The set of tests to be run can be
filtered using the `--benchmark_filter=<regex>` command-line argument.

One-off test cases can be run by passing `--custom` and the command line arguments as before.
@jbaumanTT jbaumanTT force-pushed the jbauman/googlebenchmark2 branch from a754edf to 99a4fc7 Compare January 9, 2025 19:29
@jbaumanTT
Copy link
Contributor Author

I use filt_pgm_dispatch for the bw_and_latency test as well, so don't delete that. I still want to dump these results to a spreadsheet, what does that flow look like? Otherwise looks good

Ok, added back filt_pgm_dispatch.pl. I've added a new json_to_csv.py that can be used to dump to a CSV (one line per test). The workflow is to run

build/test/tt_metal/perf_microbenchmark/dispatch/test_pgm_dispatch --benchmark_out_format=json --benchmark_out=bench.json
tests/tt_metal/tt_metal/perf_microbenchmark/dispatch/json_to_csv.py bench.json > bench.csv

google benchmark framework also has a native way to output CSVs, but it's deprecated and requires some extra work.

This patch also uploads the json file from the CI bots, so it's pretty easy to download that and convert it.

jbaumanTT added a commit that referenced this pull request Jan 10, 2025
The current output format works well with a smaller number of tests, but with a
large number of tests it's hard to connect the resulting number to the test
that created it. This particular hinders storing test results in a database and
comparing them across runs.

Switch to using the google benchmark framework, which outputs a JSON file
containing the results of all tests. By default, running the binary runs all
the benchmarks from sweep_pgm_dispatch.sh. The set of tests to be run can be
filtered using the `--benchmark_filter=<regex>` command-line argument.

One-off test cases can be run by passing `--custom` and the command line arguments as before.
@jbaumanTT jbaumanTT force-pushed the jbauman/googlebenchmark2 branch from 99a4fc7 to 61c15a4 Compare January 10, 2025 17:40
jbaumanTT added a commit that referenced this pull request Jan 10, 2025
The current output format works well with a smaller number of tests, but with a
large number of tests it's hard to connect the resulting number to the test
that created it. This particular hinders storing test results in a database and
comparing them across runs.

Switch to using the google benchmark framework, which outputs a JSON file
containing the results of all tests. By default, running the binary runs all
the benchmarks from sweep_pgm_dispatch.sh. The set of tests to be run can be
filtered using the `--benchmark_filter=<regex>` command-line argument.

One-off test cases can be run by passing `--custom` and the command line arguments as before.
@jbaumanTT jbaumanTT force-pushed the jbauman/googlebenchmark2 branch from 61c15a4 to 36ae490 Compare January 10, 2025 18:04
@tt-rkim
Copy link
Collaborator

tt-rkim commented Jan 14, 2025

@TT-billteng LOOK SEE LOOK SEE
GOOGLE BENCHMARK!!!

The current output format works well with a smaller number of tests, but with a
large number of tests it's hard to connect the resulting number to the test
that created it. This particular hinders storing test results in a database and
comparing them across runs.

Switch to using the google benchmark framework, which outputs a JSON file
containing the results of all tests. By default, running the binary runs all
the benchmarks from sweep_pgm_dispatch.sh. The set of tests to be run can be
filtered using the `--benchmark_filter=<regex>` command-line argument.

One-off test cases can be run by passing `--custom` and the command line arguments as before.
@jbaumanTT jbaumanTT force-pushed the jbauman/googlebenchmark2 branch from 36ae490 to 0c88372 Compare January 14, 2025 16:34
@jbaumanTT jbaumanTT merged commit 5017de3 into main Jan 15, 2025
13 checks passed
@jbaumanTT jbaumanTT deleted the jbauman/googlebenchmark2 branch January 15, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants