Update sgl-kernel and remove fast hadamard depedency#11844
Update sgl-kernel and remove fast hadamard depedency#11844zhyncs merged 5 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello @Fridge003, 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 streamlines the project's dependencies by eliminating the external 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 effectively removes the fast-hadamard-transform dependency by vendoring its functionality into sgl-kernel. The modifications to the Dockerfile, CI scripts, and Python source code are correct and align with the PR's objective. My review includes one suggestion for improving code style. Additionally, for further cleanup, the FAST_HADAMARD_TRANSFORM_COMMIT build argument in docker/Dockerfile is now obsolete and can be removed.
| @@ -74,7 +74,7 @@ def topk_transform( | |||
|
|
|||
| def rotate_activation(x: torch.Tensor) -> torch.Tensor: | |||
| assert x.dtype == torch.bfloat16 | |||
| from fast_hadamard_transform import hadamard_transform | |||
| from sgl_kernel.hadamard import hadamard_transform | |||
There was a problem hiding this comment.
To improve code style and adhere to PEP 8, it's recommended to move this import statement to the top of the file with the other imports. Local imports within functions should generally be avoided unless necessary to prevent circular dependencies or for optional packages. Since sgl_kernel is now an internal part of the project, moving the import to the top level would be cleaner.1
Style Guide References
Footnotes
-
PEP 8: E402 module level import not at top of file. Imports should usually be at the top of the file. ↩
Motivation
Follow up of #11663 and #11733
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist