[sgl-kernel] chore: clean pytorch_extension_utils.h#13343
[sgl-kernel] chore: clean pytorch_extension_utils.h#13343jinyouzhi wants to merge 3 commits intosgl-project:mainfrom
pytorch_extension_utils.h#13343Conversation
Summary of ChangesHello @jinyouzhi, 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 focuses on a significant cleanup and refactoring of header dependencies within the 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
|
There was a problem hiding this comment.
Code Review
This pull request is a nice cleanup, refactoring multiple files to use the new utils.h header instead of the old pytorch_extension_utils.h. This consolidation improves code organization. The change from a #define macro to a constexpr variable for FULL_32BIT_MASK is also a good improvement for type safety and modern C++ practices.
I've added one comment to improve portability by using an existing abstraction macro, which will make the code compatible with ROCm.
|
Thats right |
|
Btw, If we keep pytorch_extension_utils, will we encounter any errors? Could you explain in detail what reasons we have for modifying it? |
Goog point, the direct motivation is I found no |
|
Just check again, now sgl-kernel still dep on https://github.com/flashinfer-ai/flashinfer/blob/bc29697ba20b7e6bdb728ded98f04788e16ee021/csrc/pytorch_extension_utils.h in sglang/sgl-kernel/CMakeLists.txt Line 86 in 67071f5 So compilation is ok for now. But it has been refacted in flashinfer-ai/flashinfer#1795 |
pytorch_extension_utils.h
|
@FlamingoPg @Fridge003 Could you give further comments? I think we need to clean these if flashinfer dependency move forward. |
|
@jinyouzhi When using flashinfer in JIT mode, we install it directly rather than compiling through CMakeLists.txt. In sgl-kernel, we have pinned a specific flashinfer version at https://github.com/yzh119/flashinfer-dev/blob/ce7c58e4e98ed4fb3aac6626c30c792317f23a5f/csrc/pytorch_extension_utils.h. Currently, we have no plans to upgrade flashinfer in sgl-kernel for the time being. |
|
We tagging flashinfer version by: |
|
Finally If you think it's necessary to upgrade, please tell me the purpose of doing so. And you need to ensure the compilation passes. |
Got it, thank you for your patient explanation. I agree it's lack of motivation to modify if not necessary. |
Motivation
#include "pytorch_extension_utils.h"in kernels? #13209Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist