Skip to content

fix: add missing re-exports for rmsnorm quant and fused_add_rmsnorm q…#2783

Merged
bkryu merged 1 commit intoflashinfer-ai:mainfrom
DevashishLal-CB:dev/dlal/norm-quant-import-fix
Mar 20, 2026
Merged

fix: add missing re-exports for rmsnorm quant and fused_add_rmsnorm q…#2783
bkryu merged 1 commit intoflashinfer-ai:mainfrom
DevashishLal-CB:dev/dlal/norm-quant-import-fix

Conversation

@DevashishLal-CB
Copy link
Contributor

@DevashishLal-CB DevashishLal-CB commented Mar 14, 2026

add missing re-exports for rmsnorm quant and fused_add_rmsnorm quant

📌 Description

added missing imports in the top level flashinfer/__init__.py file

  • rmsnorm_quant
  • fused_add_rmsnorm_quant

🔍 Related Issues

🚀 Pull Request Checklist

Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.

✅ Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit (or used your preferred method).
  • I have installed the hooks with pre-commit install.
  • I have run the hooks manually with pre-commit run --all-files and fixed any reported issues.

If you are unsure about how to set up pre-commit, see the pre-commit documentation.

🧪 Tests

  • Tests have been added or updated as needed.
  • All tests are passing (unittest, etc.).

Reviewer Notes

Summary by CodeRabbit

  • New Features
    • Two additional normalization quantization functions are now publicly available from the flashinfer package API.

…uant

Signed-off-by: Devashish Lal <devcode@fb.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 addresses an oversight by exposing two new quantization-aware normalization functions, rmsnorm_quant and fused_add_rmsnorm_quant, at the package's top level. This change improves usability by allowing developers to directly import and utilize these functions without needing to navigate deeper into the package structure, thereby streamlining access to critical quantization utilities.

Highlights

  • Missing Re-exports: Added rmsnorm_quant and fused_add_rmsnorm_quant to the top-level flashinfer/__init__.py file, making these quantization-related normalization functions directly accessible.

🧠 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
  • flashinfer/init.py
    • Added import for fused_add_rmsnorm_quant from .norm.
    • Added import for rmsnorm_quant from .norm.
Activity
  • Pre-commit checks were successfully run.
  • Tests were added/updated and are passing.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 950f538a-6bfa-4af6-8869-a581ba969b29

📥 Commits

Reviewing files that changed from the base of the PR and between f6ec0d8 and 52959e4.

📒 Files selected for processing (1)
  • flashinfer/__init__.py

📝 Walkthrough

Walkthrough

The pull request adds two new public exports to the flashinfer package namespace: fused_add_rmsnorm_quant and rmsnorm_quant, imported from the .norm module. These functions are now accessible directly from the top-level flashinfer module.

Changes

Cohort / File(s) Summary
Package Exports
flashinfer/__init__.py
Added two new public exports: fused_add_rmsnorm_quant and rmsnorm_quant from .norm module, making these quantization-related norm functions accessible at the package level.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • yzh119
  • bkryu
  • kahyunnam
  • jimmyzho

Poem

🐰 Two functions hop to the surface bright,
From hidden depths into the light,
Quantization norms now front and center,
Public exports boldly enter! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding missing re-exports for rmsnorm quant functions to the package namespace.
Description check ✅ Passed The description follows the template structure with a clear Description section explaining the changes, though Related Issues section was left empty and test details are not provided.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

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 correctly adds missing re-exports for rmsnorm_quant and fused_add_rmsnorm_quant in the top-level __init__.py file. My feedback focuses on improving the code style of the import statements for better readability and maintainability by sorting them and removing redundant aliases, following PEP 8 guidelines.

Comment on lines 109 to +115
from .norm import fused_add_rmsnorm as fused_add_rmsnorm
from .norm import fused_add_rmsnorm_quant as fused_add_rmsnorm_quant
from .norm import layernorm as layernorm
from .norm import gemma_fused_add_rmsnorm as gemma_fused_add_rmsnorm
from .norm import gemma_rmsnorm as gemma_rmsnorm
from .norm import rmsnorm as rmsnorm
from .norm import rmsnorm_quant as rmsnorm_quant
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better code readability and consistency, it's a good practice to sort imports alphabetically and remove redundant aliases (e.g., import foo as foo). This block of imports from .norm could be reordered and cleaned up to follow PEP 8 guidelines.

Suggested change
from .norm import fused_add_rmsnorm as fused_add_rmsnorm
from .norm import fused_add_rmsnorm_quant as fused_add_rmsnorm_quant
from .norm import layernorm as layernorm
from .norm import gemma_fused_add_rmsnorm as gemma_fused_add_rmsnorm
from .norm import gemma_rmsnorm as gemma_rmsnorm
from .norm import rmsnorm as rmsnorm
from .norm import rmsnorm_quant as rmsnorm_quant
from .norm import fused_add_rmsnorm
from .norm import fused_add_rmsnorm_quant
from .norm import gemma_fused_add_rmsnorm
from .norm import gemma_rmsnorm
from .norm import layernorm
from .norm import rmsnorm
from .norm import rmsnorm_quant
References
  1. PEP 8 recommends that imports are grouped and sorted. Within each group, imports should be sorted alphabetically. (link)

@DevashishLal-CB
Copy link
Contributor Author

@bkryu can I get a review for this

@bkryu bkryu added the run-ci label Mar 19, 2026
@bkryu
Copy link
Collaborator

bkryu commented Mar 19, 2026

/bot run

@flashinfer-bot
Copy link
Collaborator

GitLab MR !435 has been created, and the CI pipeline #46561948 is currently running. I'll report back once the pipeline job completes.

@flashinfer-bot
Copy link
Collaborator

[FAILED] Pipeline #46561948: 14/20 passed

@bkryu bkryu merged commit af1e02d into flashinfer-ai:main Mar 20, 2026
29 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants