Tokenization speedup and llama3-like weight init#432
Merged
Conversation
…ng more efficient data routines
…k if the dataset provides enough tokens.
BlueCrescent
approved these changes
Feb 27, 2026
src/modalities/dataloader/preprocessing/tokenization/tokenized_file_writer.py
Outdated
Show resolved
Hide resolved
Comment on lines
+111
to
+114
| raise ValueError( | ||
| f"Token values out of range for {token_size_in_bytes} bytes: " | ||
| f"min={min_val}, max={max_val}, allowed=[0, {max_allowed}]" | ||
| ) |
Member
There was a problem hiding this comment.
Maybe it would be helpful to identify the faulty token (as in the previous implementation) or even better the index in token_data (via enumerate) and the index in arr (via argmax/argmin) here.
Llama3 like weight init
…tokenized_file_writer.py
…tionally casts it down to the model dtype. This is improves stability of the weight init.
rrutmann
approved these changes
Mar 6, 2026
| f"Expected: >={self.settings.training_target.num_target_tokens}" | ||
| ) | ||
| dataset_tokens = len(self.train_dataset) * self.settings.step_profile.sequence_length | ||
| expected_tokens = self.settings.training_target.num_target_tokens |
Collaborator
There was a problem hiding this comment.
The name expected_tokens is a bit misleading here, since this is not the expected size of the dataset, but rather the num_target_tokens. Maybe rename to num_target_tokens?
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?
Checklist before submitting final PR
python tests/tests.py)CHANGELOG_DEV.md)