Repository navigation
FSDP2 gloo tests: stub every helper the trainer wrapper calls, not a fixed list - #14518
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
The
Repo tests (CPU, fsdp2)shard fails on main: 11 tests across the gloo files that wrapTrainer.__init__with_install_wrapped_trainer_initfromtests/test_fsdp2_native_trainer_args_gloo.py(for example #14494). Every rank crashes the same way:The harness runs the real
_unsloth_trainer_initsource from_utils.pyin a namespace that stubs the helpers it calls. That list is written out by hand. #14404 added a call to_size_auto_checkpoint_skip_for_trainer, which is not in the list. The product is fine: the helper is defined at module level in_utils.py.Fix
Test only. The explicit stubs stay. On top of them, every free function
_unsloth_trainer_initcalls that the namespace does not provide is stubbed as well. Builtins, and names the wrapper binds itself (assignments and in-function imports), are excluded. The next helper added to the wrapper cannot take the shard down this way again.Verification
CPU torch 2.10, peft 0.21.2, accelerate 1.15.0, unsloth-zoo main. Files run:
test_fsdp2_native_optim_reentry_gloo.py,test_fsdp2_native_trainer_fsdp_clip_gloo.py,test_fsdp2_native_subclass_optimizer_gloo.pyandtest_fsdp2_native_trainer_args_gloo.py.NameErrorabove).