Update megatron fused softmax follow megatron-lm#1539
Merged
Conversation
Signed-off-by: Yu Yao <[email protected]>
Signed-off-by: Yu Yao <[email protected]>
crcrpar
reviewed
Nov 15, 2022
Collaborator
crcrpar
left a comment
There was a problem hiding this comment.
how is the custom C++/CUDA extension of scaled_softmax_cuda built?
usually setup.py needs to be updated.
also, could you update https://github.com/NVIDIA/apex/blob/master/tests/L0/run_transformer/test_fused_softmax.py as well?
Signed-off-by: Yu Yao <[email protected]>
Signed-off-by: Yu Yao <[email protected]>
Contributor
Author
|
@crcrpar comments addressed |
crcrpar
reviewed
Nov 16, 2022
Comment on lines
+187
to
+188
| expected.backward(g0) | ||
| actual.backward(g1) |
Collaborator
There was a problem hiding this comment.
feels like these lines are based off of some existing cases but how about either checking grads or remove these lines?
Contributor
Author
There was a problem hiding this comment.
I think the purpose in other tests was just to test backward can work correctly
Signed-off-by: Yu Yao <[email protected]>
crcrpar
reviewed
Nov 17, 2022
Collaborator
crcrpar
left a comment
There was a problem hiding this comment.
generally okay but could you maybe tweak tests a bit?
Signed-off-by: Yu Yao <[email protected]>
crcrpar
pushed a commit
to crcrpar/apex
that referenced
this pull request
Nov 22, 2022
* Update megatron fused softmax follow megatron-lm Signed-off-by: Yu Yao <[email protected]> * Add mask=None support in scaled_masked_softmax Signed-off-by: Yu Yao <[email protected]> * Update setup.py for scaled_softmax_cuda Signed-off-by: Yu Yao <[email protected]> * Add tests for fused_scale_softmax (mask=None) Signed-off-by: Yu Yao <[email protected]> * Assert grad equal in fused softmax test Signed-off-by: Yu Yao <[email protected]> * Revert "Assert grad equal in fused softmax test" Signed-off-by: Yu Yao <[email protected]> Signed-off-by: Yu Yao <[email protected]> Co-authored-by: Yu Yao <[email protected]>
hubertlu-tw
pushed a commit
to ROCm/apex
that referenced
this pull request
Dec 29, 2022
* Update megatron fused softmax follow megatron-lm Signed-off-by: Yu Yao <[email protected]> * Add mask=None support in scaled_masked_softmax Signed-off-by: Yu Yao <[email protected]> * Update setup.py for scaled_softmax_cuda Signed-off-by: Yu Yao <[email protected]> * Add tests for fused_scale_softmax (mask=None) Signed-off-by: Yu Yao <[email protected]> * Assert grad equal in fused softmax test Signed-off-by: Yu Yao <[email protected]> * Revert "Assert grad equal in fused softmax test" Signed-off-by: Yu Yao <[email protected]> Signed-off-by: Yu Yao <[email protected]> Co-authored-by: Yu Yao <[email protected]>
yuanzhedong
pushed a commit
to yuanzhedong/apex
that referenced
this pull request
Jul 14, 2023
* Update megatron fused softmax follow megatron-lm Signed-off-by: Yu Yao <[email protected]> * Add mask=None support in scaled_masked_softmax Signed-off-by: Yu Yao <[email protected]> * Update setup.py for scaled_softmax_cuda Signed-off-by: Yu Yao <[email protected]> * Add tests for fused_scale_softmax (mask=None) Signed-off-by: Yu Yao <[email protected]> * Assert grad equal in fused softmax test Signed-off-by: Yu Yao <[email protected]> * Revert "Assert grad equal in fused softmax test" Signed-off-by: Yu Yao <[email protected]> Signed-off-by: Yu Yao <[email protected]> Co-authored-by: Yu Yao <[email protected]>
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.
We updated megatron fused softmax in the following aspects:
mask=Nonesupport in scaled_masked_softmax according to https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/model/fused_softmax.py#L84