Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
duterscmy committed Dec 13, 2024
1 parent e1ff666 commit 43d9b14
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions cd-moe/modeling_deepseek_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,6 @@ def backward(ctx, grad_output):
condense_layer_order_path = os.path.join(
current_dir, "layer_idx_order.e6.json")
condense_layer_order = json.load(open(condense_layer_order_path, 'r'))

trim_layer_idxs = []
layer_map_trim = {}
new_layer_idx = 0
for origin_layer_idx in range(27):
layer_map_trim[origin_layer_idx] = new_layer_idx
new_layer_idx += 1
condense_layer_order = list(filter(lambda x: x not in trim_layer_idxs, condense_layer_order))
prune_layer_idxs = condense_layer_order[:prune_layer_num]
print("condense layer idx {}".format(prune_layer_idxs))

Expand Down Expand Up @@ -690,7 +682,6 @@ def forward(
if past_key_value is not None:
# print(self.layer_idx)
cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
# cache_idx = layer_map_trim[self.layer_idx-1] + 1 if self.layer_idx > 0 else 0
key_states, value_states = past_key_value.update(
key_states, value_states, self.layer_idx, cache_kwargs)

Expand Down

0 comments on commit 43d9b14

Please sign in to comment.