Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTEL MKL: Fixing a unit test failure, for direct session memory allocation #18240

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down