Support bfloat16 on rest of the unit tests

This commit is contained in:
Wenkai Du
2019-11-18 14:17:29 -08:00
parent bdac0256a5
commit 4ca05c1297
8 changed files with 18 additions and 6 deletions
+2 -1
View File
@@ -101,7 +101,8 @@ namespace CorrectnessTests
ncclUint64,
//ncclFloat16,
ncclFloat32,
ncclFloat64),
ncclFloat64,
ncclBfloat16),
// Number of elements
testing::Values(3072, 3145728),
// Number of devices
+2 -1
View File
@@ -59,7 +59,8 @@ namespace CorrectnessTests
ncclUint64,
//ncclFloat16,
ncclFloat32,
ncclFloat64),
ncclFloat64,
ncclBfloat16),
// Number of elements
testing::Values(1024, 1048576),
// Number of devices
+2 -1
View File
@@ -89,7 +89,8 @@ namespace CorrectnessTests
ncclUint64,
//ncclFloat16,
ncclFloat32,
ncclFloat64),
ncclFloat64,
ncclBfloat16),
// Number of elements
testing::Values(3072, 3145728),
// Number of devices
+2 -1
View File
@@ -110,7 +110,8 @@ namespace CorrectnessTests
ncclUint64,
//ncclFloat16,
ncclFloat32,
ncclFloat64),
ncclFloat64,
ncclBfloat16),
// Number of elements
testing::Values(3072, 3145728),
// Number of devices
+2 -1
View File
@@ -58,7 +58,8 @@ namespace CorrectnessTests
ncclUint64,
//ncclFloat16,
ncclFloat32,
ncclFloat64),
ncclFloat64,
ncclBfloat16),
// Number of elements
testing::Values(1024, 1048576),
// Number of devices
+3
View File
@@ -29,6 +29,7 @@ namespace CorrectnessTests
uint64_t* resultU8 = (uint64_t *)resultI1;
float* resultF4 = (float *)resultI1;
double* resultF8 = (double *)resultI1;
rccl_bfloat16* resultB2 = (rccl_bfloat16 *)resultI1;
// Initialize the result with the first device's array
memcpy(resultI1, dataset.expected[0], dataset.NumBytes());
@@ -44,6 +45,7 @@ namespace CorrectnessTests
uint64_t* arrayU8 = (uint64_t *)arrayI1;
float* arrayF4 = (float *)arrayI1;
double* arrayF8 = (double *)arrayI1;
rccl_bfloat16* arrayB2 = (rccl_bfloat16 *)arrayI1;
for (int j = 0; j < dataset.numElements; j++)
{
@@ -57,6 +59,7 @@ namespace CorrectnessTests
case ncclUint64: resultU8[j] = ReduceOp(op, resultU8[j], arrayU8[j]); break;
case ncclFloat32: resultF4[j] = ReduceOp(op, resultF4[j], arrayF4[j]); break;
case ncclFloat64: resultF8[j] = ReduceOp(op, resultF8[j], arrayF8[j]); break;
case ncclBfloat16: resultB2[j] = ReduceOp(op, resultB2[j], arrayB2[j]); break;
default:
fprintf(stderr, "[ERROR] Unsupported datatype\n");
exit(0);
+2 -1
View File
@@ -57,7 +57,8 @@ namespace CorrectnessTests
ncclUint64,
//ncclFloat16,
ncclFloat32,
ncclFloat64),
ncclFloat64,
ncclBfloat16),
// Number of elements
testing::Values(3072, 3145728),
// Number of devices
+3
View File
@@ -29,6 +29,7 @@ namespace CorrectnessTests
uint64_t* resultU8 = (uint64_t *)resultI1;
float* resultF4 = (float *)resultI1;
double* resultF8 = (double *)resultI1;
rccl_bfloat16* resultB2 = (rccl_bfloat16 *)resultI1;
// Initialize the result with the first device's array
memcpy(resultI1, dataset.expected[0], dataset.NumBytes());
@@ -44,6 +45,7 @@ namespace CorrectnessTests
uint64_t* arrayU8 = (uint64_t *)arrayI1;
float* arrayF4 = (float *)arrayI1;
double* arrayF8 = (double *)arrayI1;
rccl_bfloat16* arrayB2 = (rccl_bfloat16 *)arrayI1;
for (int j = 0; j < dataset.numElements; j++)
{
@@ -57,6 +59,7 @@ namespace CorrectnessTests
case ncclUint64: resultU8[j] = ReduceOp(op, resultU8[j], arrayU8[j]); break;
case ncclFloat32: resultF4[j] = ReduceOp(op, resultF4[j], arrayF4[j]); break;
case ncclFloat64: resultF8[j] = ReduceOp(op, resultF8[j], arrayF8[j]); break;
case ncclBfloat16: resultB2[j] = ReduceOp(op, resultB2[j], arrayB2[j]); break;
default:
fprintf(stderr, "[ERROR] Unsupported datatype\n");
exit(0);