Skip to content

Commit

Permalink
Merge pull request #43 from haohongxiang/fix_bug_of_recompute
Browse files Browse the repository at this point in the history
fix bug of recompute in moe_layer
  • Loading branch information
lilong12 authored Feb 24, 2022
2 parents 91ba8b3 + 9ff23f5 commit 3f27dea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/paddle/distributed/model/moe/moe_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def experts_fwd(x, fwd_expert_count, experts):
else:
return paddle.concat(y, axis=0)

if self.recompute_interval <= 0:
if self.recompute_interval <= 0 or x.shape[0] == 0:
x = experts_fwd(x, fwd_expert_count.numpy(), self.experts)
else:
x = _hp_recompute(experts_fwd, x,
Expand Down

0 comments on commit 3f27dea

Please sign in to comment.