Skip to content

Commit 17f3a3b

Browse files
authored
Fix IsInfTest (T4 GPU does not support BF16) (#28727)
The Python CUDA Package Test Pipeline run on T4 GPU, which does not support BF16. There is test failure "TensorRT EP failed to create engine from network for fused node".
1 parent 895422d commit 17f3a3b

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

onnxruntime/test/providers/cpu/tensor/isinf_test.cc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
#include "gtest/gtest.h"
5+
#include "test/common/cuda_op_test_utils.h"
56
#include "test/providers/provider_test_utils.h"
67

78
#include <limits>
@@ -125,20 +126,32 @@ TEST(IsInfTest, test_isinf_negative_mlfloat16) {
125126
}
126127

127128
TEST(IsInfTest, test_isinf_bfloat16) {
129+
if (NeedSkipIfCudaArchLowerThan(800)) {
130+
GTEST_SKIP() << "Skipping BFloat16 tests on CUDA Compute Capability < 8.0";
131+
}
132+
128133
std::initializer_list<BFloat16> input = {BFloat16{-1.7f}, BFloat16::NaN, BFloat16::Infinity, 3.6_bfp16,
129134
BFloat16::NegativeInfinity, BFloat16::Infinity};
130135
std::initializer_list<bool> output = {false, false, true, false, true, true};
131-
run_is_inf_test(20, 1, 1, input, output, true); // Skip as TRT10 supports BF16 but T4 GPU run on TRT CIs doesn't
136+
run_is_inf_test(20, 1, 1, input, output);
132137
}
133138

134139
TEST(IsInfTest, test_isinf_positive_bfloat16) {
140+
if (NeedSkipIfCudaArchLowerThan(800)) {
141+
GTEST_SKIP() << "Skipping BFloat16 tests on CUDA Compute Capability < 8.0";
142+
}
143+
135144
std::initializer_list<BFloat16> input = {BFloat16{-1.7f}, BFloat16::NaN, BFloat16::Infinity, 3.6_bfp16,
136145
BFloat16::NegativeInfinity, BFloat16::Infinity};
137146
std::initializer_list<bool> output = {false, false, true, false, false, true};
138147
run_is_inf_test(20, 1, 0, input, output);
139148
}
140149

141150
TEST(IsInfTest, test_isinf_negative_bfloat16) {
151+
if (NeedSkipIfCudaArchLowerThan(800)) {
152+
GTEST_SKIP() << "Skipping BFloat16 tests on CUDA Compute Capability < 8.0";
153+
}
154+
142155
std::initializer_list<BFloat16> input = {BFloat16{-1.7f}, BFloat16::NaN, BFloat16::Infinity, 3.6_bfp16,
143156
BFloat16::NegativeInfinity, BFloat16::Infinity};
144157
std::initializer_list<bool> output = {false, false, false, false, true, false};

0 commit comments

Comments
 (0)