nvflare.app_opt.xgboost.histogram_based_v2.adaptors.grpc_client_adaptor module

class GrpcClientAdaptor(int_server_grpc_options=None, in_process=False, per_msg_timeout=10.0, tx_timeout=100.0)[source]

Bases: XGBClientAdaptor, FederatedServicer

Implementation of XGBClientAdaptor that uses an internal GrpcServer.

The GrpcClientAdaptor class serves as an interface between the XGBoost federated client and federated server components. It employs its XGBRunner to initiate an XGBoost federated gRPC client and utilizes an internal GrpcServer to forward client requests/responses.

The communication flow is as follows:

  1. XGBoost federated gRPC client talks to GrpcClientAdaptor, which encapsulates a GrpcServer. Requests are then forwarded to GrpcServerAdaptor, which internally manages a GrpcClient responsible for interacting with the XGBoost federated gRPC server.

  2. XGBoost federated gRPC server talks to GrpcServerAdaptor, which encapsulates a GrpcClient. Responses are then forwarded to GrpcClientAdaptor, which internally manages a GrpcServer responsible for interacting with the XGBoost federated gRPC client.

Constructor method to initialize the object.

Parameters:
  • int_server_grpc_options – An optional list of key-value pairs (channel_arguments in gRPC Core runtime) to configure the gRPC channel of internal GrpcServer.

  • in_process (bool) – Specifies whether to start the XGBRunner in the same process or not.

  • per_msg_timeout – Request per-msg timeout

  • tx_timeout – timeout for the whole req transaction

Allgather(request: AllgatherRequest, context)[source]

Missing associated documentation comment in .proto file.

Allreduce(request: AllreduceRequest, context)[source]

Missing associated documentation comment in .proto file.

Broadcast(request: BroadcastRequest, context)[source]

Missing associated documentation comment in .proto file.

initialize(fl_ctx: FLContext)[source]

Initializes the adaptor.

Parameters:

fl_ctx – the FL context

Returns: None

start(fl_ctx: FLContext)[source]

Starts the target. If any error occurs when starting the target, this method should raise an exception.

Parameters:

fl_ctx – the FL context.

Returns: None

stop(fl_ctx: FLContext)[source]

Stops the target. If any error occurs when stopping the target, this method should raise an exception.

Parameters:

fl_ctx – the FL context.

Returns: None