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

No backward pass for RmsNorm if tensor is contiguous #2168

Open
agerasev opened this issue May 7, 2024 · 0 comments
Open

No backward pass for RmsNorm if tensor is contiguous #2168

agerasev opened this issue May 7, 2024 · 0 comments

Comments

@agerasev
Copy link

agerasev commented May 7, 2024

RmsNorm switches to faster implementation if tensor is contiguous:

if xs.is_contiguous() {
crate::ops::rms_norm(xs, &self.0.weight, self.0.eps as f32)

But it does not support backward pass:

xs.apply_op2_no_bwd(alpha, &RmsNorm { eps })

Maybe it's better to implement ModuleT rather than Module for RmsNorm and use faster implementation only if train == false?

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

No branches or pull requests

1 participant