Repository navigation
remove ep_router - #49587
remove ep_router #495873outeille wants to merge 2 commits into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
CI recapDashboard: View test results in Grafana |
|
Should we rather not fix this on all the models or is this more for custom models? |
|
Let's also see whether #49429 makes more sense. It's a bit messy switching strategies and it feels like a bandaid to me rather than making sure inference/training can switch in a good way |
ArthurZucker
left a comment
There was a problem hiding this comment.
ty we do need this,
| setattr(model, f"_{plan_name}", plan | override) | ||
| merged = plan | override | ||
| if plan_name == "ep_plan" and "ep_dispatch_experts" in override.values(): | ||
| merged = {name: style for name, style in merged.items() if style != "ep_router" or name in override} |
There was a problem hiding this comment.
not a fan of filtering a single key.
Can't we filter what appears in both?
Or module based only?
There was a problem hiding this comment.
Not sure what you mean by what appears in both. We are trying to remove keys from the same plan not different plans (ep is already taking precedence over tp keys)
Here it's more if ep_plan has ep_router + moe_tp_experts and we want to add expert_dispatch. We are forced to remove the key manually (as the PR does). Maybe we can specify None to a key through the ep_plan which will delete the key ? wdyt ?
|
In any case, this is a bug that need to be fixed. We should be able to trigger ep_dispatch properly through the DistributedConfig in the first place |
vasqu
left a comment
There was a problem hiding this comment.
Lets clean the key matching up 🫡
| setattr(model, f"_{plan_name}", plan | override) | ||
| merged = plan | override | ||
| if plan_name == "ep_plan" and "ep_dispatch_experts" in override.values(): | ||
| merged = {name: style for name, style in merged.items() if style != "ep_router" or name in override} |
qgallouedec
left a comment
There was a problem hiding this comment.
Re-visiting this one: still needed, but the code moved. On main the plans resolve in _resolve_parallel_plans, which now raises when ep_dispatch_experts meets ep_router:
transformers/src/transformers/distributed/mixin.py
Lines 265 to 268 in 4888db4
That error can't be followed through DistributedConfig: overrides merge by key, so there is no way to remove one, and Gemma4, Llama4, HY-V4, Inkling, MiMo-V2-Flash and DiffusionGemma still can't switch to dispatch.
+1 for your None idea: in the merge at line 250, drop keys whose override is None, and have the error say to set the router keys to None.
|
I think we move to a new EP strategy based on #49429, wouldn't this remove the issue all over if we go dispatch on all models then? |
|
Right. #49429 alone doesn't switch any model, but once it lands with |
|
Actually it's already in flight:
|
|
Yep exactly, I'd rather we go that route merging the stack and going all in on the dispatch strats everywhere. Then this is gone automatically |
|
#49615 removed |
For a model that has masked EP by default and want to be used with
ep_dispatchthroughDistributedConfig, we need to remove theep_routerkeys otherwise we find ourselves withep_router+ep_dispatchwhich is not correct