Conversation
Replace calls to `_get_sp_group_from_device_mesh` with direct access to `sequence_parallel._sp_group` in sequence parallel attention tests. This simplifies the test setup by using the already initialized group stored in the module, improving code clarity and reducing redundancy.
Add additional imports and a try-except block to verify that the 'kernels-test/flattened-build' kernel can be successfully loaded in the current environment before proceeding with the test. This prevents test failures due to environment-specific loading issues and provides a more informative skip message.
Summary of ChangesHello @meichangsu1, 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 improves the robustness of a kernel-related unit test by adding a preliminary check for kernel loadability. This ensures that the test only runs when its dependencies are met, preventing environment-specific failures and making the test suite more reliable. Highlights
🧠 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. Changelog
Activity
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 improves the robustness of the test_flattened_build_replaces_function test by adding a pre-flight check to ensure the test kernel can be loaded. This is a good change. I've added one suggestion to improve the maintainability of the test code by reducing the repetition of a magic string.
| try: | ||
| revision = select_revision_or_version( | ||
| 'kernels-test/flattened-build', | ||
| revision=None, | ||
| version=None, | ||
| ) | ||
| get_kernel('kernels-test/flattened-build', revision=revision) | ||
| except Exception as exc: | ||
| self.skipTest(f'kernels-test/flattened-build cannot be loaded in this env: {exc}') |
There was a problem hiding this comment.
The repository ID 'kernels-test/flattened-build' is repeated here and elsewhere in this test method (e.g., lines 61, 88). To improve maintainability and reduce the chance of typos, consider defining this string as a constant at the beginning of the method and reusing it.
For example:
repo_id = 'kernels-test/flattened-build'
# ... then use repo_id in has_kernel, select_revision_or_version, get_kernel, etc.
No description provided.