Skip to content

Dev#2

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

Dev#2
ConvolutedDog merged 3 commits intomainfrom
dev

Conversation

@ConvolutedDog
Copy link
Copy Markdown
Owner

No description provided.

ConvolutedDog and others added 3 commits September 28, 2025 21:15
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>
@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 primarily focuses on code hygiene and improving the debugging experience within the project. It removes a significant amount of conditional debug print statements and commented-out code, leading to a cleaner and more maintainable CodeGeneratorR class. Additionally, it enhances the testing utilities by introducing new verbose flags, allowing developers to selectively view detailed CUDA code and IR module outputs during test runs, and adjusts default test behavior for result checking.

Highlights

  • Debug Code Removal: Eliminated numerous DEBUG flags and associated print statements across codegen/op_impl/codegenR.py, streamlining the codebase.
  • Enhanced Testing Verbosity: Introduced new command-line arguments (--verbose_cuda_code, --verbose_irmodule) in test_op.py and test_op_mp.py to provide more detailed output during testing and debugging.
  • Output Clarity Improvements: Capitalized and refined several print statements in policy/ConstructionPolicyRT.py, test_op.py, and test_op_mp.py for better readability.
  • Default Argument Change: Modified the default value of --gen_check_code from True to False in test scripts, potentially altering the default behavior of result checking code generation.
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.

@ConvolutedDog ConvolutedDog merged commit 882c3ed into main Sep 29, 2025
1 of 2 checks passed
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 focuses on cleaning up the codebase by removing a significant amount of debugging code, such as print statements and commented-out blocks. It also introduces verbosity flags (--verbose_cuda_code, --verbose_irmodule) to control debug output in test scripts, and improves the formatting of some log messages.

My review identifies a few areas for improvement:

  • A potentially important warning in op/Op.py has been commented out. It would be good to clarify the reason for this change.
  • There are some inconsistencies in the test scripts (test_op.py and test_op_mp.py) regarding the use of the new verbosity flags and string formatting for print statements. Aligning these would improve code maintainability.

Overall, the changes are positive and improve the cleanliness of the code. Addressing the points above will further enhance consistency and ensure no important warnings are missed.

Comment on lines +39 to +43
# if len(self.unpad_outs) > 0:
# import warnings
# warnings.warn(
# "The unpad_outs length > 0, please check here."
# )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This warning is being commented out. If the condition len(self.unpad_outs) > 0 indicates a potential issue that developers should be aware of, it might be better to keep this warning. Could you provide some context on why this is being removed? If it's for temporary debugging, it might be better to use a more structured logging approach or a debug flag.

Comment on lines +595 to +599
print("Eval top {} configs".format(topx))
print("Compilation time: {}s".format(eval_results["compilation time"]))
print("Best time: {}ms".format(eval_results["best time"]))
print("Best config: {}".format(eval_results["best config"]))
print("Best idx: {}".format(eval_results["best idx"]))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with other changes in this file (e.g., line 491) and for better readability, consider using f-strings for these print statements.

Suggested change
print("Eval top {} configs".format(topx))
print("Compilation time: {}s".format(eval_results["compilation time"]))
print("Best time: {}ms".format(eval_results["best time"]))
print("Best config: {}".format(eval_results["best config"]))
print("Best idx: {}".format(eval_results["best idx"]))
print(f"Eval top {topx} configs")
print(f"Compilation time: {eval_results['compilation time']}s")
print(f"Best time: {eval_results['best time']}ms")
print(f"Best config: {eval_results['best config']}")
print(f"Best idx: {eval_results['best idx']}")

@@ -406,8 +411,6 @@ def get_tvm_source(
codegen_input_reg_tiling=args.codegen_input_reg_tiling,
)
if LatestTVM:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The verbose_irmodule argument was added but is not used here to conditionally print the module, which is inconsistent with the changes in test_op.py. Consider adding a check for args.verbose_irmodule inside this block:

if args.verbose_irmodule:
    print(s.mod)

Comment on lines +653 to +658
print("Top1 time: {} ms".format(top1_time))
print("Top10 time: {} ms".format(best_time))
print("Best idx: {}".format(best_idx))
print("Best config: {}".format(rprogs[best_idx].Dump()))
print("Top1 compile time: {} s".format(emit_time))
print("Top10 compile time: {} s".format(eval_time))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency and better readability, consider using f-strings for these print statements.

Suggested change
print("Top1 time: {} ms".format(top1_time))
print("Top10 time: {} ms".format(best_time))
print("Best idx: {}".format(best_idx))
print("Best config: {}".format(rprogs[best_idx].Dump()))
print("Top1 compile time: {} s".format(emit_time))
print("Top10 compile time: {} s".format(eval_time))
print(f"Top1 time: {top1_time} ms")
print(f"Top10 time: {best_time} ms")
print(f"Best idx: {best_idx}")
print(f"Best config: {rprogs[best_idx].Dump()}")
print(f"Top1 compile time: {emit_time} s")
print(f"Top10 compile time: {eval_time} s")

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