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

Remove some unused code from csrc/runtime #5785

Merged
merged 9 commits into from
Nov 13, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions torch_xla/csrc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ ptxla_cc_library(
":layout_manager",
":shape_builder",
":shape_helper",
"//torch_xla/csrc/runtime:async_task",
"//torch_xla/csrc/runtime",
"//torch_xla/csrc/runtime:stablehlo_helper",
"//torch_xla/csrc/runtime:unique",
"//torch_xla/csrc/runtime:xla_util",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/memory",
Expand Down
6 changes: 3 additions & 3 deletions torch_xla/csrc/debug_util.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "torch_xla/csrc/debug_util.h"

#include <torch/csrc/lazy/core/hash.h>
#include <torch/csrc/lazy/core/unique.h>
#include <torch/csrc/lazy/python/python_util.h>

#include <fstream>
Expand All @@ -17,7 +18,6 @@
#include "torch_xla/csrc/ir_dump_util.h"
#include "torch_xla/csrc/runtime/debug_macros.h"
#include "torch_xla/csrc/runtime/sys_util.h"
#include "torch_xla/csrc/runtime/unique.h"
#include "torch_xla/csrc/xla_graph_executor.h"

namespace torch_xla {
Expand Down Expand Up @@ -61,7 +61,7 @@ std::string DebugUtil::GetTensorsGraphHlo(
absl::Span<const XLATensorPtr> tensors, const std::vector<size_t>* indices,
bool dump_stablehlo) {
std::vector<torch::lazy::Value> root_values;
runtime::util::Unique<torch::lazy::BackendDevice> unique_device;
torch::lazy::Unique<torch::lazy::BackendDevice> unique_device;
if (indices != nullptr) {
for (auto index : *indices) {
const XLATensorPtr& tensor = tensors[index];
Expand Down Expand Up @@ -91,7 +91,7 @@ std::string DebugUtil::GetTensorsGraphInfo(
std::vector<const torch::lazy::Node*> root_nodes;
std::vector<torch::lazy::Value> root_values;
std::vector<torch::lazy::hash_t> root_hashes;
runtime::util::Unique<torch::lazy::BackendDevice> unique_device;
torch::lazy::Unique<torch::lazy::BackendDevice> unique_device;
if (indices != nullptr) {
for (auto index : *indices) {
const XLATensorPtr& tensor = tensors[index];
Expand Down
3 changes: 2 additions & 1 deletion torch_xla/csrc/layout_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class LayoutManager {

struct DimensionsHasher {
size_t operator()(const absl::Span<const int64_t>& dimensions) const {
return runtime::util::HashReduce(runtime::util::MHash(dimensions));
return torch::lazy::HashReduce(torch::lazy::MHash(
std::vector<int64_t>({dimensions.begin(), dimensions.end()})));
}
};

Expand Down
52 changes: 7 additions & 45 deletions torch_xla/csrc/runtime/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,15 @@ load(
"if_cuda_is_configured",
)

load(
"//bazel:rules_def.bzl",
"ptxla_cc_test",
)

licenses(["notice"]) # Apache 2.0

package(default_visibility = ["//visibility:public"])

cc_library(
name = "async_task",
hdrs = ["async_task.h"],
deps = [
":debug_macros",
":thread_pool",
"@com_google_absl//absl/types:optional",
],
)

cc_test(
name = "async_task_test",
size = "small",
srcs = ["async_task_test.cc"],
deps = [
":async_task",
"@com_google_googletest//:gtest_main",
],
)

cc_library(
name = "runtime",
srcs = [
Expand Down Expand Up @@ -201,20 +186,6 @@ cc_library(
],
)

cc_library(
name = "nccl_distributed",
srcs = ["nccl_distributed.cc"],
hdrs = ["nccl_distributed.h"],
deps = [
":debug_macros",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
"@xla//xla:types",
] + if_cuda_is_configured([
"@local_config_nccl//:nccl",
]),
)

cc_library(
name = "profiler",
srcs = ["profiler.cc"],
Expand Down Expand Up @@ -302,18 +273,8 @@ cc_library(
],
)

cc_library(
name = "unique",
hdrs = ["unique.h"],
deps = [
":debug_macros",
"@com_google_absl//absl/types:optional",
],
)

cc_library(
name = "util",
srcs = ["util.cc"],
hdrs = ["util.h"],
deps = [
":types",
Expand Down Expand Up @@ -356,10 +317,11 @@ cc_library(
"@xla//xla/service:platform_util",
"@xla//xla/service/spmd:spmd_partitioner",
"@tsl//tsl/platform:errors",
"@torch//:headers",
],
)

cc_test(
ptxla_cc_test(
name = "xla_util_test",
size = "small",
srcs = ["xla_util_test.cc"],
Expand Down
93 changes: 0 additions & 93 deletions torch_xla/csrc/runtime/async_task.h

This file was deleted.

65 changes: 0 additions & 65 deletions torch_xla/csrc/runtime/async_task_test.cc

This file was deleted.

71 changes: 0 additions & 71 deletions torch_xla/csrc/runtime/nccl_distributed.cc

This file was deleted.

19 changes: 0 additions & 19 deletions torch_xla/csrc/runtime/nccl_distributed.h

This file was deleted.

Loading