Add a regression test for the non-FSDP ORPO path#1
Open
kashif wants to merge 3 commits into
Open
Conversation
Author
|
Folded the trl-compat work into this branch so everything ORPO lands together (closed linkedin#1244 in favor of this):
No new deps: trl stays optional, nothing added to |
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.
Nice fix! The only thing missing from linkedin#1229 / linkedin#1230 was a test that locks it in, so here's one to go on top of your branch.
It builds a tiny Llama and calls
concatenated_forwardon a plain (non-FSDP) model. Before your change this path went unconditionally through_FSDPForwardRedirection, which asserts the module is FSDP and blew up on a single GPU — exactly the crash from linkedin#1229. The test just checks it runs and returns a finite loss.I kept it narrow on purpose: it stubs
concatenated_inputsand builds the trainer with__new__, so it only exercises the forward path you touched and doesn't drag in the whole dataset/tokenizer pipeline. Guarded withimportorskip("trl")since the trainer subclasses trl's ORPOTrainer, and it usesinfer_device()so CI runs it on GPU.Feel free to squash it into your branch.