aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-02-22 11:27:54 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-02-22 11:47:24 -0800
commitafd9d7ffdd510f4b8a11cf71313ea68b8760822b (patch)
treecd7bce1417f6fc93427f229af94e711a201035d7
parentfe37c8c2178e78befcfeca697a5431ffb0f4406c (diff)
When a BFCAllocator instance fails to satisfy an allocation request, log the
name of the allocator prior to the status dump. Also, add the GPU id to the corresponding BFCAllocator name. Change: 148245795
-rw-r--r--tensorflow/core/common_runtime/bfc_allocator.cc10
-rw-r--r--tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc4
2 files changed, 8 insertions, 6 deletions
diff --git a/tensorflow/core/common_runtime/bfc_allocator.cc b/tensorflow/core/common_runtime/bfc_allocator.cc
index 38ce446707..b18209cb60 100644
--- a/tensorflow/core/common_runtime/bfc_allocator.cc
+++ b/tensorflow/core/common_runtime/bfc_allocator.cc
@@ -215,8 +215,8 @@ void* BFCAllocator::AllocateRaw(size_t unused_alignment, size_t num_bytes,
if (log_counter < 10) {
log_counter++;
LOG(WARNING)
- << "Ran out of memory trying to allocate "
- << strings::HumanReadableNumBytes(num_bytes)
+ << "Allocator (" << Name() << ") ran out of memory trying "
+ << "to allocate " << strings::HumanReadableNumBytes(num_bytes)
<< ". The caller indicates that this is not a failure, but"
<< " may mean that there could be performance gains if more"
<< " memory is available.";
@@ -270,11 +270,11 @@ void* BFCAllocator::AllocateRawInternal(size_t unused_alignment,
// couldn't find one. This means we must have run out of memory,
// Dump the memory log for analysis.
if (dump_log_on_failure) {
+ LOG(WARNING) << "Allocator (" << Name() << ") ran out of memory trying "
+ << "to allocate " << strings::HumanReadableNumBytes(num_bytes)
+ << ". Current allocation summary follows.";
DumpMemoryLog(rounded_bytes);
LOG(WARNING) << RenderOccupancy();
- LOG(WARNING) << "Ran out of memory trying to allocate "
- << strings::HumanReadableNumBytes(num_bytes)
- << ". See logs for memory state.";
}
return nullptr;
}
diff --git a/tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc b/tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc
index 54c7baf680..3ece54523f 100644
--- a/tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc
+++ b/tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc
@@ -16,6 +16,7 @@ limitations under the License.
#include "tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.h"
#include "tensorflow/core/common_runtime/gpu/gpu_init.h"
+#include "tensorflow/core/lib/strings/strcat.h"
namespace gpu = ::perftools::gputools;
@@ -29,6 +30,7 @@ GPUBFCAllocator::GPUBFCAllocator(int device_id, size_t total_memory,
: BFCAllocator(
new GPUMemAllocator(
GPUMachineManager()->ExecutorForDevice(device_id).ValueOrDie()),
- total_memory, gpu_options.allow_growth(), "gpu_bfc") {}
+ total_memory, gpu_options.allow_growth(),
+ strings::StrCat("GPU_", device_id, "_bfc")) {}
} // namespace tensorflow