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

Improve error visibility when printing metrics #234

Merged
merged 6 commits into from
Jan 2, 2025

Conversation

dyastremsky
Copy link
Contributor

@dyastremsky dyastremsky commented Dec 30, 2024

When a metric error happens, it can be hard to debug whether something went wrong with the server, perf analyzer, or GenAI-Perf (e.g. edge condition, bug). These errors have been reported for different situations, and debugging them has been opaque.

This pull request catches common errors when accessing the statistics dictionary and logs them as errors. This allows the output to still be printed (with N/A) to not lose the data already gathered/processed but also alerts the user what the specific issue is.

Example screenshot with fake "p10" statistic added to trigger error.
image

@dyastremsky dyastremsky self-assigned this Dec 30, 2024
@dyastremsky dyastremsky changed the base branch from main to dyas-cleanup December 30, 2024 19:17
@@ -508,6 +508,7 @@ when `--output-tokens-mean` is provided. (default: `0`)
The seed used to generate random values. (default: `0`)

##### `--request-count <int>`
##### `--num-requests <int>`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added aliases. While PA uses request-count, all other GAP args that use counts start with --num (most notably, --num-prompts).

We can decide for GA what arg name to use (if only one), but having this consistency would make it less confusing to be adding args. I often would type out the wrong one, so I imagine some users might too.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was the previous name right?
An alias is fine, just having deja vu here.

Update function descriptions

Remove unnecessary fix

Remove print
@dyastremsky dyastremsky force-pushed the dyas-error-visibility branch from bee6022 to 74da9a5 Compare December 30, 2024 19:32
Base automatically changed from dyas-cleanup to main December 31, 2024 17:40
from rich.console import Console
from rich.table import Table

from . import exporter_utils
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switching to relative imports for conciseness. This will also make any future refactors easier, so that we don't need to update the path if files are reorganized.

"│ Output token throughput (per sec) │ 456… │ N/A │ N/A │ N/A │ N/A │ N/A │\n"
"│ Request throughput (per sec) │ 123… │ N/A │ N/A │ N/A │ N/A │ N/A │\n"
"│ Request count (count) │ 3.00 │ N/A │ N/A │ N/A │ N/A │ N/A │\n"
"│ Time To First Token (ms) │ 8.00 │ 7.00 │ 9.00 │ 8.98 │ 8.80 │ 8.50 │\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CSV and console exporters format the headers differently. When refactoring the formatting to a common utils class, I kept the title-style formatting.

@@ -508,6 +508,7 @@ when `--output-tokens-mean` is provided. (default: `0`)
The seed used to generate random values. (default: `0`)

##### `--request-count <int>`
##### `--num-requests <int>`
Copy link
Contributor

Choose a reason for hiding this comment

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

This was the previous name right?
An alias is fine, just having deja vu here.

@debermudez
Copy link
Contributor

Nice work on this!

@dyastremsky
Copy link
Contributor Author

This was the previous name right?
An alias is fine, just having deja vu here.

@debermudez Not as far as I know. I wasn't involved in the initial request count work, so it's possible that was the case. This does seem like the more consistent name on the GenAI-Perf name, though I know we try to reuse the PA flag names in GenAI-Perf.

@dyastremsky dyastremsky merged commit 8205e12 into main Jan 2, 2025
7 checks passed
@dyastremsky dyastremsky deleted the dyas-error-visibility branch January 2, 2025 21:34
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.

2 participants