Skip to content

Conversation

@zhiyuan1i
Copy link
Collaborator

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lzy/fla-cache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zhiyuan1i zhiyuan1i linked an issue Dec 30, 2025 that may be closed by this pull request
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @zhiyuan1i, 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 implements a comprehensive caching system for Triton autotune configurations, aiming to optimize kernel performance by reducing the need for repeated autotuning. It introduces a custom autotuner that prioritizes loading pre-saved optimal settings, alongside a utility script for extracting and managing these configurations. The changes also enhance system flexibility through new environment variables, allowing users to customize cache directories and control caching behavior.

Highlights

  • Triton Autotune Caching Mechanism: Introduced a CachedAutotuner class that extends Triton's Autotuner. This new class attempts to load pre-computed best configurations for kernels from a custom directory (fla/configs/{GPU}/) before falling back to Triton's default autotuning process, significantly speeding up kernel initialization.
  • New Environment Variables for Cache Control: Added several environment variables to provide fine-grained control over the caching behavior: FLA_CONFIG_DIR to override the config directory, FLA_DISABLE_CACHE to force autotuning, FLA_GPU_NAME to override GPU detection, and TRITON_CACHE_DIR to customize Triton's cache location.
  • Configuration Extraction Script: A new script (scripts/demo_extract_configs.py) was added to extract best configurations from Triton's autotune cache and save them to the custom fla/configs/{GPU}/ directory. This script also includes logic to synchronize configurations across Hopper architecture GPUs (H100, H800, H20) due to their shared optimal settings.
  • Documentation Update: The ENVs.md file has been updated to document the newly introduced environment variables, ensuring users are aware of the new configuration options.

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

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
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 a valuable caching mechanism for Triton autotune configurations, which will improve performance by avoiding redundant tuning. The implementation is well-structured, including the core caching logic, a utility script for extracting configurations, and updated documentation. My review focuses on enhancing GPU support, ensuring configuration consistency, and improving the maintainability of the provided script.

Comment on lines +390 to +399
# Check if we should extract to fla/configs
if "--extract-to-fla-configs" in sys.argv:
# Generate cache with temporary directory
triton_cache_dir = Path(generate_triton_cache())

# Compute output directory in fla/configs (relative to project root)
project_dir = Path(__file__).parent.parent
gpu_name = get_gpu_info()
output_dir = project_dir / "fla" / "configs" / gpu_name
output_dir.mkdir(parents=True, exist_ok=True)

print(f"\nExtracting configs to: {output_dir}")
extract_configs(triton_cache_dir, output_dir)
else:
main()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Handling command-line arguments by checking sys.argv directly is less robust and clear than using argparse. Consider adding --extract-to-fla-configs as a boolean flag to your ArgumentParser and moving the logic into the main function. This would improve maintainability and provide a consistent command-line interface.

@zhiyuan1i zhiyuan1i force-pushed the main branch 3 times, most recently from 2b3db51 to 53dda79 Compare January 22, 2026 07:04
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.

[RFC] FLA Config Cache

1 participant