Skip to content
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

Return layernorm output in the gathered form #697

Merged
merged 10 commits into from
Mar 6, 2024

Conversation

cuichenx
Copy link
Contributor

@cuichenx cuichenx commented Mar 2, 2024

In layernorm linear, return_layernorm_output returns the layernorm output in the ungathered format. For certain use cases, it is necessary to do a manual all gather (AG) outside of this function, leading to a duplicate AG that hurts performance. This PR adds an option to return layernorm output in the gathered form to prevent duplicate operation.

cuichenx and others added 2 commits March 4, 2024 14:36
Co-authored-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Chen Cui <[email protected]>
Co-authored-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Chen Cui <[email protected]>
@cuichenx cuichenx requested a review from ksivaman March 4, 2024 22:05
@ksivaman
Copy link
Member

ksivaman commented Mar 4, 2024

/te-ci pytorch

@ksivaman
Copy link
Member

ksivaman commented Mar 5, 2024

@cuichenx Could you fix the CI errors?

Copy link
Member

@ksivaman ksivaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ci pending

@ksivaman
Copy link
Member

ksivaman commented Mar 5, 2024

/te-ci pytorch

@ksivaman ksivaman merged commit d8f678d into NVIDIA:main Mar 6, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants