Use TORCH_LIBRARY to register function#60
Draft
yanbing-j wants to merge 2 commits intomingfeima:cpu_opt_ww11from
Draft
Use TORCH_LIBRARY to register function#60yanbing-j wants to merge 2 commits intomingfeima:cpu_opt_ww11from
yanbing-j wants to merge 2 commits intomingfeima:cpu_opt_ww11from
Conversation
|
I'm experimenting with torch.compile and also need to convert PyBind11 module to PyTorch custom op. Initial results have been promising so far. Will share more details when I have something more complete.
|
CaoE
pushed a commit
to CaoE/sglang
that referenced
this pull request
Aug 14, 2025
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
Modifications
std::optional<at::Tensor>&will useconst std::optional<at::Tensor>&instead, to pass build errors ofcannot bind non-const lvalue reference of type 'std::optional<at::Tensor>&' to an rvalue of type 'std::optional<at::Tensor>'.PyTorch schema float equals C++ double.
Now use
torch.ops.sgl_kernel.silu_and_mul_cputo call the function incpu.py. No need to change the wrapper in deepseek model, still usesgl_kernel.cpu.silu_and_mul.shm_allreduceis WIP.Checklist