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
OpenDAS
TransformerEngine
Commits
5a495a39
Unverified
Commit
5a495a39
authored
Jul 28, 2025
by
Przemyslaw Tredak
Committed by
GitHub
Jul 28, 2025
Browse files
Fix the use-after-free bug in unfused normalization (#2002)
Signed-off-by:
Przemek Tredak
<
ptredak@nvidia.com
>
parent
aac74427
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
transformer_engine/pytorch/csrc/extensions/normalization.cpp
transformer_engine/pytorch/csrc/extensions/normalization.cpp
+2
-2
No files found.
transformer_engine/pytorch/csrc/extensions/normalization.cpp
View file @
5a495a39
...
@@ -108,9 +108,9 @@ std::vector<py::object> layernorm_fwd(py::handle input, py::handle weight, Maybe
...
@@ -108,9 +108,9 @@ std::vector<py::object> layernorm_fwd(py::handle input, py::handle weight, Maybe
}
}
}
}
TensorWrapper
unquantized_out_cu
;
TensorWrapper
unquantized_out_cu
;
py
::
object
unquantized_out
;
if
(
force_unfused_kernel
)
{
if
(
force_unfused_kernel
)
{
NoneQuantizer
q
{
none
};
NoneQuantizer
q
{
none
};
py
::
object
unquantized_out
;
std
::
tie
(
unquantized_out_cu
,
unquantized_out
)
=
q
.
create_tensor
(
size
,
out_dtype
);
std
::
tie
(
unquantized_out_cu
,
unquantized_out
)
=
q
.
create_tensor
(
size
,
out_dtype
);
}
}
TensorWrapper
&
kernel_out_cu
=
force_unfused_kernel
?
unquantized_out_cu
:
out_cu
;
TensorWrapper
&
kernel_out_cu
=
force_unfused_kernel
?
unquantized_out_cu
:
out_cu
;
...
@@ -269,9 +269,9 @@ std::vector<py::object> rmsnorm_fwd(const py::handle &input, const py::handle &w
...
@@ -269,9 +269,9 @@ std::vector<py::object> rmsnorm_fwd(const py::handle &input, const py::handle &w
}
}
}
}
TensorWrapper
unquantized_out_cu
;
TensorWrapper
unquantized_out_cu
;
py
::
object
unquantized_out
;
if
(
force_unfused_kernel
)
{
if
(
force_unfused_kernel
)
{
NoneQuantizer
q
{
none
};
NoneQuantizer
q
{
none
};
py
::
object
unquantized_out
;
std
::
tie
(
unquantized_out_cu
,
unquantized_out
)
=
q
.
create_tensor
(
size
,
out_dtype
);
std
::
tie
(
unquantized_out_cu
,
unquantized_out
)
=
q
.
create_tensor
(
size
,
out_dtype
);
}
}
TensorWrapper
&
kernel_out_cu
=
force_unfused_kernel
?
unquantized_out_cu
:
out_cu
;
TensorWrapper
&
kernel_out_cu
=
force_unfused_kernel
?
unquantized_out_cu
:
out_cu
;
...
...
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