mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-16 22:52:25 +00:00
remove perf log, unrelated file and so on
This commit is contained in:
@@ -83,7 +83,7 @@ class ChunkManager:
|
||||
if chunk_group:
|
||||
# the chunk group is not empty
|
||||
# close the last chunk
|
||||
self.__close_one_chunk(chunk_group[-1]) # chunk[-1] 满了,所以关闭,不能再添加,然后同时scatter到ZeRO PG中
|
||||
self.__close_one_chunk(chunk_group[-1])
|
||||
|
||||
if tensor.numel() > chunk_size:
|
||||
chunk_size = tensor.numel()
|
||||
|
@@ -33,7 +33,7 @@ class GeminiZeROHook(ColoParamOpHook):
|
||||
all_chunks = self._chunk_manager.get_chunks(params)
|
||||
|
||||
# wait for prefetched chunks, filter those are not prefetched
|
||||
chunks_fetch_sync = self._gemini_manager.wait_chunks(all_chunks) # 当前要fetch的chunk
|
||||
chunks_fetch_sync = self._gemini_manager.wait_chunks(all_chunks)
|
||||
|
||||
# transfer state
|
||||
for p in params:
|
||||
|
@@ -125,7 +125,7 @@ class GeminiManager:
|
||||
self._async_works[chunk].wait()
|
||||
del self._async_works[chunk]
|
||||
else:
|
||||
non_prefetched_chunks.append(chunk) # 没在之前prefetch过,现在要prefetch的chunk
|
||||
non_prefetched_chunks.append(chunk)
|
||||
return tuple(non_prefetched_chunks)
|
||||
|
||||
def add_work(self, chunk: Chunk, work: dist.Work):
|
||||
|
@@ -113,10 +113,8 @@ class StaticPlacementPolicy(PlacementPolicy):
|
||||
def get_prefetch_chunks(self) -> List[Chunk]:
|
||||
if self.gemini_manager.is_warmup(): # no prefetch during warmup since we need compute_list
|
||||
return []
|
||||
# 最多有多少个异步的work
|
||||
can_prefetch = self.max_prefetch - len(self.gemini_manager._async_works)
|
||||
prefetch = []
|
||||
# static炸就炸了,dynamic可能需要我们要先分析当前运行时的内存情况,分配空间或者淘汰块
|
||||
for i in range(self.gemini_manager.compute_idx + 1, len(self.gemini_manager.compute_list)):
|
||||
for chunk in self.gemini_manager.compute_list[i]:
|
||||
if len(prefetch) >= can_prefetch:
|
||||
|
Reference in New Issue
Block a user