A Federated Learning communicator class that handles collective communication.
More...
#include <federated_communicator.h>
|
| FederatedCommunicator (int world_size, int rank, std::string const &server_address, std::string const &server_cert_path, std::string const &client_key_path, std::string const &client_cert_path) |
| Construct a new federated communicator.
|
|
| FederatedCommunicator (int world_size, int rank, std::string const &server_address) |
| Construct an insecure federated communicator without using SSL.
|
|
bool | IsDistributed () const override |
| Get if the communicator is distributed.
|
|
bool | IsFederated () const override |
| Get if the communicator is federated.
|
|
void | AllGather (void *send_receive_buffer, std::size_t size) override |
| Perform in-place allgather.
|
|
void | AllReduce (void *send_receive_buffer, std::size_t count, DataType data_type, Operation op) override |
| Perform in-place allreduce.
|
|
void | Broadcast (void *send_receive_buffer, std::size_t size, int root) override |
| Broadcast a memory region to all others from root.
|
|
std::string | GetProcessorName () override |
| Get the name of the processor.
|
|
void | Print (const std::string &message) override |
| Print the message to the communicator.
|
|
int | GetWorldSize () const |
| Get the total number of processes.
|
|
int | GetRank () const |
| Get the rank of the current processes.
|
|
|
static Communicator * | Create (Json const &config) |
| Create a new communicator based on JSON configuration.
|
|
static void | Init (Json const &config) |
| Initialize the communicator.
|
|
static void | Finalize () |
| Finalize the communicator.
|
|
static Communicator * | Get () |
| Get the communicator instance.
|
|
static CommunicatorType | GetTypeFromEnv () |
| Get the communicator type from environment variables.
|
|
static CommunicatorType | GetTypeFromConfig (Json const &config) |
| Get the communicator type from runtime configuration.
|
|
|
void | Shutdown () override |
| Shuts down the communicator.
|
|
| Communicator (int world_size, int rank) |
| Construct a new communicator.
|
|
A Federated Learning communicator class that handles collective communication.
◆ FederatedCommunicator() [1/2]
xgboost::collective::FederatedCommunicator::FederatedCommunicator |
( |
int |
world_size, |
|
|
int |
rank, |
|
|
std::string const & |
server_address, |
|
|
std::string const & |
server_cert_path, |
|
|
std::string const & |
client_key_path, |
|
|
std::string const & |
client_cert_path |
|
) |
| |
|
inline |
Construct a new federated communicator.
- Parameters
-
world_size | Total number of processes. |
rank | Rank of the current process. |
server_address | Address of the federated server (host:port). |
server_cert_path | Path to the server cert file. |
client_key_path | Path to the client key file. |
client_cert_path | Path to the client cert file. |
◆ FederatedCommunicator() [2/2]
xgboost::collective::FederatedCommunicator::FederatedCommunicator |
( |
int |
world_size, |
|
|
int |
rank, |
|
|
std::string const & |
server_address |
|
) |
| |
|
inline |
Construct an insecure federated communicator without using SSL.
- Parameters
-
world_size | Total number of processes. |
rank | Rank of the current process. |
server_address | Address of the federated server (host:port). |
◆ AllGather()
void xgboost::collective::FederatedCommunicator::AllGather |
( |
void * |
send_receive_buffer, |
|
|
std::size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
Perform in-place allgather.
- Parameters
-
send_receive_buffer | Buffer for both sending and receiving data. |
size | Number of bytes to be gathered. |
Implements xgboost::collective::Communicator.
◆ AllReduce()
void xgboost::collective::FederatedCommunicator::AllReduce |
( |
void * |
send_receive_buffer, |
|
|
std::size_t |
count, |
|
|
DataType |
data_type, |
|
|
Operation |
op |
|
) |
| |
|
inlineoverridevirtual |
Perform in-place allreduce.
- Parameters
-
send_receive_buffer | Buffer for both sending and receiving data. |
count | Number of elements to be reduced. |
data_type | Enumeration of data type. |
op | Enumeration of operation type. |
Implements xgboost::collective::Communicator.
◆ Broadcast()
void xgboost::collective::FederatedCommunicator::Broadcast |
( |
void * |
send_receive_buffer, |
|
|
std::size_t |
size, |
|
|
int |
root |
|
) |
| |
|
inlineoverridevirtual |
Broadcast a memory region to all others from root.
- Parameters
-
send_receive_buffer | Pointer to the send or receive buffer. |
size | Size of the data. |
root | The process rank to broadcast from. |
Implements xgboost::collective::Communicator.
◆ Create()
static Communicator * xgboost::collective::FederatedCommunicator::Create |
( |
Json const & |
config | ) |
|
|
inlinestatic |
Create a new communicator based on JSON configuration.
- Parameters
-
config | JSON configuration. |
- Returns
- Communicator as specified by the JSON configuration.
◆ GetProcessorName()
std::string xgboost::collective::FederatedCommunicator::GetProcessorName |
( |
| ) |
|
|
inlineoverridevirtual |
◆ IsDistributed()
bool xgboost::collective::FederatedCommunicator::IsDistributed |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ IsFederated()
bool xgboost::collective::FederatedCommunicator::IsFederated |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ Print()
void xgboost::collective::FederatedCommunicator::Print |
( |
const std::string & |
message | ) |
|
|
inlineoverridevirtual |
◆ Shutdown()
void xgboost::collective::FederatedCommunicator::Shutdown |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
The documentation for this class was generated from the following file: