Skip to content

Commit

Permalink
[gemini] fix tensor storage cleaning in state dict collection (hpcait…
Browse files Browse the repository at this point in the history
  • Loading branch information
Fridge003 authored Aug 10, 2023
1 parent 458ae33 commit 6ccecc0
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions colossalai/zero/gemini/gemini_optimizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# this code is inspired by the DeepSpeed library and implemented with our own design from scratch
import copy
import gc
import math
import warnings
from typing import Any, Dict, Iterator, OrderedDict, Set, Tuple
Expand Down Expand Up @@ -468,11 +467,6 @@ def collect_states(self, param_id: int, only_rank_0: bool = True) -> dict:
self.load_from_compacted_states(compacted_states, collected_states, state_names, shard_offset,
shard_size)

# Clean gathered states
for state_shard in gathered_state_shards:
del state_shard[0]
gc.collect()

# Reshape tensors
if is_collector:
for state_name, state_tensor in collected_states.items():
Expand Down

0 comments on commit 6ccecc0

Please sign in to comment.