-
Notifications
You must be signed in to change notification settings - Fork 33
fix loss masking and padding #287
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
Open
sohamparikh
wants to merge
21
commits into
main
Choose a base branch
from
soham/sft-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+54
β22
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
06b76cd
some sft fixes
sohamparikh 0364fc6
bug fixes and improvements
sohamparikh d5cd5e8
Merge branch 'main' into soham/sft-fixes
sohamparikh 02fbb7e
fix
sohamparikh e4925f0
Merge branch 'soham/sft-fixes' of github.com:ServiceNow/Fast-LLM intoβ¦
sohamparikh b31987a
unshuffled tokens for padding
sohamparikh 9db9cdf
fix
sohamparikh a81ba7f
mask optionally
sohamparikh eab15c0
fix hack
sohamparikh e0e0f78
use mask sum
sohamparikh 49760e5
Merge branch 'main' into soham/sft-fixes
sohamparikh 6b2b598
handle None mask
sohamparikh 29cb0a8
flag to mask inputs, move truncate documents
sohamparikh 8fe536f
fix tests
sohamparikh a8c63c0
Merge branch 'main' into soham/sft-fixes
sohamparikh 1dc76a6
fix legacy sampler
sohamparikh 4266f02
Merge branch 'soham/sft-fixes' of github.com:ServiceNow/Fast-LLM intoβ¦
sohamparikh 29cc709
fix
sohamparikh 43c868a
review
sohamparikh b3d6d3c
Merge branch 'main' into soham/sft-fixes
sohamparikh 650f0e2
Merge branch 'main' into soham/sft-fixes
sohamparikh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,7 @@ class GPTSamplingParameters(SamplingParameters): | |
use_loss_masking_spans: bool = False | ||
use_preference_loss_spans: bool = False | ||
cross_document_attention: bool = True | ||
truncate_documents: bool = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure we need to move this, but if we do we need to add backward compatibility. |
||
# How many extra tokens to add to the sequence length. | ||
# This is used to provide labels even for the last tokens in the sequence. | ||
extra_tokens: int = 1 | ||
|
@@ -90,7 +91,6 @@ class GPTSamplingData(SamplingData): | |
config: GPTSamplingConfig | ||
parameters: GPTSamplingParameters | ||
tokenizer: "Tokenizer" | ||
truncate_documents: bool = True | ||
|
||
|
||
@config_class(registry=True) | ||
|
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
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
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
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
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
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
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
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
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.
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.
That works, but we normally do backward compatibility in
_from_dict
, see example in lines 73-90 below. This one can go inGPTTrainerConfig._from_dict
.Also needs a todo for removal.