|
|
@ -126,14 +126,14 @@ class ChunkSelector(object):
|
|
|
|
)
|
|
|
|
)
|
|
|
|
return chunk_info
|
|
|
|
return chunk_info
|
|
|
|
|
|
|
|
|
|
|
|
def _chunk_size_binary_search(self, l, r, chunk_region_dict, chunk_infos):
|
|
|
|
def _chunk_size_binary_search(self, left, right, chunk_region_dict, chunk_infos):
|
|
|
|
if l >= 16:
|
|
|
|
if left >= 16:
|
|
|
|
gap = 4
|
|
|
|
gap = 4
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
gap = 1
|
|
|
|
gap = 1
|
|
|
|
chunk_info = chunk_region_dict["reorder_chunk_info"]
|
|
|
|
chunk_info = chunk_region_dict["reorder_chunk_info"]
|
|
|
|
while r >= l + gap:
|
|
|
|
while right >= left + gap:
|
|
|
|
mid = int((l + r) / 2 + 0.5)
|
|
|
|
mid = int((left + right) / 2 + 0.5)
|
|
|
|
chunk_info["chunk_size"] = mid
|
|
|
|
chunk_info["chunk_size"] = mid
|
|
|
|
cur_chunk_infos = chunk_infos + [chunk_info]
|
|
|
|
cur_chunk_infos = chunk_infos + [chunk_info]
|
|
|
|
cur_mem_peak = self.memory_estimator.estimate_chunk_inference_mem(
|
|
|
|
cur_mem_peak = self.memory_estimator.estimate_chunk_inference_mem(
|
|
|
@ -143,10 +143,10 @@ class ChunkSelector(object):
|
|
|
|
cur_mem_peak[chunk_info["region"][0] : chunk_info["region"][1] + 1]
|
|
|
|
cur_mem_peak[chunk_info["region"][0] : chunk_info["region"][1] + 1]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if cur_chunk_max_mem >= self.max_memory:
|
|
|
|
if cur_chunk_max_mem >= self.max_memory:
|
|
|
|
r = mid - gap
|
|
|
|
right = mid - gap
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
l = mid + gap
|
|
|
|
left = mid + gap
|
|
|
|
return l
|
|
|
|
return left
|
|
|
|
|
|
|
|
|
|
|
|
def _get_compute_node_num(self, start, end):
|
|
|
|
def _get_compute_node_num(self, start, end):
|
|
|
|
count = 0
|
|
|
|
count = 0
|
|
|
|