Fix "FP4QuantizationSFLayout has no member SWIZZLED_128x4" error#1403
Fix "FP4QuantizationSFLayout has no member SWIZZLED_128x4" error#1403mgoin wants to merge 1 commit intoflashinfer-ai:mainfrom
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @mgoin, 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 a compilation error related to the FP4QuantizationSFLayout enum. It introduces an alias for an existing enum member to ensure compatibility and prevent build failures. This is a targeted fix to resolve a specific symbol lookup issue within the codebase.
Highlights
- Enum definition fix: Added SWIZZLED_128x4 = SWIZZLED to the FP4QuantizationSFLayout enum in
include/flashinfer/comm/trtllm_moe_allreduce_fusion.cuh. This resolves a compilation error whereSWIZZLED_128x4was not recognized.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 or fill out our survey to provide feedback.
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
-
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. ↩
There was a problem hiding this comment.
Code Review
This pull request addresses a compilation error by introducing SWIZZLED_128x4 to the FP4QuantizationSFLayout enum, aliasing it to the existing SWIZZLED member. The fix is correct and effectively resolves the build issue. My review includes a suggestion to enhance code clarity by making the more descriptive SWIZZLED_128x4 the primary enum member and SWIZZLED the alias, which would improve long-term maintainability.
| SWIZZLED, | ||
| SWIZZLED_128x4 = SWIZZLED, |
There was a problem hiding this comment.
For better clarity and long-term maintainability, it would be preferable to define the more descriptive name SWIZZLED_128x4 first, and then alias SWIZZLED to it. This makes it clear that SWIZZLED_128x4 is the primary name for this layout, which is helpful given the comments describing the 128x4 layout.
SWIZZLED_128x4,
SWIZZLED = SWIZZLED_128x4,
|
@yzh119 could you review and merge? Thanks |
|
Where did you see this compilation error? For more context, If you encounter an compilation error, this means some other files mistakenly depend on |
|
I am also running into the same issue when enabling AR+RMSNorm fusions in vLLM with H200x2. |
|
@yzh119 It is caused by this line: https://github.com/flashinfer-ai/flashinfer/blob/main/csrc/trtllm_moe_allreduce_fusion.cu#L66 I think it is correct that this file depends on |
|
Move to #1410 instead, we should unify these classes in later PRs. |
This includes the fix needed for FlashInfer AOT compilation failures. See: flashinfer-ai/flashinfer#1403 and flashinfer-ai/flashinfer#1410 Signed-off-by: Po-Han Huang <pohanh@nvidia.com>
📌 Description
This seems like a missed change in #1389 in renaming SWIZZLED to SWIZZLED_128x4
🔍 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
pre-commitby runningpip install pre-commit(or used your preferred method).pre-commit install.pre-commit run --all-filesand fixed any reported issues.🧪 Tests
unittest, etc.).Reviewer Notes