-
Notifications
You must be signed in to change notification settings - Fork 501
Adding help flag to benchmark script #1302
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
Adding help flag to benchmark script #1302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @happyandslow, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly improves the command-line interface (CLI) of the benchmark.py script by enabling a standard help flag and providing more comprehensive and readable documentation for its arguments. This makes the script's usage more intuitive and discoverable for anyone running benchmarks.
Highlights
- CLI Usability: The
benchmark.pyscript now supports the standard--helpflag, allowing users to easily view available command-line arguments and their descriptions directly from the terminal. - Improved Argument Documentation: The help message for the
--stageargument has been enhanced to provide a more detailed and clearly formatted list of all available benchmark stages (all,dataset,workload,client,analysis), improving clarity for users.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request improves the help message for the benchmark script, making it more user-friendly. My review includes a suggestion to further enhance the argument parsing by using argparse's built-in choices parameter for the --stage argument. This will add automatic validation and make the script more robust.
| parser = argparse.ArgumentParser(description="Run benchmark pipeline") | ||
| parser.add_argument("--stage", required=True, help="One of the stages [all, dataset, workload, client, analysis]") | ||
| parser = argparse.ArgumentParser(description="Run benchmark pipeline", add_help=True, formatter_class=argparse.RawTextHelpFormatter) | ||
| parser.add_argument("--stage", required=True, help="Specify the benchmark stage to run. Possible stages:\n- all: Run all stages (dataset, workload, client, analysis)\n- dataset: Generate the dataset\n- workload: Generate the workload\n- client: Run the client to dispatch workload\n- analysis: Analyze the trace output") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the detailed help message is a great improvement, you can make this more robust by using the choices parameter in add_argument.
This will provide automatic validation for the --stage argument, ensuring only valid stages are accepted. argparse will also generate a helpful error message if an invalid choice is provided.
This makes the manual validation in the run method (lines 278-281) redundant.
Using choices would also prevent passing an empty string ("") as a stage, which is currently an undocumented alias for all.
| parser.add_argument("--stage", required=True, help="Specify the benchmark stage to run. Possible stages:\n- all: Run all stages (dataset, workload, client, analysis)\n- dataset: Generate the dataset\n- workload: Generate the workload\n- client: Run the client to dispatch workload\n- analysis: Analyze the trace output") | |
| parser.add_argument("--stage", required=True, choices=['all', 'dataset', 'workload', 'client', 'analysis'], help="Specify the benchmark stage to run. Possible stages:\n- all: Run all stages (dataset, workload, client, analysis)\n- dataset: Generate the dataset\n- workload: Generate the workload\n- client: Run the client to dispatch workload\n- analysis: Analyze the trace output") |
Signed-off-by: Le Xu <[email protected]>
Signed-off-by: Le Xu <[email protected]>
3f465bc to
afe4694
Compare
* adding help flag to benchmark script --------- Signed-off-by: Le Xu <[email protected]> Co-authored-by: Le Xu <[email protected]>
* adding help flag to benchmark script --------- Signed-off-by: Le Xu <[email protected]> Co-authored-by: Le Xu <[email protected]>
Pull Request Description
This PR adds help message to benchmark script.