-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[fix] recover auto-dispatch for rmsnorm and rope #6745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
22b02c0
[fix] recover auto-dispatch for rmsnorm and rope
Alcanderian c796d35
Merge branch 'main' into auto-dispatch
zhyncs 329e102
try to fix amd ci
Alcanderian ef58e45
re-dispatch _forward_method
Alcanderian 002c1b9
fix _to_torch
Alcanderian b98da83
.
Alcanderian fcb5f81
fix
Alcanderian 8e33357
Merge branch 'main' into auto-dispatch
Alcanderian a040f6b
fix
Alcanderian 3ba86bb
fix enter_torch_compile and leave_torch_compile
Alcanderian 15e6d9a
doc typo
Alcanderian 08610bc
lint
Alcanderian 04cf251
Update python/sglang/srt/custom_op.py
Alcanderian 4adc232
Update python/sglang/srt/custom_op.py
Alcanderian dce7b18
Update custom_op.py
Alcanderian 877b1cb
Update rotary_embedding.py
Alcanderian 9a85a63
Update layernorm.py
Alcanderian ec8f2d9
Revert "Update rotary_embedding.py"
Alcanderian 7605c4a
fix layernorm.py
Alcanderian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,16 +49,6 @@ def __init__( | |
| self.weight = nn.Parameter(torch.ones(hidden_size)) | ||
| self.variance_epsilon = eps | ||
|
|
||
| def forward(self, *args, **kwargs): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we would still need this custom dispatch in this context - over-general abstraction as _is_hip to forward_hip isn't enough - we will need to add forward_aiter specifically in this block. |
||
| if torch.compiler.is_compiling(): | ||
| return self.forward_native(*args, **kwargs) | ||
| if _is_cuda: | ||
| return self.forward_cuda(*args, **kwargs) | ||
| elif _is_hip: | ||
| return self.forward_hip(*args, **kwargs) | ||
| else: | ||
| return self.forward_native(*args, **kwargs) | ||
|
|
||
| def forward_cuda( | ||
| self, | ||
| x: torch.Tensor, | ||
|
|
@@ -117,14 +107,6 @@ def __init__( | |
| self.weight = nn.Parameter(torch.zeros(hidden_size)) | ||
| self.variance_epsilon = eps | ||
|
|
||
| def forward(self, *args, **kwargs): | ||
| if torch.compiler.is_compiling(): | ||
| return self.forward_native(*args, **kwargs) | ||
| if _is_cuda: | ||
| return self.forward_cuda(*args, **kwargs) | ||
| else: | ||
| return self.forward_native(*args, **kwargs) | ||
|
|
||
| def forward_native( | ||
| self, | ||
| x: torch.Tensor, | ||
|
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.