diff options
author | 2017-01-09 10:33:38 -0800 | |
---|---|---|
committer | 2017-01-09 10:48:25 -0800 | |
commit | 3f5f958554b0b8ab677f1dad624987079e517eee (patch) | |
tree | f70df1f40b558be41292f5971487081be5d78549 /tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc | |
parent | a00f53f831047feeb9a5086542116eba1b9f590d (diff) |
SimplePlacer: apply heuristics only if the candidate device is valid
(is in the list of passed in devices).
Before this change, if the candidate_device_name was /cpu:0 but
the list of valid devices was /cpu:1 (because that's what the user
specified), we would still apply the heuristics to assign the device
to candidate_device_name, since the device type is the same.
However, we never want to ignore what the user has specified, so
we properly check that the device name matches one of the devices
in the list of valid devices for that node (as determined by the
user or the placer constraints).
This adds tests to verify this behavior.
Also added a note about the check for assigned_device_name in one
of the loops. The check is not strictly necessary:
the act of adding a node to the colocation_group structure
at the beginning function reads existing assigned_device_name
and populates the list of possible devices, so GetDevicesByNode()
will always return a single device in this case. However, this
check avoids some extra computation that isn't needed, so it's still
valid to have. I now do add a AssignAndLog statement to make sure
stateful placements are logged (before this change, they weren't).
cc @DavidNorman
Change: 143978397
Diffstat (limited to 'tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc')
-rw-r--r-- | tensorflow/core/common_runtime/direct_session_with_tracking_alloc_test.cc | 2 |
1 files changed, 1 insertions, 1 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 fbac512785..3c0989c587 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,7 +102,7 @@ TEST(DirectSessionWithTrackingAllocTest, CostModelTest) { if (node->name() == y->name()) { EXPECT_EQ(5, cm->AllocationId(node, 0)); } else { - EXPECT_EQ(7, cm->AllocationId(node, 0)); + EXPECT_EQ(6, cm->AllocationId(node, 0)); } } EXPECT_LE(0, cm->MaxExecutionTime(node)); |