diff options
author | 2018-05-18 07:50:54 -0700 | |
---|---|---|
committer | 2018-05-18 07:50:54 -0700 | |
commit | a9761960e282cdcf0822951dec86372181f0e88e (patch) | |
tree | a8a81a4e7fce2756b746293a4b43bc3a92aa2a69 | |
parent | bdab2d9672454df7051f250a1ca12f59ab12dccc (diff) | |
parent | 2acf23109aabb2952ce73dee89fe1e63b0e80961 (diff) |
Merge pull request #18240 from Intel-tensorflow/ashraf/direct_session_bugfix
INTEL MKL: Fixing a unit test failure, for direct session memory allocation
-rw-r--r-- | tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc b/tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc index 95093beced..e192a95338 100644 --- a/tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc +++ b/tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc @@ -102,9 +102,25 @@ TEST(DirectSessionWithTrackingAllocTest, CostModelTest) { EXPECT_EQ(2, shape.dim(0).size()); EXPECT_EQ(1, shape.dim(1).size()); if (node->name() == y->name()) { +#ifdef INTEL_MKL + // if MKL is used, it goes through various additional + // graph rewrite pass. In TF, everytime a graph pass + // happens, "constant" nodes are allocated + // and deallocated. Each allocation calls the + // (FindChunkPtr of BFCAllocator), + // which increments the value of AllocationId. + // Thus AllocationId becomes more than 3 and 4 if + // MKL is used. Now they are 9 and 10 for MKL. + EXPECT_EQ(19, cm->AllocationId(node, 0)); +#else EXPECT_EQ(13, cm->AllocationId(node, 0)); +#endif } else { +#ifdef INTEL_MKL + EXPECT_EQ(20, cm->AllocationId(node, 0)); +#else EXPECT_EQ(14, cm->AllocationId(node, 0)); +#endif } } EXPECT_LE(0, cm->MaxExecutionTime(node)); |