Add FSDP CI and end-to-end FSDP tests + save fsdp - #47357
Conversation
…n 1/3). Introduce distributed/utils.py and DistributedMixin, defer DistributedConfig validation to load time, and refactor PreTrainedModel plan properties without changing the from_pretrained distributed_config API yet.
…SDP orchestration 2/3). Route distributed loading and saving through DistributedMixin, migrate TP tests and docs off tp_plan="auto", and add FSDP gather/DCP save paths.
Add FSDPTesterMixin, cohere2_moe base_fsdp_plan, dedicated fsdp_ci job, and pytest markers for distributed FSDP load/save/generation coverage.
Route distributed load/save orchestration through DistributedMixin so TP and FSDP paths share the same entry points.
…gingface/transformers into split/a-pr-4-2-fsdp-tests-ci
|
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. |
ArthurZucker
left a comment
There was a problem hiding this comment.
wondering if any of the func in the test fsdp mixin are re-usable at all?
| continue | ||
| self.skipTest(f"Cannot instantiate model with any Auto class for config {type(config).__name__}") | ||
|
|
||
| def _get_tiny_config(self): |
There was a problem hiding this comment.
are you patching to make divisable?
There was a problem hiding this comment.
no I am just patching to make it a smaller model overall
| """The model exposes a non-empty `_fsdp_plan` derived from config + class-level overrides.""" | ||
| if not self._has_fsdp_plan(): | ||
| self.skipTest("Model does not have an FSDP plan (base_model_fsdp_plan)") | ||
|
|
There was a problem hiding this comment.
create model on meta is used only once, not sure we need a func
…gingface/transformers into split/a-pr-4-2-fsdp-tests-ci
|
[For maintainers] Suggested jobs to run (before merge) run-slow: cohere2_moe |
|
run-slow: cohere2_moe |
|
This comment contains models: ["models/cohere2_moe"] |
CI recapDashboard: View test results in Grafana |
CI ResultsCommit Info
The test failure analysis could not be completed. Please check the workflow run for details. |
* Add distributed runtime utils and DistributedMixin (FSDP orchestration 1/3). Introduce distributed/utils.py and DistributedMixin, defer DistributedConfig validation to load time, and refactor PreTrainedModel plan properties without changing the from_pretrained distributed_config API yet. * Wire DistributedConfig through from_pretrained and save_pretrained (FSDP orchestration 2/3). Route distributed loading and saving through DistributedMixin, migrate TP tests and docs off tp_plan="auto", and add FSDP gather/DCP save paths. * Add FSDP CI and end-to-end FSDP tests (FSDP orchestration 3/3). Add FSDPTesterMixin, cohere2_moe base_fsdp_plan, dedicated fsdp_ci job, and pytest markers for distributed FSDP load/save/generation coverage. * addd ep_plan * restore validate module * Wire DistributedConfig through from_pretrained and save_pretrained. Route distributed load/save orchestration through DistributedMixin so TP and FSDP paths share the same entry points. * revert * inline distribute_model * revert * remove saving/loading * leaner mixin * downgrade torch version guarding * remove * linting * revert * revert * post_init() parallel plan move to mixin * revert tp mixin * add save/load * only FSDP save/load for now * revert * refactor * inline
* Add distributed runtime utils and DistributedMixin (FSDP orchestration 1/3). Introduce distributed/utils.py and DistributedMixin, defer DistributedConfig validation to load time, and refactor PreTrainedModel plan properties without changing the from_pretrained distributed_config API yet. * Wire DistributedConfig through from_pretrained and save_pretrained (FSDP orchestration 2/3). Route distributed loading and saving through DistributedMixin, migrate TP tests and docs off tp_plan="auto", and add FSDP gather/DCP save paths. * Add FSDP CI and end-to-end FSDP tests (FSDP orchestration 3/3). Add FSDPTesterMixin, cohere2_moe base_fsdp_plan, dedicated fsdp_ci job, and pytest markers for distributed FSDP load/save/generation coverage. * addd ep_plan * restore validate module * Wire DistributedConfig through from_pretrained and save_pretrained. Route distributed load/save orchestration through DistributedMixin so TP and FSDP paths share the same entry points. * revert * inline distribute_model * revert * remove saving/loading * leaner mixin * downgrade torch version guarding * remove * linting * revert * revert * post_init() parallel plan move to mixin * revert tp mixin * add save/load * only FSDP save/load for now * revert * refactor * inline
Summary
Part of FSDP orchestration stack (2/2). Replaces #46990. #47352 (1/2) → this PR (2/2)
FSDPTesterMixinandtests/test_fsdp_mixin.py(load/save/generation)base_model_fsdp_planto cohere2_moe (only model in this stack)fsdp_ciCircleCI job and pytest markers