Skip to content

Commit

Permalink
clear up the code
Browse files Browse the repository at this point in the history
  • Loading branch information
zpcore committed Jun 26, 2024
1 parent c5d4626 commit 5825df1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 37 deletions.
4 changes: 2 additions & 2 deletions torch_xla/csrc/runtime/computation_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ComputationClient {
// of device.
// 3. xla::XlaComputation represent a xla computation, it is generated by the
// xla compiler.
// 4. xla::PjRtCompilationClient::PjRtComputation which inherits from
// 4. xla::PjRtComputationClient::PjRtComputation which inherits from
// runtime::ComputationClient::Computation and contains a handle to represent
// the compiled program.
class Computation : public torch::lazy::Computation {
Expand Down Expand Up @@ -126,7 +126,7 @@ class ComputationClient {
// ...
// 3. To represent a computation that is already compiled. In this case
// name_ and hash_ are not required. Computation will be a wrapper around
// an executable, PjRtCompilationClient::PjRtComputation in our case. It
// an executable, PjRtComputationClient::PjRtComputation in our case. It
// is not ideal to use same class for 3 different purposes but this is
// the path took by upstream ltc.
Computation(xla::XlaComputation computation,
Expand Down
31 changes: 0 additions & 31 deletions torch_xla/csrc/runtime/pjrt_compilation_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ class PjRtCompilationClient : public ComputationClient {

std::intptr_t GetCudaStreamForDevice(int local_device_id) const override {
return 0;
// absl::StatusOr<xla::PjRtDevice*> pjrt_device =
// client_->LookupAddressableDevice(
// xla::PjRtLocalDeviceId(local_device_id));
// XLA_CHECK(pjrt_device.ok()) << "Failed to get a PjRt device.";
// absl::StatusOr<std::intptr_t> stream =
// pjrt_device.value()->GetStreamForExternalReadyEvents();
// XLA_CHECK(stream.ok()) << "Failed to get a stream.";
// return stream.value();
}

std::vector<std::string> GetLocalDevices() const override;
Expand Down Expand Up @@ -289,29 +281,6 @@ class PjRtCompilationClient : public ComputationClient {
xla::OpSharding sharding;
};

// struct PjRtComputation : public Computation {
// PjRtComputation(xla::XlaComputation computation,
// std::vector<std::string> devices,
// std::unique_ptr<xla::PjRtLoadedExecutable> executable)
// : Computation(std::move(computation), std::move(devices)),
// executable(std::move(executable)) {
// output_shardings_ = this->executable->GetOutputShardings();
// }

// const std::string get_memory_info() const override {
// auto memory_stats_status_or = executable->GetCompiledMemoryStats();
// if (memory_stats_status_or.ok()) {
// return memory_stats_status_or.value().DebugString();
// } else {
// return "memory usage is not availiable";
// }
// }

// std::unique_ptr<xla::PjRtLoadedExecutable> executable;
// std::optional<std::vector<xla::OpSharding>> output_shardings_;
// };

// Used for AOT compilation.
struct PjRtUnloadedComputation : public Computation {
PjRtUnloadedComputation(xla::XlaComputation computation,
std::vector<std::string> devices,
Expand Down
2 changes: 0 additions & 2 deletions torch_xla/csrc/runtime/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ void SetVirtualTopology(const std::string& topology) {
aot_topology = topology;
}

std::string GetVirtualTopology() { return aot_topology; }

ComputationClient* GetComputationClientIfInitialized() {
return g_computation_client_initialized ? GetComputationClient() : nullptr;
}
Expand Down
2 changes: 0 additions & 2 deletions torch_xla/csrc/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ ComputationClient* GetComputationClientIfInitialized();

void SetVirtualTopology(const std::string& topology);

std::string GetVirtualTopology();

// Run the XRT local service, this will block the caller unitl the server
// being stopped.
void RunLocalService(uint64_t service_port);
Expand Down

0 comments on commit 5825df1

Please sign in to comment.