Skip to content

Support: add per-example case config and trimmed mean to benchmark_rounds#319

Merged
poursoul merged 1 commit intohw-native-sys:mainfrom
hw-native-sys-bot:benchmark-rounds-multi-case-trimmed-mean-v2
Mar 18, 2026
Merged

Support: add per-example case config and trimmed mean to benchmark_rounds#319
poursoul merged 1 commit intohw-native-sys:mainfrom
hw-native-sys-bot:benchmark-rounds-multi-case-trimmed-mean-v2

Conversation

@hw-native-sys-bot
Copy link
Collaborator

@hw-native-sys-bot hw-native-sys-bot commented Mar 18, 2026

Summary

  • Replace flat EXAMPLES array with declare -A EXAMPLE_CASES map pairing each example with comma-separated case names; empty value = run DEFAULT_CASE
  • Add EXAMPLE_ORDER array to control benchmark execution order
  • Add trimmed mean statistic (excluding min and max values) alongside existing average in timing output
  • Extract run+parse logic into run_bench() function with trap-based temp file cleanup
  • Unify alternating_matmul_add case names to PascalCase (Case1, Case2)

Test plan

  • Run ./tools/benchmark_rounds.sh without changes — verify default behavior unchanged
  • Edit EXAMPLE_CASES to add cases — verify per-case output with ---- CaseX ---- headers
  • Verify trimmed mean output appears when rounds > 2
  • Verify trimmed mean is absent when rounds <= 2

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 enhances the benchmark_rounds.sh script by introducing more flexible and robust benchmarking capabilities. It allows for granular control over which cases are run for each example, defines a clear execution order, and provides a more statistically sound timing metric with the addition of a trimmed mean. These changes streamline the benchmarking process and improve the reliability of performance measurements.

Highlights

  • Per-Example Case Configuration: Introduced a new EXAMPLE_CASES map in benchmark_rounds.sh to allow per-example configuration of benchmark cases, replacing the previous flat EXAMPLES array.
  • Benchmark Execution Order Control: Added an EXAMPLE_ORDER array to explicitly define the execution sequence of benchmarks.
  • Trimmed Mean Statistic: Implemented a trimmed mean statistic in the benchmark output, excluding the minimum and maximum values, which is displayed when more than two rounds are executed.
  • Refactored Benchmark Logic: Refactored the benchmark execution and log parsing logic into a dedicated run_bench() shell function, improving modularity and ensuring temporary file cleanup.
  • Standardized Case Names: Standardized case names in alternating_matmul_add/golden.py to PascalCase (e.g., Case1, Case2) for consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 introduces significant improvements to the benchmark script, including per-example case configuration, a new trimmed mean statistic, and a major refactoring that extracts logic into a run_bench function. These changes enhance the script's flexibility and maintainability. The implementation is solid, and I have one suggestion to simplify a conditional statement for better readability.

@hw-native-sys-bot hw-native-sys-bot force-pushed the benchmark-rounds-multi-case-trimmed-mean-v2 branch from 0e4fd92 to 7413db7 Compare March 18, 2026 03:59
…unds

- Replace flat EXAMPLES array with declare -A EXAMPLE_CASES map pairing
  each example with comma-separated case names; empty = run DEFAULT_CASE
- Add EXAMPLE_ORDER array to control execution order
- Add trimmed mean statistic (excluding min/max) alongside existing avg
- Extract run+parse logic into run_bench() with trap-based temp cleanup
- Simplify empty case_list check by testing string directly
- Unify alternating_matmul_add case names to PascalCase (Case1, Case2)
@hw-native-sys-bot hw-native-sys-bot force-pushed the benchmark-rounds-multi-case-trimmed-mean-v2 branch from 7413db7 to 6daea51 Compare March 18, 2026 04:44
@poursoul poursoul merged commit d3dec98 into hw-native-sys:main Mar 18, 2026
5 checks passed
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