Don't split input data in federated mode (#8279)
Co-authored-by: Hyunsu Philip Cho <chohyu01@cs.washington.edu>
This commit is contained in:
@@ -88,6 +88,13 @@ inline int GetWorldSize() { return Communicator::Get()->GetWorldSize(); }
|
||||
*/
|
||||
inline bool IsDistributed() { return Communicator::Get()->IsDistributed(); }
|
||||
|
||||
/*!
|
||||
* \brief Get if the communicator is federated.
|
||||
*
|
||||
* \return True if the communicator is federated.
|
||||
*/
|
||||
inline bool IsFederated() { return Communicator::Get()->IsFederated(); }
|
||||
|
||||
/*!
|
||||
* \brief Print the message to the communicator.
|
||||
*
|
||||
|
||||
@@ -78,6 +78,9 @@ class Communicator {
|
||||
/** @brief Whether the communicator is running in distributed mode. */
|
||||
virtual bool IsDistributed() const = 0;
|
||||
|
||||
/** @brief Whether the communicator is running in federated mode. */
|
||||
virtual bool IsFederated() const = 0;
|
||||
|
||||
/**
|
||||
* @brief Combines values from all processes and distributes the result back to all processes.
|
||||
*
|
||||
|
||||
@@ -16,6 +16,7 @@ class NoOpCommunicator : public Communicator {
|
||||
public:
|
||||
NoOpCommunicator() : Communicator(1, 0) {}
|
||||
bool IsDistributed() const override { return false; }
|
||||
bool IsFederated() const override { return false; }
|
||||
void AllReduce(void *send_receive_buffer, std::size_t count, DataType data_type,
|
||||
Operation op) override {}
|
||||
void Broadcast(void *send_receive_buffer, std::size_t size, int root) override {}
|
||||
|
||||
@@ -53,6 +53,8 @@ class RabitCommunicator : public Communicator {
|
||||
|
||||
bool IsDistributed() const override { return rabit::IsDistributed(); }
|
||||
|
||||
bool IsFederated() const override { return false; }
|
||||
|
||||
void AllReduce(void *send_receive_buffer, std::size_t count, DataType data_type,
|
||||
Operation op) override {
|
||||
switch (data_type) {
|
||||
|
||||
Reference in New Issue
Block a user