-
-
Notifications
You must be signed in to change notification settings - Fork 20.6k
[12/n] final _C library kernel migration #45415
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
WoosukKwon
merged 11 commits into
vllm-project:main
from
cleonard530:new-stable-abi-final-_C
Jun 19, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d0ad001
moved csrc/quantization/activation_kernels.cu to csrc/libtorch_stabl…
cleonard530 c6dde94
migrated csrc/libtorch_stable/quantization/activation_kernels.cu to b…
cleonard530 e5aed52
small cosmetic changes to align with legacy code before migration and…
cleonard530 c29e571
fix pre-commit issue
cleonard530 957ecbc
updated qutlass to attach to _C_stable_libtorch instead of _C which i…
cleonard530 1215fa0
moved Expert-specialization MXFP8 block in the CMakeLists.txt to be b…
cleonard530 2c27bad
Build QuTLASS as standalone vllm._qutlass_C extension with PyInit reg…
cleonard530 9e539bc
Include _qutlass_C in precompiled wheels and register CUDA kernel ext…
cleonard530 549bae4
Moved core/math.hpp to the libtorch_stable directory. Fixed data_ptr …
cleonard530 9b5532f
MXFP8 was accidentally added back to CMakeLists.txt after resolving m…
cleonard530 9478297
Removed the custom deleter from the stable::from_blob method. The del…
cleonard530 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
Some comments aren't visible on the classic Files Changed page.
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
File renamed without changes.
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 |
|---|---|---|
|
|
@@ -2,9 +2,25 @@ | |
|
|
||
| #include <torch/csrc/stable/library.h> | ||
| #include <torch/csrc/stable/tensor.h> | ||
| #include <torch/headeronly/util/Exception.h> | ||
|
|
||
| #include <optional> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| #include <torch/csrc/stable/ops.h> | ||
|
|
||
| inline torch::stable::Tensor weak_ref_tensor(torch::stable::Tensor& tensor) { | ||
| // Ensure tensor is on CUDA | ||
| STD_TORCH_CHECK(tensor.device().is_cuda(), "Tensor must be on CUDA device"); | ||
|
|
||
| // Get the raw data pointer | ||
| void* data_ptr = tensor.mutable_data_ptr(); | ||
|
|
||
| /// Create a new tensor from the raw data pointer | ||
| return torch::stable::from_blob(data_ptr, tensor.sizes(), tensor.strides(), | ||
|
Contributor
Author
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. Can pass |
||
| tensor.device(), tensor.scalar_type()); | ||
| } | ||
|
|
||
| void per_token_group_quant_fp8(const torch::stable::Tensor& input, | ||
| torch::stable::Tensor& output_q, | ||
|
|
@@ -371,6 +387,18 @@ void silu_and_mul(torch::stable::Tensor& out, torch::stable::Tensor& input); | |
| void silu_and_mul_clamp(torch::stable::Tensor& out, | ||
| torch::stable::Tensor& input, double limit, | ||
| double alpha = 1.0, double beta = 0.0); | ||
|
|
||
| void silu_and_mul_quant(torch::stable::Tensor& out, | ||
| torch::stable::Tensor& input, | ||
| torch::stable::Tensor& scale); | ||
|
|
||
| void persistent_masked_m_silu_mul_quant( | ||
| const torch::stable::Tensor& input, // (E, T, 2*H) | ||
| const torch::stable::Tensor& tokens_per_expert, // (E) | ||
| torch::stable::Tensor& y_q, // (E, T, H) [OUT] | ||
| torch::stable::Tensor& y_s, // (E, T, H//group_size) [OUT] | ||
| bool use_ue8m0); | ||
|
|
||
| void mul_and_silu(torch::stable::Tensor& out, torch::stable::Tensor& input); | ||
| void gelu_and_mul(torch::stable::Tensor& out, torch::stable::Tensor& input); | ||
| void gelu_tanh_and_mul(torch::stable::Tensor& out, | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated comment to encourage others to use
_C_stable_libtorchfor cuda kernels,