aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Eli Bendersky <eliben@google.com>2017-05-24 14:30:42 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-05-24 14:36:45 -0700
commit1589930c353d0c0c702d3be448c87c5efa99fee3 (patch)
tree6718cfbca9fb3bc975aba926ec5b88c050cdcb3a
parent625ce1ac462292fb4bc76a06343f170871cb428c (diff)
[XLA] Remove stream priming from Backend
This was originally added a long time ago to help with GPU benchmarks; I think it adds needless complexity to the Backend class, which we intend to simplify. If this is still an issue for benchmarks, it should be done on a higher level. PiperOrigin-RevId: 157037991
-rw-r--r--tensorflow/compiler/xla/service/backend.cc11
-rw-r--r--tensorflow/compiler/xla/service/backend.h8
2 files changed, 0 insertions, 19 deletions
diff --git a/tensorflow/compiler/xla/service/backend.cc b/tensorflow/compiler/xla/service/backend.cc
index 1913617fec..5fa515f9c2 100644
--- a/tensorflow/compiler/xla/service/backend.cc
+++ b/tensorflow/compiler/xla/service/backend.cc
@@ -99,8 +99,6 @@ struct Backend::EigenThreadPoolWrapper {
std::unique_ptr<Backend> backend(
new Backend(replica_count, platform, compiler, stream_executors,
transfer_manager, options.intra_op_parallelism_threads()));
- TF_RETURN_IF_ERROR(backend->PoolStreams(kInitialStreamsToPool,
- backend->default_stream_executor()));
return std::move(backend);
}
@@ -113,15 +111,6 @@ Backend::CreateDefaultBackend() {
return CreateBackend(backend_options);
}
-tensorflow::Status Backend::PoolStreams(int n, se::StreamExecutor* executor) {
- std::vector<StreamPtr> primed;
- for (int i = 0; i < n; ++i) {
- TF_ASSIGN_OR_RETURN(auto stream, BorrowStream(executor));
- primed.emplace_back(std::move(stream));
- }
- return tensorflow::Status::OK();
-}
-
StatusOr<Backend::StreamPtr> Backend::BorrowStream(int device_ordinal) {
TF_ASSIGN_OR_RETURN(auto exec, stream_executor(device_ordinal));
return BorrowStream(exec);
diff --git a/tensorflow/compiler/xla/service/backend.h b/tensorflow/compiler/xla/service/backend.h
index 1068bac277..dffb1f910c 100644
--- a/tensorflow/compiler/xla/service/backend.h
+++ b/tensorflow/compiler/xla/service/backend.h
@@ -74,9 +74,6 @@ class Backend {
public:
using StreamPtr = Pool<perftools::gputools::Stream>::SmartPtr;
- // The number of streams we create for the pool at initialization time.
- static constexpr int kInitialStreamsToPool = 8;
-
// Creates a new backend for the given platform with the given number of
// replicas.
static StatusOr<std::unique_ptr<Backend>> CreateBackend(
@@ -133,11 +130,6 @@ class Backend {
return stream_executors_[0];
}
- // Primes the internal pool of streams for BorrowStream with n initialized
- // stream instances.
- tensorflow::Status PoolStreams(int n,
- perftools::gputools::StreamExecutor* executor);
-
// Borrows a stream for use by the caller, either by grabbing it from an
// internal pool, or by constructing/initializating it, and returns the result
// to the caller.