Skip to content

RMSNorm support - Executorch #9844

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions backends/cadence/aot/ops_registrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"int in_zero_point, bool channel_last=False) -> (Tensor out)"
)
lib.define("linalg_vector_norm(Tensor X) -> (Tensor Y)")
lib.define("rms_norm(Tensor X, float eps, Tensor W) -> (Tensor Y)")
lib.define(
"transposed_im2row(Tensor input, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, "
"int[2] output_padding, Tensor in_zero_point, bool channel_last=False) -> (Tensor out)"
Expand Down Expand Up @@ -210,6 +211,9 @@
"fully_connected.out(Tensor input, Tensor weight, Tensor? bias=None, *, Tensor(a!) out) -> Tensor(a!)"
)
lib.define("linalg_vector_norm.out(Tensor X, *, Tensor(a!) out) -> Tensor(a!)")
lib.define(
"rms_norm.out(Tensor X, float eps, Tensor W, *, Tensor(a!) out) -> Tensor(a!)"
)
lib.define(
"quantized_fully_connected.out(Tensor src, Tensor weight, Tensor bias, int src_zero_point, "
"Tensor weight_zero_point, Tensor out_multiplier, Tensor out_shift, int out_zero_point, Tensor? offset, *, Tensor(a!) out) -> Tensor(a!)"
Expand Down Expand Up @@ -615,6 +619,15 @@ def linalg_vector_norm_meta(
return X.new_empty([], dtype=X.dtype)


@register_fake("cadence::rms_norm")
def rms_norm_meta(
X: torch.Tensor,
eps: float,
weight: torch.Tensor,
) -> torch.Tensor:
return X.new_empty(X.shape, dtype=X.dtype)


@register_fake("cadence::requantize")
def requantize_meta(
input: torch.Tensor,
Expand Down
Loading