Skip to content

[Perf] Eenhance profiling output and add performance metrics#3

Merged
ConvolutedDog merged 5 commits intomainfrom
dev
Sep 29, 2025
Merged

[Perf] Eenhance profiling output and add performance metrics#3
ConvolutedDog merged 5 commits intomainfrom
dev

Conversation

@ConvolutedDog
Copy link
Copy Markdown
Owner

  • Add conditional compilation for verification code via --gen-check-code
  • Improve nvprof output parsing for different compute capabilities
  • Add TFLOPS calculation in performance reports
  • Enhance console output with formatted banners and progress indicators
  • Maintain multi-process evaluation support in test_op_mp.py

ConvolutedDog and others added 4 commits September 29, 2025 18:05
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Add conditional compilation for verification code via `--gen-check-code`
- Improve nvprof output parsing for different compute capabilities
- Add TFLOPS calculation in performance reports
- Enhance console output with formatted banners and progress indicators
- Maintain multi-process evaluation support in test_op_mp.py
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ConvolutedDog, 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 upgrades the profiling and performance reporting infrastructure. The changes enable more flexible and accurate performance analysis by allowing conditional compilation of verification code, adapting nvprof output parsing to diverse GPU architectures, and introducing TFLOPS as a key performance metric. Additionally, the console output has been refined with visually distinct banners, making the profiling process more user-friendly and informative, all while preserving the integrity of multi-process evaluation.

Highlights

  • Conditional Verification Code: Introduced a --gen-check-code flag to conditionally compile verification code, allowing for cleaner production builds and focused profiling.
  • Improved nvprof Parsing: Enhanced the parsing of nvprof output to correctly interpret profiling data across different NVIDIA GPU compute capabilities (e.g., >= 8.0 vs. older), ensuring accurate performance insights.
  • TFLOPS Calculation: Added the calculation and display of TFLOPS (Tera Floating-point Operations Per Second) in performance reports, providing a standardized and easily comparable metric for performance evaluation.
  • Enhanced Console Output: Implemented a new printBanner utility to significantly improve the readability of console output with formatted banners and progress indicators, making the profiling process more user-friendly.
  • Multi-process Compatibility: Ensured that all new features and enhancements maintain full compatibility with existing multi-process evaluation workflows, preserving current testing capabilities.
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.

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

  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
Copy Markdown
Contributor

@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 several valuable performance profiling and reporting enhancements. The conditional compilation for verification code is a good addition, and the improved output formatting enhances usability. However, I've identified a few critical bugs in the profiling output parsing and TFLOPS calculations that need to be addressed. Additionally, there is significant code duplication between test_op.py and test_op_mp.py. Consider refactoring common functions like main_template, get_pad, and get_tvm_source into a shared utility module to improve maintainability.

There's a critical bug in this conditional statement due to incorrect parenthesization. The expression "main_kernel" in lines[l] is evaluated first, and its boolean result is used in the ternary expression. When not LatestTVM is true, the condition becomes if "default_function_kernel0":, which is always true because a non-empty string is truthy. This will cause the loop to break prematurely on the first line.

The correct logic should be if ("default_function_kernel0" if not LatestTVM else "main_kernel") in lines[l]
@ConvolutedDog ConvolutedDog merged commit 2a25910 into main Sep 29, 2025
1 check failed
@ConvolutedDog ConvolutedDog deleted the dev branch September 29, 2025 10:22
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.

1 participant