nvflare.app_opt.xgboost.histogram_based_v2.grpc_client module

class GrpcClient(server_addr, grpc_options=None)[source]

Bases: object

This class implements a gRPC XGB Client that is capable of sending XGB operations to a gRPC XGB Server.

Constructor

Parameters:
  • server_addr – address of the gRPC server to connect to

  • grpc_options – gRPC options for the gRPC client

send_allgather(seq_num, rank, data: bytes)[source]

Send Allgather request to gRPC server

Parameters:
  • seq_num – sequence number

  • rank – rank of the client

  • data – the send_buf data

Returns: an AllgatherReply object; or None if processing error is encountered

send_allgatherv(seq_num, rank, data: bytes)[source]

Send AllgatherV request to gRPC server

Parameters:
  • seq_num – sequence number

  • rank – rank of the client

  • data – the send_buf data

Returns: an AllgatherVReply object; or None if processing error is encountered

send_allreduce(seq_num, rank, data: bytes, data_type, reduce_op)[source]

Send Allreduce request to gRPC server

Parameters:
  • seq_num – sequence number

  • rank – rank of the client

  • data – the send_buf data

  • data_type – data type of the input

  • reduce_op – reduce op to be performed

Returns: an AllreduceReply object; or None if processing error is encountered

send_broadcast(seq_num, rank, data: bytes, root)[source]

Send Broadcast request to gRPC server

Parameters:
  • seq_num – sequence number

  • rank – rank of the client

  • data – the send_buf data

  • root – rank of the root

Returns: a BroadcastReply object; or None if processing error is encountered

start(ready_timeout=10)[source]

Start the gRPC client and wait for the server to be ready.

Parameters:

ready_timeout – how long to wait for the server to be ready

Returns: None

stop()[source]

Stop the gRPC client

Returns: None