-
Notifications
You must be signed in to change notification settings - Fork 3
Ensure Equivalence With DPO Padding and Padding Free #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
open_instruct/dpo_tune_cache.py
Outdated
| simpo_loss, | ||
| wpo_loss, | ||
| ) | ||
| from open_instruct.padding_free_collator import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentionally deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes there is a dup two lines belwo
open_instruct/dpo_utils.py
Outdated
| if not packing: | ||
| concatenated_batch = concatenated_inputs(batch) | ||
| try: | ||
| pad_token_id = model.tokenizer.pad_token_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do models usually have a tokenizer attr? I'm finding not, for bamba and granite. Unless the attr is set somewhere after init.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they will usually have, though the model is typed as torch.nn.Module so I thought in the OI use-case it may not be gauranteed.
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
This reverts commit 266f214.
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
garrett361
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one question.
|
also, quality checks failing |
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
|
@garrett361 fixed conflict and linted the files effectively chaged in this commit. But because we had to pull upstream, there are alot of files not linted |
Actually I believe that padding-free (packing) is correct.
this PR fixes the non-packing case, whereconcatenated_forwardassumes thepad_token_id = 0by mistakeseq_idxin the padding freeconcatenated_forwardwas computed wrongly.preference_span_searchfunction.Checking