Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase gRPC max receive message size for federated learning #7958

Merged
merged 1 commit into from Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugin/federated/federated_client.h
Expand Up @@ -8,6 +8,7 @@

#include <cstdio>
#include <cstdlib>
#include <limits>
#include <string>

namespace xgboost {
Expand All @@ -25,8 +26,10 @@ class FederatedClient {
options.pem_root_certs = server_cert;
options.pem_private_key = client_key;
options.pem_cert_chain = client_cert;
grpc::ChannelArguments args;
args.SetMaxReceiveMessageSize(std::numeric_limits<int>::max());
return Federated::NewStub(
grpc::CreateChannel(server_address, grpc::SslCredentials(options)));
grpc::CreateCustomChannel(server_address, grpc::SslCredentials(options), args));
}()},
rank_{rank} {}

Expand Down
1 change: 1 addition & 0 deletions plugin/federated/federated_server.cc
Expand Up @@ -221,6 +221,7 @@ void RunServer(int port, int world_size, char const* server_key_file, char const
key.private_key = ReadFile(server_key_file);
key.cert_chain = ReadFile(server_cert_file);
options.pem_key_cert_pairs.push_back(key);
builder.SetMaxReceiveMessageSize(std::numeric_limits<int>::max());
builder.AddListeningPort(server_address, grpc::SslServerCredentials(options));
builder.RegisterService(&service);
std::unique_ptr<grpc::Server> server(builder.BuildAndStart());
Expand Down