|
@@ -197,10 +197,12 @@ class _RemoteMoECall(torch.autograd.Function):
|
|
|
# 2. compute softmax weights for alive experts and average outputs
|
|
|
alive_ix = torch.as_tensor(alive_ix, device=expert_logits.device)
|
|
|
alive_expert_probs = torch.softmax(expert_logits[alive_ix], dim=0)
|
|
|
+ print(f'{alive_expert_probs=}')
|
|
|
|
|
|
stacked_alive_outputs = tuple(map(torch.stack, zip(*alive_outputs)))
|
|
|
flat_average_outputs = tuple(dot_along_first_axis(alive_expert_probs, stacked_out)
|
|
|
for stacked_out in stacked_alive_outputs)
|
|
|
+
|
|
|
# 3. save individual outputs for backward pass
|
|
|
ctx.save_for_backward(expert_logits, alive_ix, alive_expert_probs, *stacked_alive_outputs)
|
|
|
ctx._alive_contexts = alive_contexts
|