[Re-land][jit kernel] Support per_token_group_quant_8bit jit kernel#19140
[Re-land][jit kernel] Support per_token_group_quant_8bit jit kernel#19140BBuf merged 5 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello @yuan-luo, 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 re-introducing and integrating a Just-In-Time (JIT) compiled kernel for per-token group 8-bit quantization. The primary goal is to enhance the efficiency of quantization operations by leveraging a dedicated C++/CUDA implementation. This involves adding the kernel's source, creating its Python interface, and ensuring its functional correctness and performance through new testing and benchmarking infrastructure. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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
The pull request re-lands the JIT kernel for per_token_group_quant_8bit. The implementation is consistent with the repository's JIT infrastructure and provides a fallback path for the pre-compiled extension. I have identified a few issues that need to be addressed: missing support for torch.float8_e4m3fnuz in the JIT utility mapping which will break AMD support, and several hardcoded values in the test script that prevent it from correctly verifying different quantization configurations and dtypes. Additionally, there are minor cleanup and optimization opportunities in the CUDA kernel.
| DST_DTYPE* __restrict__ output_q, | ||
| scale_packed_t_t<kScaleUE8M0>* __restrict__ output_s, | ||
| const int group_size, | ||
| const int num_groups, |
|
/rerun-failed-ci |
|
/tag-and-rerun-ci |
73ea775 to
7070576
Compare
Co-authored-by: Mohammad Miadh Angkad <mangkad.bsdsba2027@aim.edu>
|
/tag-and-rerun-ci |
|
/rerun-failed-ci |
5 similar comments
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
| masked_m, | ||
| enable_v2=enable_v2, | ||
| ) | ||
| if enable_v2: |
There was a problem hiding this comment.
Todo: after remove per_token_group_quant_8bit kernels to jit_kernel, we should unify per_token_group_quant_8bit and per_token_group_quant_8bit_v2 to a single file.
There was a problem hiding this comment.
Sure. I'll follow up.
…gl-project#19140) Co-authored-by: luoyuan.luo <luoyuan.luo@antgroup.com> Co-authored-by: Mohammad Miadh Angkad <mangkad.bsdsba2027@aim.edu>
…gl-project#19140) Co-authored-by: luoyuan.luo <luoyuan.luo@antgroup.com> Co-authored-by: Mohammad Miadh Angkad <mangkad.bsdsba2027@aim.edu>
…gl-project#19140) Co-authored-by: luoyuan.luo <luoyuan.luo@antgroup.com> Co-authored-by: Mohammad Miadh Angkad <mangkad.bsdsba2027@aim.edu>
…gl-project#19140) Co-authored-by: luoyuan.luo <luoyuan.luo@antgroup.com> Co-authored-by: Mohammad Miadh Angkad <mangkad.bsdsba2027@aim.edu>
Motivation
#18905 was reverted due to CI failure, but this CI failure was not introduced by #18905. After confirmed with @hnyls2002 , reland this jit kernel.
Adopted the fix in #19118 and added @mmangkad as co-author.
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci