-
Notifications
You must be signed in to change notification settings - Fork 539
fix: Remove CHECK_CONTIGUOUS for SFA/SFB #1963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @yongwww, 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 fix for a regression affecting vLLM and SGLang when using FlashInfer 0.4.0 in Highlights
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
|
WalkthroughThe contiguity validation checks for SFA and SFB parameters are removed from the dispatch logic. The pipeline now proceeds without enforcing these constraints, deferring shape interpretation to downstream components or kernel layout specifications. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
||
// Ensure scales are contiguous | ||
// Note: We keep the original shape and let the kernel's layout handle interpretation | ||
CHECK_CONTIGUOUS(SFA); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any assumptions on the layout of SFA or SFB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The layout of SFA and SFB: https://github.com/flashinfer-ai/flashinfer/blob/main/include/flashinfer/gemm/gemm_groupwise_sm120.cuh#L122-L123, looks like the contiguity is not required (https://github.com/NVIDIA/cutlass/blob/main/examples/87_blackwell_geforce_gemm_blockwise/87b_blackwell_geforce_fp8_bf16_gemm_groupwise.cu#L304-L305).
There was a problem hiding this 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 removes redundant contiguity checks on scale factor tensors in the SM120 GEMM implementation. This fixes a regression where valid, non-contiguous tensors were being incorrectly rejected. The change is sound as the underlying CUTLASS kernel handles memory layout complexities for these tensors. For long-term stability, it would be beneficial to add a regression test case that specifically uses non-contiguous scale tensors to ensure this functionality remains correct in future changes.
📌 Description
Fix the regression in vLLM and SGLang with FI 0.4.0 in bmm_fp8
🔍 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-commit
by runningpip install pre-commit
(or used your preferred method).pre-commit install
.pre-commit run --all-files
and fixed any reported issues.🧪 Tests
unittest
, etc.).Reviewer Notes
cc: @yzh119
Summary by CodeRabbit