[XLA] Make sure evict end time > start time after violating max async copies.
PiperOrigin-RevId: 288797386
Change-Id: Ie96147aaeaf4d86a44648f2c5fa5f18d68620a99
diff --git a/tensorflow/compiler/xla/service/memory_space_assignment.cc b/tensorflow/compiler/xla/service/memory_space_assignment.cc
index ea68c99..e002014 100644
--- a/tensorflow/compiler/xla/service/memory_space_assignment.cc
+++ b/tensorflow/compiler/xla/service/memory_space_assignment.cc
@@ -760,11 +760,11 @@
// this interval.
bool eviction_scheduled = false;
for (int64 time = eviction_start_time; time < eviction_end_time; ++time) {
- VLOG(3) << "Try evicting (" << time << ", " << time << ")";
- if (!ViolatesMaximumOutstandingAsyncCopies(time, time)) {
+ VLOG(3) << "Try evicting (" << time << ", " << time + 1 << ")";
+ if (!ViolatesMaximumOutstandingAsyncCopies(time, time + 1)) {
VLOG(3) << "Eviction successful.";
AddAsyncCopy(*prev_allocation, MemorySpace::kDefault, kDummyChunk,
- time, time, time, allocations);
+ time, time + 1, time + 1, allocations);
eviction_scheduled = true;
break;
}