Commit 4922108e authored by wenjh's avatar wenjh
Browse files

Fix std::bad_alloc on test_float8blockwisetensor.py


Signed-off-by: wenjh's avatarwenjh <wenjh@sugon.com>
parent fca88163
...@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment