Use apply_rope_with_cos_sin_cache_inplace for DeepSeek#4764
Merged
zhyncs merged 5 commits intosgl-project:mainfrom Mar 27, 2025
Merged
Use apply_rope_with_cos_sin_cache_inplace for DeepSeek#4764zhyncs merged 5 commits intosgl-project:mainfrom
zhyncs merged 5 commits intosgl-project:mainfrom
Conversation
added 2 commits
March 25, 2025 18:14
zhyncs
approved these changes
Mar 25, 2025
Collaborator
|
Thanks for this improvement! |
6 tasks
guoyuhong
added a commit
to guoyuhong/sglang
that referenced
this pull request
Apr 1, 2025
…roject#4764)" This reverts commit 886fcbd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
It seems that rope kernel in flashinfer can be directly applied to DeepSeek, that will fuse some torch kernels for cuda backend.
Modifications
I change DeepseekScalingRotaryEmbedding.forward to DeepseekScalingRotaryEmbedding.forward_native to use forward_cuda in parent class, this will call apply_rope_with_cos_sin_cache_inplace at last.
Following results are benchmarked with 8*H20 and compiled with cuda12.8
5% gain for most of the metrics.
Checklist