Skip to content

Commit

Permalink
IFRT proxy: Add some debug information.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 691111539
  • Loading branch information
Google-ML-Automation committed Oct 30, 2024
1 parent 7efe551 commit 8baa106
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions xla/python/ifrt_proxy/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ cc_library(
srcs = ["version.cc"],
hdrs = ["version.h"],
deps = [
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
Expand Down
3 changes: 2 additions & 1 deletion xla/python/ifrt_proxy/server/grpc_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ ::grpc::Status GrpcServiceImpl::IfrtSession(
const uint64_t session_id =
next_session_id_.fetch_add(1, std::memory_order_relaxed);

VLOG(0) << "Starting a new IFRT session with session_id=" << session_id;
VLOG(0) << "Starting a new IFRT session with session_id=" << session_id
<< ", version=" << metadata.version();

// Create a host buffer store for the session.
auto host_buffer_store =
Expand Down
8 changes: 8 additions & 0 deletions xla/python/ifrt_proxy/server/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <algorithm>

#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
Expand All @@ -32,6 +33,13 @@ absl::StatusOr<int> ChooseVersion(int client_min_version,
int server_max_version) {
const int version = std::min(server_max_version, client_max_version);

LOG(INFO) << "IFRT proxy: ChooseVersion(client_min_version="
<< client_min_version
<< ", client_max_version=" << client_max_version
<< ", server_min_version=" << server_min_version
<< ", server_max_version=" << server_max_version << ") is "
<< version;

if (version < server_min_version || version < client_min_version) {
return absl::InvalidArgumentError(absl::StrCat(
"IFRT Proxy client and server failed to agree on the "
Expand Down

0 comments on commit 8baa106

Please sign in to comment.