[add] Add operator gemmfastgelu for ROCM#12101
Merged
PeixuanZuo merged 15 commits intomasterfrom Jul 13, 2022
Merged
Conversation
zhangyaobit
reviewed
Jul 7, 2022
75480b6 to
a47b599
Compare
tianleiwu
reviewed
Jul 7, 2022
| template <typename T> | ||
| GemmFastGelu<T>::GemmFastGelu(const OpKernelInfo& op_kernel_info) : RocmKernel(op_kernel_info) { | ||
| const TransformerOptions* options = TransformerOptions::GetInstance(); | ||
| tuning_ = options->IsTuningEnabled(); |
Contributor
There was a problem hiding this comment.
I did not see tuning_ is used anywhere. Suggest to remove it right now, and you can add it when you add tuning logic.
Contributor
Author
There was a problem hiding this comment.
Yes, it's a variable used in the future, delete in this pr.
tianleiwu
reviewed
Jul 7, 2022
| } else if (CanUseStridedBatchedGemm(X->Shape(), W->Shape(), | ||
| transa, transb, stride_A, stride_B, stride_C, batch_count)) { | ||
| ROCBLAS_RETURN_IF_ERROR(rocblasGemmStridedBatchedHelper(RocblasHandle(), | ||
| transB, |
tianleiwu
reviewed
Jul 7, 2022
|
|
||
| #if defined(USE_ROCM) | ||
| static void RunGemmFastGeluGpuTest(const std::vector<float>& input_data, const std::vector<float>& weight_data, | ||
| const std::vector<float>& bias_data, const std::vector<float>& output_data, |
zhangyaobit
reviewed
Jul 9, 2022
zhangyaobit
reviewed
Jul 12, 2022
ac0ee68 to
9fd5e4d
Compare
zhangyaobit
previously approved these changes
Jul 12, 2022
zhangyaobit
approved these changes
Jul 13, 2022
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.
Description: Describe your changes.
Add a new operator GemmFastGelu on ROCM EP. Fused by MatMul + FastGelu.
It's a base implementation and the performance is the same as sequential execution of MatMul + FastGelu.
Will add composable_kernel(https://github.com/ROCmSoftwarePlatform/composable_kernel) implementation for fused GemmFastGelu.
Motivation and Context