diff --git a/tensorflow/core/common_runtime/mkl_layout_pass.cc b/tensorflow/core/common_runtime/mkl_layout_pass.cc index 1775c686ffa..488bd8e860a 100644 --- a/tensorflow/core/common_runtime/mkl_layout_pass.cc +++ b/tensorflow/core/common_runtime/mkl_layout_pass.cc @@ -29,6 +29,7 @@ limitations under the License. #include #include #include +#include #include "absl/base/call_once.h" #include "tensorflow/core/common_runtime/function.h" @@ -240,6 +241,7 @@ namespace tensorflow { class MklLayoutRewritePass : public GraphOptimizationPass { public: MklLayoutRewritePass() { + std::cerr << "MklLayoutRewritePass()\n"; // NOTE: names are alphabetically sorted. csinfo_.addn = "AddN"; csinfo_.avg_pool = "AvgPool"; @@ -1456,7 +1458,7 @@ class MklLayoutRewritePass : public GraphOptimizationPass { DataType T; TF_CHECK_OK(GetNodeAttr(n->def(), "T", &T)); if ((T == DT_FLOAT) || (T == DT_BFLOAT16)) { - VLOG(2) << "Rewriting MatMul to _MklMatMul"; + std::cerr << "Rewriting MatMul to _MklMatMul\n"; return true; } return false; @@ -4067,6 +4069,7 @@ bool MklLayoutRewritePass::RunPass(std::unique_ptr* g) { } bool RunMklLayoutRewritePass(std::unique_ptr* g) { + std::cerr << "RunMklLayoutRewritePass\n"; return MklLayoutRewritePass().RunPass(g); } diff --git a/tensorflow/core/common_runtime/mkl_tfconversion_pass.cc b/tensorflow/core/common_runtime/mkl_tfconversion_pass.cc index 52b0310f404..9ee1a7a2a22 100644 --- a/tensorflow/core/common_runtime/mkl_tfconversion_pass.cc +++ b/tensorflow/core/common_runtime/mkl_tfconversion_pass.cc @@ -22,6 +22,7 @@ limitations under the License. #include #include #include +#include #include "tensorflow/core/common_runtime/function.h" #include "tensorflow/core/common_runtime/optimization_registry.h" @@ -298,6 +299,7 @@ Status MklToTfConversionPass::InsertInputConversionNode( } bool MklToTfConversionPass::RunPass(std::unique_ptr* g) { + std::cerr << "MklToTfConversionPass::RunPass\n"; bool result = false; CHECK_NOTNULL(g); diff --git a/tensorflow/core/common_runtime/process_state.cc b/tensorflow/core/common_runtime/process_state.cc index 56c2de67a72..46ae1328f65 100644 --- a/tensorflow/core/common_runtime/process_state.cc +++ b/tensorflow/core/common_runtime/process_state.cc @@ -18,6 +18,7 @@ limitations under the License. #include #include #include +#include #include "absl/base/call_once.h" #include "tensorflow/core/common_runtime/bfc_allocator.h" @@ -107,18 +108,23 @@ Allocator* ProcessState::GetCPUAllocator(int numa_node) { absl::WrapUnique(sub_allocator), cpu_mem_limit, /*name=*/"bfc_cpu_allocator_for_gpu", allocator_opts); - VLOG(2) << "Using BFCAllocator with memory limit of " - << cpu_mem_limit_in_mb << " MB for ProcessState CPU allocator"; + std::cerr << "Using BFCAllocator with memory limit of " + << cpu_mem_limit_in_mb << " MB for ProcessState CPU allocator" + << " numa_enabled_=" << numa_enabled_ + << " numa_node=" << numa_node << '\n'; } else if (sub_allocator) { DCHECK(sub_allocator); allocator = new PoolAllocator(/*pool_size_limit=*/100, /*auto_resize=*/true, sub_allocator, new NoopRounder, "cpu_pool"); - VLOG(2) << "Using PoolAllocator for ProcessState CPU allocator " + std::cerr << "Using PoolAllocator for ProcessState CPU allocator " << "numa_enabled_=" << numa_enabled_ - << " numa_node=" << numa_node; + << " numa_node=" << numa_node << '\n'; } else { DCHECK(!sub_allocator); + std::cerr << "Using BaseAllocator for ProcessState CPU allocator " + << "numa_enabled_=" << numa_enabled_ + << " numa_node=" << numa_node << '\n'; allocator = cpu_allocator_base(); } if (LogMemory::IsEnabled() && !allocator->TracksAllocationSizes()) { diff --git a/tensorflow/core/framework/allocator.cc b/tensorflow/core/framework/allocator.cc index 7587d7e9488..67d8721f045 100644 --- a/tensorflow/core/framework/allocator.cc +++ b/tensorflow/core/framework/allocator.cc @@ -16,6 +16,7 @@ limitations under the License. #include "tensorflow/core/framework/allocator.h" #include +#include #include "tensorflow/core/framework/allocator_registry.h" #include "tensorflow/core/framework/tracking_allocator.h" @@ -64,6 +65,7 @@ string AllocatorAttributes::DebugString() const { } Allocator* cpu_allocator_base() { + std::cerr << "cpu_allocator_base\n"; static Allocator* cpu_alloc = AllocatorFactoryRegistry::singleton()->GetAllocator(); // TODO(tucker): This really seems wrong. It's only going to be effective on @@ -84,8 +86,10 @@ Allocator* cpu_allocator(int numa_node) { static ProcessStateInterface* ps = AllocatorFactoryRegistry::singleton()->process_state(); if (ps) { + std::cerr << "cpu_allocator with ps\n"; return ps->GetCPUAllocator(numa_node); } else { + std::cerr << "cpu_allocator without ps\n"; return cpu_allocator_base(); } } diff --git a/tensorflow/core/framework/allocator_registry.cc b/tensorflow/core/framework/allocator_registry.cc index 543f35a3254..49990b6f8bc 100644 --- a/tensorflow/core/framework/allocator_registry.cc +++ b/tensorflow/core/framework/allocator_registry.cc @@ -14,6 +14,7 @@ limitations under the License. ==============================================================================*/ #include +#include #include "tensorflow/core/framework/allocator_registry.h" #include "tensorflow/core/platform/logging.h" @@ -55,6 +56,9 @@ void AllocatorFactoryRegistry::Register(const char* source_file, << " conflicts with previous registration at location " << existing->source_file << ":" << existing->source_line; } + std::cerr << "New registration for AllocatorFactory with name=" << name + << " priority=" << priority << " at location " << source_file + << ":" << source_line << '\n'; FactoryEntry entry; entry.source_file = source_file; @@ -77,6 +81,9 @@ Allocator* AllocatorFactoryRegistry::GetAllocator() { } } if (best_entry) { + std::cerr << "GetAllocator " << best_entry->name + << " priority=" << best_entry->priority << " at location " << best_entry->source_file + << ":" << best_entry->source_line << '\n'; if (!best_entry->allocator) { best_entry->allocator.reset(best_entry->factory->CreateAllocator()); } diff --git a/tensorflow/core/util/port.cc b/tensorflow/core/util/port.cc index 358b39bfb00..0794112b286 100644 --- a/tensorflow/core/util/port.cc +++ b/tensorflow/core/util/port.cc @@ -14,6 +14,7 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/core/util/port.h" +#include namespace tensorflow { @@ -60,6 +61,21 @@ bool GpuSupportsHalfMatMulAndConv() { } bool IsMklEnabled() { + std::cerr << "IsMklEnabled:" + << " INTEL_MKL=" +#ifdef INTEL_MKL + << '1' +#else + << '0' +#endif + << " ENABLE_MKL=" +#ifdef ENABLE_MKL + << '1' +#else + << '0' +#endif + << '\n'; + #if defined(INTEL_MKL) && defined(ENABLE_MKL) return true; #else diff --git a/tensorflow/python/tfe_wrapper.cc b/tensorflow/python/tfe_wrapper.cc index fd911be46d3..2cc7354aeaa 100644 --- a/tensorflow/python/tfe_wrapper.cc +++ b/tensorflow/python/tfe_wrapper.cc @@ -14,6 +14,7 @@ limitations under the License. ==============================================================================*/ #include +#include #include "Python.h" #include "absl/strings/match.h" @@ -638,6 +639,8 @@ PYBIND11_MODULE(_pywrap_tfe, m) { tensorflow::Device* matched_device = tensorflow::GetMatchedDevice(ctx, device_name); + std::cerr << "TFE_GetMemoryInfo for " << matched_device->name() + << '[' << matched_device->parsed_name() << "]\n"; tensorflow::AllocatorAttributes attrs; tensorflow::Allocator* allocator = matched_device->GetAllocator(attrs);