Fix/sequence length power of 2#158
Merged
le1nux merged 21 commits intodev_experimentsfrom Jun 30, 2024
Merged
Conversation
…ed as the first token (i.e., first input token) of the subsequent block
flxst
approved these changes
Jun 25, 2024
Member
flxst
left a comment
There was a problem hiding this comment.
Great work! Added some minor comments.
…the indexation of the original samples
Co-authored-by: Felix Stollenwerk <felix.stollenwerk@ai.se>
Co-authored-by: Felix Stollenwerk <felix.stollenwerk@ai.se>
Co-authored-by: Felix Stollenwerk <felix.stollenwerk@ai.se>
Co-authored-by: Felix Stollenwerk <felix.stollenwerk@ai.se>
Co-authored-by: Felix Stollenwerk <felix.stollenwerk@ai.se>
…lities into fix/dataset_index
Co-authored-by: Felix Stollenwerk <felix.stollenwerk@ai.se>
mali-git
approved these changes
Jun 29, 2024
Fix/dataset index: Index values were faulty when indexing the original samples instead of blocks.
5 tasks
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.
What does this PR do?
Previously, the
block_sizein the dataset would be set to a power of two, resulting in the sequence length beingblock_size -1, which is not best practice and can impact the model training e.g., throughput-wise.As a fix, we now specify the
sequence_lengthin the config instead of theblock_size. During Dataset instantiation we chose theblock_sizeto besequence_length+1.Previously, we would also chunk the dataset into
block_sizelong chunks. Each chunk would then be used for training individually. As a result, the last token of a block would be only used as a target but never as an input. We changed this, such that we reuse the last token of a batch as the first one of the subsequent batch.General changes
Breaking Changes
block_sizeinDataset,ModelandNumberConversionwithsequence_lengthChecklist before submitting final PR
python tests/tests.py)