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

Improve the efficiency of the RMSNorm aggregation #179

Open
lancerts opened this issue Aug 30, 2024 · 5 comments · May be fixed by #255
Open

Improve the efficiency of the RMSNorm aggregation #179

lancerts opened this issue Aug 30, 2024 · 5 comments · May be fixed by #255
Assignees

Comments

@lancerts
Copy link
Collaborator

lancerts commented Aug 30, 2024

🚀 The feature, motivation and pitch

Modify this line https://github.com/linkedin/Liger-Kernel/blob/main/src/liger_kernel/ops/rms_norm.py#L306, the sum in pytorch to partial aggregation in triton, reference
https://github.com/linkedin/Liger-Kernel/blob/main/src/liger_kernel/ops/layer_norm.py#L106,
which does 2 level of aggregation, first in triton and second in torch (more efficient).

Alternatives

No response

Additional context

No response

@ByronHsu
Copy link
Collaborator

cc @AndreSlavescu

@ByronHsu ByronHsu removed their assignment Aug 30, 2024
@S1ro1
Copy link
Contributor

S1ro1 commented Aug 30, 2024

i would like to try this one, #take @lancerts, edit: not sure how well i can do this, but would like to try, so idk if good to assign to me

@ByronHsu
Copy link
Collaborator

you can refer to layernorm in triton tutorial

@lancerts
Copy link
Collaborator Author

@S1ro1
Copy link
Contributor

S1ro1 commented Aug 30, 2024

yes, i did go similar to liger layer_norm implementation, however i'm having some issues with numerical stability, is it ok to increase the absolute tolerance in tests? I'll create a draft PR asap, need to fix some issues @lancerts

@S1ro1 S1ro1 mentioned this issue Aug 30, 2024
3 tasks
@Tcc0403 Tcc0403 linked a pull request Sep 19, 2024 that will close this issue
3 tasks
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 a pull request may close this issue.

3 participants