Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
e9fda392
Unverified
Commit
e9fda392
authored
Mar 20, 2025
by
YiYi Xu
Committed by
GitHub
Mar 20, 2025
Browse files
remove F.rms_norm for now (#11126)
up
parent
2c1ed50f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
10 deletions
+0
-10
src/diffusers/models/normalization.py
src/diffusers/models/normalization.py
+0
-10
No files found.
src/diffusers/models/normalization.py
View file @
e9fda392
...
...
@@ -550,16 +550,6 @@ class RMSNorm(nn.Module):
hidden_states
=
torch_npu
.
npu_rms_norm
(
hidden_states
,
self
.
weight
,
epsilon
=
self
.
eps
)[
0
]
if
self
.
bias
is
not
None
:
hidden_states
=
hidden_states
+
self
.
bias
elif
is_torch_version
(
">="
,
"2.4"
):
if
self
.
weight
is
not
None
:
# convert into half-precision if necessary
if
self
.
weight
.
dtype
in
[
torch
.
float16
,
torch
.
bfloat16
]:
hidden_states
=
hidden_states
.
to
(
self
.
weight
.
dtype
)
hidden_states
=
nn
.
functional
.
rms_norm
(
hidden_states
,
normalized_shape
=
(
hidden_states
.
shape
[
-
1
],),
weight
=
self
.
weight
,
eps
=
self
.
eps
)
if
self
.
bias
is
not
None
:
hidden_states
=
hidden_states
+
self
.
bias
else
:
input_dtype
=
hidden_states
.
dtype
variance
=
hidden_states
.
to
(
torch
.
float32
).
pow
(
2
).
mean
(
-
1
,
keepdim
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment