-
Notifications
You must be signed in to change notification settings - Fork 196
[feature] Add debug_dataloader_samples utility to preview decoded dataloader samples (#184) #368
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
garongkim
wants to merge
11
commits into
huggingface:dev
Choose a base branch
from
garongkim:debug-clean
base: dev
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.
Conversation
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
…face#353) * can only merge to main from dev * Fix UnBoundLocalError in `clm_collator.py` (huggingface#339) * Update clm_collator.py * can only merge to main from dev (huggingface#348) --------- Co-authored-by: Nouamane Tazi <nouamane@huggingface.co> * fix init and init scaling factor and run evals in background (huggingface#349) * InitScalingMethod * InitScalingMethod * run evals in background (huggingface#352) * eval * try adding lightevalrunner to trainer * amend * amend * amend * amend * amend * amend * . * amend * amend * . * qos to low * add nanotron_path * some fix: logs, and config * cp instead of sync * eval_interval * serialize sanity checks * add output dir and s3_save path in the config * fix s3 only if define * fixes --------- Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co> --------- Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co> --------- Co-authored-by: Connector Switch <c8ef@outlook.com> Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co>
* deepwiki * Update README.md
Closed
6 tasks
huggingface#346) * [Feature] Implement CUDA event-based timing for improved GPU performance measurement * can only merge to main from dev (huggingface#348) * Fix timer decorator logic: Support both CPU and CUDA timers and update docs * Fix timer decorator logic: support both CPU and CUDA; update docs --------- Co-authored-by: Kabir Grewal <kabirgrewal@Kabirs-MacBook-Pro-5.local> Co-authored-by: Nouamane Tazi <nouamane@huggingface.co> Co-authored-by: Kabir Grewal <kabirgrewal@kabirs-mbp-5.wireless-1x.unc.edu>
* can only merge to main from dev (huggingface#348) * move moe from qwen modeling to src/nn * add groupedmlp * add token permute and unpermute * fix num_tokens_per_expert counting < num_experts * fix init and init scaling factor and run evals in background (huggingface#353) * can only merge to main from dev * Fix UnBoundLocalError in `clm_collator.py` (huggingface#339) * Update clm_collator.py * can only merge to main from dev (huggingface#348) --------- Co-authored-by: Nouamane Tazi <nouamane@huggingface.co> * fix init and init scaling factor and run evals in background (huggingface#349) * InitScalingMethod * InitScalingMethod * run evals in background (huggingface#352) * eval * try adding lightevalrunner to trainer * amend * amend * amend * amend * amend * amend * . * amend * amend * . * qos to low * add nanotron_path * some fix: logs, and config * cp instead of sync * eval_interval * serialize sanity checks * add output dir and s3_save path in the config * fix s3 only if define * fixes --------- Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co> --------- Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co> --------- Co-authored-by: Connector Switch <c8ef@outlook.com> Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co> * inference qwen moe seems to work inference seems good rn * update readme * fix router's weight initialization and wrong hidden size for non-moe mlp in qwen * add source for router weight and router logits in float32 * fixes * . * . * add parametrize grouped mlp in column and row linear * add logging per-param grad norm * fix conversation fail due to buffer on cpu * config_qwen * . * . * fix moe convert config --------- Co-authored-by: Nouamane Tazi <nouamane@huggingface.co> Co-authored-by: Connector Switch <c8ef@outlook.com> Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co> Co-authored-by: zzhhjjj <z785566960@gmail.com> Co-authored-by: nouamanetazi <nouamane98@gmail.com>
* InitScalingMethod * InitScalingMethod * eval * try adding lightevalrunner to trainer * amend * amend * amend * amend * amend * amend * . * amend * amend * . * qos to low * add nanotron_path * some fix: logs, and config * cp instead of sync * eval_interval * serialize sanity checks * add output dir and s3_save path in the config * fix s3 only if define * fixes * add requeue * add wandb with lighteval and fix eval interval * fix this little space :( * folder_path should always have s3 when using s3 (fix consumed tokens issue) * config qwen * . --------- Co-authored-by: elie <97572401+eliebak@users.noreply.github.com> Co-authored-by: “eliebak” <elie.bakouch@huggingface.co>
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?
This PR adds a utility function debug_dataloader_samples() under utils/debug_utils.py.
It allows users to preview a few decoded examples from the first batch of the training DataLoader, which can help ensure that tokenization is working correctly before launching a long training run.
This debug utility addresses #184.
Although another contributor expressed interest in the issue, no progress or maintainer feedback has occurred in the last 3 weeks.
As this feature is simple but useful, I decided to implement and contribute it directly.
How to use
This utility can be optionally called from run_train.py or any other training script to inspect tokenized input samples before training.
Here is an example snippet:
python
from nanotron.utils.debug_utils import debug_dataloader_samples
debug_dataloader_samples(train_dataloader, tokenizer, num_samples=3)
Notes
To avoid a circular import issue between utils.py and distributed.py,
this function is placed in a new module debug_utils.py instead of the main utils.py.
Logging is used instead of
print()
to remain consistent with Nanotron’s logging system.This PR replaces a previous one that included unnecessary commits. This version is rebased and clean for easier review.
Fixes #184
Before submitting
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.