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
4922108e
Commit
4922108e
authored
Sep 12, 2025
by
wenjh
Browse files
Fix std::bad_alloc on test_float8blockwisetensor.py
Signed-off-by:
wenjh
<
wenjh@sugon.com
>
parent
fca88163
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
transformer_engine/common/transformer_engine.cpp
transformer_engine/common/transformer_engine.cpp
+12
-0
No files found.
transformer_engine/common/transformer_engine.cpp
View file @
4922108e
...
@@ -350,6 +350,12 @@ NVTEDType nvte_tensor_type(const NVTETensor tensor) {
...
@@ -350,6 +350,12 @@ NVTEDType nvte_tensor_type(const NVTETensor tensor) {
return
static_cast
<
NVTEDType
>
(
t
->
dtype
());
return
static_cast
<
NVTEDType
>
(
t
->
dtype
());
}
}
// Because of a HIP compiler bug, we need to disable optimizations here
// when compiling for AMD GPUs while test_float8blockwisetensor.py.
// Todo: remove this once the HIP compiler bug is fixed.
#ifdef __HIP_PLATFORM_AMD__
#pragma clang optimize off
#endif
NVTEShape
nvte_make_shape
(
const
size_t
*
data
,
size_t
ndim
)
{
NVTEShape
nvte_make_shape
(
const
size_t
*
data
,
size_t
ndim
)
{
NVTEShape
ret
;
NVTEShape
ret
;
if
(
ndim
==
0
)
{
if
(
ndim
==
0
)
{
...
@@ -363,6 +369,12 @@ NVTEShape nvte_make_shape(const size_t *data, size_t ndim) {
...
@@ -363,6 +369,12 @@ NVTEShape nvte_make_shape(const size_t *data, size_t ndim) {
ret
.
ndim
=
ndim
;
ret
.
ndim
=
ndim
;
return
ret
;
return
ret
;
}
}
// Because of a HIP compiler bug, we need to disable optimizations here
// when compiling for AMD GPUs while test_float8blockwisetensor.py.
// Todo: remove this once the HIP compiler bug is fixed.
#ifdef __HIP_PLATFORM_AMD__
#pragma clang optimize on
#endif
NVTEShape
nvte_tensor_shape
(
const
NVTETensor
tensor
)
{
NVTEShape
nvte_tensor_shape
(
const
NVTETensor
tensor
)
{
auto
*
t
=
transformer_engine
::
convertNVTETensor
(
tensor
);
auto
*
t
=
transformer_engine
::
convertNVTETensor
(
tensor
);
...
...
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