Repository navigation
FSDP2 optimizer_cls test: follow #15008, which keeps bitsandbytes Adam / AdamW on local shards - #15049
Merged
Conversation
…m / AdamW on local shards test_bnb_optimizer_cls_and_kwargs_is_refused still expected every bitsandbytes class to be refused. Since #15008 a real bitsandbytes Adam / AdamW is kept and sharded whenever this bitsandbytes steps local shards, and refused otherwise (UNSLOTH_FSDP2_BNB_LOCAL=0). The worker now reports that, and the test asserts each arm against it; a class that only claims the bitsandbytes module is still refused.
Member
Author
|
@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. |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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". |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Repo tests (CPU, fsdp2)fails onmainsince #15008, for example on #14970 and #15000:Cause
#15008 made native FSDP2 keep a bitsandbytes Adam / AdamW and step each rank's local shard.
_refuse_bnb_optimizer_clsnow letsoptimizer_cls_and_kwargs = (bnb.optim.AdamW8bit, ...)through whenever this bitsandbytes can step local shards, and refuses it otherwise (UNSLOTH_FSDP2_BNB_LOCAL=0). The test still expected every bitsandbytes class to be refused. The product change is intended, as the #15008 description says, so the test was out of date.Fix
The worker now also reports
native._bnb_local_shards_available(), and the test asserts each arm against it:torch.*: accepted and sharded.bnb.*: accepted and sharded when local shards are available, otherwise refused with the bitsandbytesValueError.like.*(AdamW8bitLike, a torch AdamW that only claims the bitsandbytes module): always refused, since it cannot step local shards.Verification
The whole file gives 5 passed. Both
bnbbranches run:UNSLOTH_FSDP2_BNB_LOCALbnb.*like.*torch.*Sabotage check: making
_refuse_bnb_optimizer_clsreturn early fails the test.