From e22cc9221d14a859acba32f23877b349e1fe0eb5 Mon Sep 17 00:00:00 2001 From: "Max H. Gerlach" Date: Thu, 9 Jun 2022 19:50:02 +0200 Subject: [PATCH 1/3] Register HorovodReducescatter op name for NVTX ranges Signed-off-by: Max H. Gerlach --- horovod/common/nvtx_op_range.cc | 1 + horovod/common/nvtx_op_range.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/horovod/common/nvtx_op_range.cc b/horovod/common/nvtx_op_range.cc index 9c87cc7ca7..9dd62f81f0 100644 --- a/horovod/common/nvtx_op_range.cc +++ b/horovod/common/nvtx_op_range.cc @@ -14,6 +14,7 @@ NvtxOpsHandle::NvtxOpsHandle() noexcept REGISTER_STRING(HorovodAllgather); REGISTER_STRING(HorovodBroadcast); REGISTER_STRING(HorovodAlltoall); + REGISTER_STRING(HorovodReducescatter); #undef REGISTER_STRING } diff --git a/horovod/common/nvtx_op_range.h b/horovod/common/nvtx_op_range.h index 8c47351a6b..dbcde5b972 100644 --- a/horovod/common/nvtx_op_range.h +++ b/horovod/common/nvtx_op_range.h @@ -16,7 +16,8 @@ enum class RegisteredNvtxOp { HorovodBroadcast, HorovodAlltoall, HorovodReducescatter, - // Insert new enum values above this line + // Insert values for new ops above this line. Also add corresponding + // REGISTER_STRING lines in the constructor NvtxOpsHandle::NvtxOpsHandle(). END, }; From a75f20a20f7fdc9f8cfca77529bca16a81891f60 Mon Sep 17 00:00:00 2001 From: "Max H. Gerlach" Date: Thu, 9 Jun 2022 20:09:54 +0200 Subject: [PATCH 2/3] Make destructors of abstract base classes virtual Signed-off-by: Max H. Gerlach --- horovod/common/controller.h | 2 ++ horovod/common/mpi/mpi_controller.h | 2 -- horovod/common/operations.cc | 2 +- horovod/common/ops/gloo_operations.h | 6 ++---- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/horovod/common/controller.h b/horovod/common/controller.h index 00bff4b5d9..8278d8de58 100644 --- a/horovod/common/controller.h +++ b/horovod/common/controller.h @@ -42,6 +42,8 @@ class Controller : public std::enable_shared_from_this { Controller(const Controller&) = delete; + virtual ~Controller() = default; + void Initialize(); virtual int GetTypeSize(DataType dtype) = 0; diff --git a/horovod/common/mpi/mpi_controller.h b/horovod/common/mpi/mpi_controller.h index 5b645ca0ad..3397351d0f 100644 --- a/horovod/common/mpi/mpi_controller.h +++ b/horovod/common/mpi/mpi_controller.h @@ -36,8 +36,6 @@ class MPIController : public Controller { LOG(DEBUG) << "MPI Controller constructed."; } - virtual ~MPIController()=default; - int GetTypeSize(DataType dtype) override; void CrossRankBitwiseAnd(std::vector& bitvector, diff --git a/horovod/common/operations.cc b/horovod/common/operations.cc index c67b2a146b..5ab38dd5f9 100644 --- a/horovod/common/operations.cc +++ b/horovod/common/operations.cc @@ -629,7 +629,7 @@ void BackgroundThreadLoop(HorovodGlobalState& state) { int id; GetProcessSetOrAddUnitialized(process_set_ranks, id); } - int32_t initialized_count; + int32_t initialized_count = 0; #if HAVE_MPI if (state.control_operation == LibType::MPI) { initialized_count = diff --git a/horovod/common/ops/gloo_operations.h b/horovod/common/ops/gloo_operations.h index 7d1c577efd..7f58a1a81b 100644 --- a/horovod/common/ops/gloo_operations.h +++ b/horovod/common/ops/gloo_operations.h @@ -43,14 +43,14 @@ class IGlooAlgorithms { std::vector& recvcounts) = 0; virtual int ElementSize() const = 0; + + virtual ~IGlooAlgorithms() = default; }; template class GlooAlgorithms : public IGlooAlgorithms { public: explicit GlooAlgorithms(GlooContext* gloo_context); - ~GlooAlgorithms() = default; - void Allreduce(void* buffer_data, int num_elements) override; void Allgather(void* buffer_data, void* buffer_out, int* recvcounts, @@ -74,8 +74,6 @@ class GlooAllreduce : public AllreduceOp { public: explicit GlooAllreduce(HorovodGlobalState* global_state); - virtual ~GlooAllreduce() = default; - Status Execute(std::vector& entries, const Response& response) override; From 0e863e1bc4dd514cc308264c5808920a2a87db93 Mon Sep 17 00:00:00 2001 From: "Max H. Gerlach" Date: Thu, 9 Jun 2022 20:51:17 +0200 Subject: [PATCH 3/3] Update changelog Signed-off-by: Max H. Gerlach --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a44cb3e608..fea59f95fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added -- Added `hvd.reducescatter()` operation with implementations in NCCL, MPI, and Gloo. ([#3299](https://github.com/horovod/horovod/pull/3299)) +- Added `hvd.reducescatter()` operation with implementations in NCCL, MPI, and Gloo. ([#3299](https://github.com/horovod/horovod/pull/3299), [#3574](https://github.com/horovod/horovod/pull/3574)) - Spark: expose random seed as an optional parameter. ([#3517](https://github.com/horovod/horovod/pull/3517))