Skip to content

Commit 1d6c1b9

Browse files
cheshirecopybara-github
authored andcommitted
[XLA] [NFC] Dead code cleanup
PiperOrigin-RevId: 580553693
1 parent 2f4c3e8 commit 1d6c1b9

File tree

5 files changed

+0
-68
lines changed

5 files changed

+0
-68
lines changed

xla/service/compile_only_service.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ class CompileOnlyService : public Service {
5757
GetDeviceHandlesResponse* result) override {
5858
return Unimplemented("CompileOnlyService does not support devices.");
5959
}
60-
Status WaitForExecution(const WaitForExecutionRequest* arg,
61-
WaitForExecutionResponse* result) override {
62-
return Unimplemented("CompileOnlyService does not support execution.");
63-
}
6460
Status TransferToServer(const TransferToServerRequest* arg,
6561
TransferToServerResponse* result) override {
6662
return Unimplemented(

xla/service/service.cc

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,6 @@ const std::optional<std::set<int>>& ServiceOptions::allowed_devices() const {
130130
return allowed_devices_;
131131
}
132132

133-
/* static */ StatusOr<std::unique_ptr<Service>> Service::NewService(
134-
se::Platform* platform) {
135-
ServiceOptions default_options;
136-
default_options.set_platform(platform);
137-
return NewService(default_options);
138-
}
139-
140-
/* static */ StatusOr<std::unique_ptr<Service>> Service::NewService(
141-
const ServiceOptions& options) {
142-
se::Platform* platform = options.platform();
143-
std::unique_ptr<Backend> execute_backend;
144-
if (platform == nullptr) {
145-
TF_ASSIGN_OR_RETURN(platform, PlatformUtil::GetDefaultPlatform());
146-
}
147-
BackendOptions backend_options;
148-
backend_options.set_platform(platform);
149-
backend_options.set_allowed_devices(options.allowed_devices());
150-
TF_ASSIGN_OR_RETURN(execute_backend, Backend::CreateBackend(backend_options));
151-
152-
std::unique_ptr<Service> service(
153-
new Service(options, std::move(execute_backend)));
154-
return std::move(service);
155-
}
156-
157133
Service::Service(const ServiceOptions& options,
158134
std::unique_ptr<Backend> execute_backend)
159135
: options_(options),
@@ -925,21 +901,6 @@ Status Service::Execute(const ExecuteRequest* arg, ExecuteResponse* result) {
925901
return OkStatus();
926902
}
927903

928-
Status Service::WaitForExecution(const WaitForExecutionRequest* arg,
929-
WaitForExecutionResponse* result) {
930-
TF_ASSIGN_OR_RETURN(const auto execution,
931-
execution_tracker_.Resolve(arg->execution()));
932-
933-
TF_RETURN_IF_ERROR(execution->BlockUntilDone());
934-
935-
*result->mutable_output() = execution->result();
936-
*result->mutable_profile() = execution->profile();
937-
938-
TF_RETURN_IF_ERROR(execution_tracker_.Unregister(arg->execution()));
939-
VLOG(1) << "successfully completed 'wait-for-execution' request";
940-
return OkStatus();
941-
}
942-
943904
Status Service::TransferToClient(const TransferToClientRequest* arg,
944905
TransferToClientResponse* result) {
945906
TF_ASSIGN_OR_RETURN(const ShapedBuffer* shaped_buffer,

xla/service/service.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ class ServiceOptions {
8080
// (target-specific compiler, StreamExecutor).
8181
class Service : public ServiceInterface {
8282
public:
83-
// Factory method for creating a new Service.
84-
static StatusOr<std::unique_ptr<Service>> NewService(
85-
se::Platform* platform = nullptr);
86-
static StatusOr<std::unique_ptr<Service>> NewService(
87-
const ServiceOptions& options);
88-
8983
// Unregisters a previously-allocated global handle.
9084
//
9185
// If the handle given is not currently allocated, a NOT_FOUND status is
@@ -124,13 +118,6 @@ class Service : public ServiceInterface {
124118
Status GetDeviceHandles(const GetDeviceHandlesRequest* arg,
125119
GetDeviceHandlesResponse* result) override;
126120

127-
// Waits until the specified execution is complete and returns the result.
128-
// Calling this API multiple times with the same execution handle returns the
129-
// method with an error since the execution handle is destroyed after the
130-
// first call.
131-
Status WaitForExecution(const WaitForExecutionRequest* arg,
132-
WaitForExecutionResponse* result) override;
133-
134121
// Requests that global data be transferred to the client in literal form.
135122
Status TransferToClient(const TransferToClientRequest* arg,
136123
TransferToClientResponse* result) override;

xla/service_interface.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ class ServiceInterface {
5656
virtual Status ExecuteGraphParallel(const ExecuteGraphParallelRequest* arg,
5757
ExecuteParallelResponse* result) = 0;
5858

59-
virtual Status WaitForExecution(const WaitForExecutionRequest* arg,
60-
WaitForExecutionResponse* result) = 0;
61-
6259
virtual Status DeconstructTuple(const DeconstructTupleRequest* arg,
6360
DeconstructTupleResponse* result) = 0;
6461

xla/xla.proto

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -983,15 +983,6 @@ message ExecuteParallelResponse {
983983
repeated ExecuteResponse responses = 1;
984984
}
985985

986-
message WaitForExecutionRequest {
987-
ExecutionHandle execution = 1;
988-
}
989-
990-
message WaitForExecutionResponse {
991-
GlobalDataHandle output = 1;
992-
ExecutionProfile profile = 2;
993-
}
994-
995986
message ComputeConstantGraphRequest {
996987
HloModuleProto computation = 1;
997988
LayoutProto output_layout = 2;

0 commit comments

Comments
 (0)