You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 704f911
Browse filesBrowse the repository at this point in the historyBrowse files
EP implementations are callables; inline the backward all-reduce check
Every `EPImplementation` defines `__call__` (AutoEP already did), and the base
class keeps `run_experts`, now owning the local DTensor params context.
`_all_reduce_backward` is gone: its call sites check
`torch.is_grad_enabled() and x.requires_grad` before `_AllReduceBackward.apply`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/source/en/expert_parallelism.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,13 +64,13 @@ The expert forward rule in `ep_plan` selects how tokens reach the experts:
64
64
65
65
### Adding an implementation
66
66
67
-
An implementation subclasses `EPImplementation` and registers under the name `ep_implementation` selects. It is built once per experts module, so it can keep state such as communication buffers. Its `forward` takes the batch this rank holds, with global expert ids, and returns the weighted expert output for each of its tokens. It runs this rank's experts with `run_experts`, on the rows, local expert ids and weights it brought them.
67
+
An implementation subclasses `EPImplementation` and registers under the name `ep_implementation` selects. It is built once per experts module, so it can keep state such as communication buffers. Calling it with the batch this rank holds, with global expert ids, returns the weighted expert output for each of its tokens. It runs this rank's experts with `run_experts`, on the rows, local expert ids and weights it brought them.
68
68
69
69
```py
70
70
from transformers.distributed.expert_parallel importALL_EP_IMPLEMENTATIONS, EPImplementation
0 commit comments