From bb248745f0ae91a3781dedd164fbc96d8c93d73e Mon Sep 17 00:00:00 2001 From: Christos Tsirigotis Date: Thu, 20 Apr 2017 18:23:06 +0300 Subject: [PATCH 1/2] Convert GA_FLOAT16 to ncclHalf in cuda collectives --- src/gpuarray_collectives_cuda_nccl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gpuarray_collectives_cuda_nccl.c b/src/gpuarray_collectives_cuda_nccl.c index dc5a901ab7..bd5cb3963b 100644 --- a/src/gpuarray_collectives_cuda_nccl.c +++ b/src/gpuarray_collectives_cuda_nccl.c @@ -175,11 +175,14 @@ static inline ncclDataType_t convert_data_type(int typecode) { switch (typecode) { case GA_BYTE: return ncclChar; case GA_INT: return ncclInt; - case GA_HALF: return ncclHalf; case GA_FLOAT: return ncclFloat; case GA_DOUBLE: return ncclDouble; case GA_LONG: return ncclInt64; case GA_ULONG: return ncclUint64; + #ifdef CUDA_HAS_HALF + case GA_HALF: return ncclHalf; + case GA_FLOAT16: return ncclHalf; + #endif } return nccl_NUM_TYPES; } From c11b0b3401fcde5abd65c7b7bd758bbffbf41f39 Mon Sep 17 00:00:00 2001 From: Frederic Bastien Date: Tue, 2 May 2017 11:37:27 -0400 Subject: [PATCH 2/2] Remove ifdef as all supported version have it. --- src/gpuarray_collectives_cuda_nccl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gpuarray_collectives_cuda_nccl.c b/src/gpuarray_collectives_cuda_nccl.c index bd5cb3963b..44c1297aa7 100644 --- a/src/gpuarray_collectives_cuda_nccl.c +++ b/src/gpuarray_collectives_cuda_nccl.c @@ -179,10 +179,8 @@ static inline ncclDataType_t convert_data_type(int typecode) { case GA_DOUBLE: return ncclDouble; case GA_LONG: return ncclInt64; case GA_ULONG: return ncclUint64; - #ifdef CUDA_HAS_HALF case GA_HALF: return ncclHalf; case GA_FLOAT16: return ncclHalf; - #endif } return nccl_NUM_TYPES; }