Skip to content

bugfix: Fix compile error for undefined swizzle enum.#1530

Merged
yzh119 merged 1 commit intoflashinfer-ai:mainfrom
weireweire:trtllm-support-8-8-16
Aug 21, 2025
Merged

bugfix: Fix compile error for undefined swizzle enum.#1530
yzh119 merged 1 commit intoflashinfer-ai:mainfrom
weireweire:trtllm-support-8-8-16

Conversation

@weireweire
Copy link
Copy Markdown
Collaborator

@weireweire weireweire commented Aug 21, 2025

📌 Description

This is a quick fix. we'll refactor to avoid duplicated enum latter.

🔍 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

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.

Summary of Changes

Hello @weireweire, 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 compile error by updating references to a QuantizationSFLayout enum member. Specifically, it replaces the undefined SWIZZLED_128x4 enum value with the correct SWIZZLED value across several CUDA and C++ source files. This ensures the codebase compiles successfully and maintains the intended swizzled layout for quantization scaling factors.

Highlights

  • Compile Error Fix: Resolved a compilation error by replacing the undefined QuantizationSFLayout::SWIZZLED_128x4 enum member with QuantizationSFLayout::SWIZZLED.
  • Enum Usage Update: Updated the usage of QuantizationSFLayout enum across various CUDA and C++ files to use the correct SWIZZLED value for quantization scaling factor layouts.
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. 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
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 addresses a compilation error by renaming QuantizationSFLayout::SWIZZLED_128x4 to QuantizationSFLayout::SWIZZLED across several files. The changes are consistent with the goal of fixing the undefined enum member and appear correct.

As you noted that a future refactoring is planned to avoid duplicated enums, I'd like to point out a potential inconsistency in csrc/nv_internal/tensorrt_llm/thop/fp8Quantize.h. While the comments in this file were updated, the computeSFIndex function still refers to tensorrt_llm::QuantizationSFLayout::SWIZZLED_128x4. This might be an oversight that could be addressed in the upcoming refactoring to ensure all parts of the codebase use the unified enum.

@yzh119 yzh119 changed the title Fix compile error for undefined swizzle enum. bugfix: Fix compile error for undefined swizzle enum. Aug 21, 2025
@yzh119 yzh119 enabled auto-merge (squash) August 21, 2025 06:24
@nvpohanh
Copy link
Copy Markdown
Contributor

Maybe prefer https://github.com/flashinfer-ai/flashinfer/pull/1531/files if that works.

@weireweire
Copy link
Copy Markdown
Collaborator Author

@yzh119 seems the CI is stuck.

@yzh119 yzh119 disabled auto-merge August 21, 2025 15:48
@yzh119 yzh119 merged commit cfcda9b into flashinfer-ai:main Aug 21, 2025
1 of 2 checks passed
yzh119 added a commit that referenced this pull request Aug 21, 2025
<!-- .github/pull_request_template.md -->

## 📌 Description

Currently comm modules and moe modules are not compiled in aot
unittests, which results in lots of issues such as #1371 #1410, and
#1530.
This PR adds these modules to aot UT to make sure we capture the
potential compilation error of these modules.

#1531 (a bugfix) changes were ported into this PR to test together.

## 🔍 Related Issues

#1371, #1410, #1530, #1531

## 🚀 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

- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [x] I have installed the hooks with `pre-commit install`.
- [x] 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](https://pre-commit.com/).

## 🧪 Tests

- [x] Tests have been added or updated as needed.
- [ ] All tests are passing (`unittest`, etc.).

## Reviewer Notes

cc @nvpohanh @weireweire

---------

Co-authored-by: Yaxing Cai <yaxingc@nvidia.com>
Co-authored-by: Zihao <zihaoy@nvidia.com>
Co-authored-by: Zihao Ye <expye@outlook.com>
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.

4 participants