[Perf] Eenhance profiling output and add performance metrics#3
[Perf] Eenhance profiling output and add performance metrics#3ConvolutedDog merged 5 commits intomainfrom
Conversation
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
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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]
--gen-check-code