add flagos.te_general_grouped_gemm#47
Closed
chai-xiaonan wants to merge 0 commit into
Closed
Conversation
lxd-cumt
reviewed
Mar 19, 2026
| continue | ||
|
|
||
| # Transpose matrices if requested | ||
| a = A[i].t() if transa else A[i] |
Collaborator
There was a problem hiding this comment.
use flag_gems transpose op ?
| def gelu_backward(grad_output, x): | ||
| # Approximation of GELU derivative commonly used in Transformer Engine | ||
| cdf = 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0))) | ||
| pdf = flag_gems.exp(-0.5 * x * x) / math.sqrt(2.0 * math.pi) |
| beta, | ||
| ) | ||
|
|
||
| def te_general_grouped_gemm(self, *args, **kwargs) -> Any: |
Collaborator
There was a problem hiding this comment.
The te_general_grouped_gemm api interface in transformer_engine/plugin/core/ops.py is as follows, please keep consistent
def te_general_grouped_gemm(
self,
A: List[Any],
transa: bool,
B: List[Any],
transb: bool,
D: Optional[List[torch.Tensor]],
D_type: DType,
m_splits: List[int],
bias: List[torch.Tensor],
bias_type: DType,
single_output: bool,
pre_gelu_out: List[torch.Tensor],
grad: bool,
workspace: List[torch.Tensor],
workspaceSizes: int,
accumulate: bool,
use_split_accumulator: bool,
math_sm_count: int,
) -> Optional[List[torch.Tensor]]:
raise NotImplementedError
Author
|
收到,谢谢
|
7c69faa to
7f788a3
Compare
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.
Based on the existing operators supported by flagGems, implement support for the te_general_grouped_gemm operator in the flagOS backend.Primarily addresses the operators involved in the DeepSeek V3 16_a3b model that are supported by CUDA but not by flagOS.