Repository navigation
[OMNIML-6076] [3/3] Apply the model spec when deciding and loading expert-parallel #2746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shengliangxu
wants to merge
27
commits into
shengliangx/hfep-base-9-specs
Choose a base branch
from
shengliangx/hfep-9-ep-model-specs
base: shengliangx/hfep-base-9-specs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
93ca713
Apply the model spec when deciding and loading expert-parallel
shengliangxu f649c17
Import the spec applier at the top of model_load_utils
shengliangxu 319e6aa
Say an MTP head the FSDP2 load cannot build rules FSDP2 out too
shengliangxu 8e5f89f
Load a MoE only its spec makes expert-parallel on GPUs, and run it
shengliangxu 56873a3
Keep a spec-attached EP plan out of the loaded model's config
shengliangxu 051bd5e
Read the plan to keep inside the load's collective refusal
shengliangxu be3b0c5
Warn when the load cannot read the plan its checkpoint declares
shengliangxu 395e9fb
Refuse an MoE whose spec refuses EP with NotImplementedError
shengliangxu 731e96b
Warn on the rank that cannot read the plan its checkpoint declares
shengliangxu f17a986
Name the transformers release the left-whole refusal asks for
shengliangxu 6fa3305
Offer the transformers upgrade only where an EP degree could shard
shengliangxu 2cea645
Name the EP degree to raise beside the upgrade when the caller set it
shengliangxu 54269c9
Tell the decision's own refusal from the upgrade's by its pattern
shengliangxu b319920
Leave the model spec out of a single process's plan
shengliangxu 4a12012
Apply no model spec for a model class the sharded loads refuse
shengliangxu b7abfed
Check that a rank without its GPU prepares no config passed in
shengliangxu 9d817b2
Say a plan set on a config passed to the load is not kept either
shengliangxu 769f345
Word the FSDP2 way around expert parallelism once
shengliangxu 78cf24e
State that a spec's prepare may run for a plan that is not expert-par…
shengliangxu 0214399
Take a config left unmarked as not yet prepared by the model spec
shengliangxu afb048e
Ask for the EP degree where the routing test expects the FSDP2 refusal
shengliangxu 71e5d34
Say why the spec rules expert parallelism out in the left-whole refusal
shengliangxu 6173bea
Expect the spec's floor refusal for an MoE below it, left to decide
shengliangxu fabb8a2
Leave the spec's expert-parallel refusals to the spec-aware decision
shengliangxu 17dd0e8
Refuse a model its spec refuses in the expert-parallel load itself
shengliangxu 70ce8c4
Read the checkpoint's config.json as UTF-8
shengliangxu d8059b3
Ask the model spec first in the expert-parallel load
shengliangxu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION]
_ep_floorfactors this computation out ofcheck_distributed_support, butmodel_load_utils._ep_load_refusalstill inlines the identical expression with the version literal spelled out twice:Since this PR already imports
_ep_floorintomodel_load_utils, that line can becomefloor = _ep_floor(hf_config.model_type), which removes the last hardcoded"5.7"on that path (_EP_MIN_TRANSFORMERSis the single source elsewhere) and keeps the two floors from drifting if a spec-floor rule changes. The only behavioral difference is that the floor would then resolve the spec throughmoe._ep_specrather thanmodel_load_utils.get_spec; see the note on theits-spectest row for why that matters there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in c7619f8 by deleting the line rather than rewriting it. The floor arm of
_ep_load_refusalis gone (see #2746 (comment)), so on that path the floor is_ep_floor's, through_spec_refuses_ep. The load's own check reads_EP_MIN_TRANSFORMERSfrommoe, and the local copy #2780 added is dropped here.