Remove the TENSORFLOW_MEM_DEBUG compilation flag from the path that passes TF op name etc. to BFCAllocator, i.e. enable the passing by default.

PiperOrigin-RevId: 301718627
Change-Id: I80d75f1d7141b80f3454b79fbb4befe60b2d6d8c
This commit is contained in:
A. Unique TensorFlower 2020-03-18 19:13:05 -07:00 committed by TensorFlower Gardener
parent a6cdce91cc
commit e377b6dbcf
5 changed files with 2 additions and 20 deletions

View File

@ -460,9 +460,7 @@ void BFCAllocator::AddTraceMe(absl::string_view traceme_name,
",bytes_available=", bytes_available,
",peak_bytes_in_use=", stats.peak_bytes_in_use,
",requested_bytes=", requested_bytes,
#ifdef TENSORFLOW_MEM_DEBUG
",tf_op=", pending_op_name, ",id=", pending_step_id,
#endif
"#");
},
traceme_level);

View File

@ -57,9 +57,7 @@ Status EagerOperation::Reset(
cancellation_manager_ = nullptr;
executor_ = executor ? executor : &ctx_.Executor();
remote_func_params_ = remote_func_params;
#ifdef TENSORFLOW_MEM_DEBUG
op_name_ = op;
#endif
return SetDeviceName(raw_device_name, true);
}

View File

@ -121,10 +121,8 @@ class EagerOperation {
return remote_func_params_;
}
#ifdef TENSORFLOW_MEM_DEBUG
const char* op_name() const { return op_name_; }
const char* op_name_ = nullptr;
#endif
Status MaybeInferSingleInputAttrs(TensorHandle* handle);
Status InferInputListAttrs(int num_inputs);

View File

@ -27,10 +27,8 @@ limitations under the License.
namespace tensorflow {
#ifdef TENSORFLOW_MEM_DEBUG
thread_local const char* pending_op_name = nullptr;
thread_local uint64 pending_step_id = 0;
#endif
string AllocatorStats::DebugString() const {
return strings::Printf(

View File

@ -62,9 +62,8 @@ struct AllocationAttributes {
TF_DISALLOW_COPY_AND_ASSIGN(AllocationAttributes);
};
// If defined, the runtime will cache Op names in thread-local memory
// and some allocators will try to tag allocations with the requesting Op.
#ifdef TENSORFLOW_MEM_DEBUG
// The runtime will cache Op names in thread-local memory and some allocators
// will try to tag allocations with the requesting Op.
extern thread_local const char* pending_op_name;
extern thread_local uint64 pending_step_id;
#define MEMDEBUG_CACHE_OP(N) \
@ -76,15 +75,6 @@ extern thread_local uint64 pending_step_id;
pending_step_id = (N); \
} while (0)
#define MEMDEBUG_CACHE_VAL pending_op_name
#else
#define MEMDEBUG_CACHE_OP(N) \
do { \
} while (0)
#define MEMDEBUG_CACHE_STEPID(N) \
do { \
} while (0)
#define MEMDEBUG_CACHE_VAL nullptr
#endif
// Runtime statistics collected by an allocator. Exactly the same as
// stream_executor::AllocatorStats, but independently defined to preserve the