[deepseekv3.2] fix get_k_and_s_triton kenel for 128K seqlen case bug#19319
[deepseekv3.2] fix get_k_and_s_triton kenel for 128K seqlen case bug#19319Fridge003 merged 7 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello @BJWang-ant, 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 resolves a critical bug in the 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
|
|
later I will provide a precision test report |
There was a problem hiding this comment.
Code Review
This pull request refactors the get_k_and_s_triton kernel to support batched processing of sequences with varying lengths. This change fixes a bug for long sequences (e.g., 128K) by avoiding an excessively large Triton grid. The changes are consistently propagated through the call stack, and new tests have been added to verify the correctness of the new kernel, including a specific test for 128K sequence length. The overall change is well-implemented. I have one minor suggestion regarding a documentation inconsistency.
| :param seq_len: int, number of tokens to gather | ||
| :param seq_lens: tensor of sequence lens, int64 | ||
| :param seq_len_sum: sum of all sequence len, int32 | ||
| :param seq_len_sum: max of sequence len, int32 |
There was a problem hiding this comment.
There appears to be a copy-paste error in the docstring. The parameter name here is seq_len_sum, but the description max of sequence len, int32 corresponds to the max_seq_len parameter. Please correct the parameter name to max_seq_len to avoid confusion.
| :param seq_len_sum: max of sequence len, int32 | |
| :param max_seq_len: max of sequence len, int32 |
4271749 to
abca105
Compare
this is gpqa datasets test precison result. @Fridge003
command is : |
abca105 to
ec08dd9
Compare
|
/tag-and-rerun-ci |
…gl-project#19319) Co-authored-by: abing <wangbingjia.wbj@alibaba-inc.com>
…gl-project#19319) Co-authored-by: abing <wangbingjia.wbj@alibaba-inc.com>
…gl-project#19319) Co-authored-by: abing <wangbingjia.wbj@alibaba-inc.com>
…gl-project#19319) Co-authored-by: abing <wangbingjia.wbj@alibaba-inc.com>

Motivation
fix get_k_and_s_triton kenel for 128K seqlen case bug
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci