From d8cc88a19d8a8c61023c34395cce55593a498cbf Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Tue, 8 May 2018 18:16:47 -0700 Subject: [PATCH] [XLA] Make XlaAllocator obey retry_on_failure arg. Previously we ignored it. PiperOrigin-RevId: 195908178 --- tensorflow/compiler/jit/xla_launch_util.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tensorflow/compiler/jit/xla_launch_util.cc b/tensorflow/compiler/jit/xla_launch_util.cc index 0223f97..e12e88f 100644 --- a/tensorflow/compiler/jit/xla_launch_util.cc +++ b/tensorflow/compiler/jit/xla_launch_util.cc @@ -62,7 +62,10 @@ XlaAllocator::~XlaAllocator() {} xla::StatusOr XlaAllocator::Allocate( int device_ordinal, uint64 size, bool retry_on_failure) { - void* data = wrapped_->AllocateRaw(Allocator::kAllocatorAlignment, size); + AllocationAttributes attrs; + attrs.no_retry_on_failure = !retry_on_failure; + void* data = + wrapped_->AllocateRaw(Allocator::kAllocatorAlignment, size, attrs); if (data == nullptr) { return errors::ResourceExhausted("Out of memory while trying to allocate ", size, " bytes."); -- 2.7.4