[model] fix: support MCore FSDP factory wrappers - #5322
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test 62097ac |
Signed-off-by: Chen Cui <chcui@nvidia.com> Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
62097ac to
ea19acb
Compare
|
/ok to test ea19acb |
|
LGTM — the change correctly handles the Megatron-Core The Minor note (non-blocking): in the factory branch, Suggested test cases
|
|
Superseded by #5431, which has now merged the MCore FSDP factory-wrapper compatibility fix into |
Summary
unwrap_model()compatible with both the Bridge-pinned legacy MCore FSDP class API and the newer MCore factory APIFullyShardedDataParallelV1andFullyShardedDataParallelV2wrappers without passing the factory function toisinstance()Root cause
Newer MCore versions expose
mcore_fsdp_adapter.FullyShardedDataParallelas a factory function and provide V1/V2 as the concrete wrapper classes. Bridge conversion code included the factory in anisinstance()tuple, which raises before MFSDP conversion reaches weight loading.This is separate from the TP=2 vocabulary-scatter defect fixed by #5353. That fix is present on current main; this PR removes the newer MCore compatibility blocker that prevented QA from re-verifying the three MFSDP conversion examples.
Compatibility
FullyShardedDataParallelwhen it is a class; V1/V2 symbols may be absentValidation
origin/mainc62be0886a:uv run python -m pytest tests/unit_tests/models/test_conversion_utils.py -k unwrap_model -vvTypeError: isinstance() arg 2 must be a type, a tuple of types, or a union; legacy case passedea19acb7f:uv run python -m pytest tests/unit_tests/models/test_conversion_utils.py -vv— 7 passeduv run pre-commit run --all-files— passed