Skip to content
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

[NeMo UX] Support generating datasets using different train/valid/test distributions #9771

Merged
merged 7 commits into from
Jul 23, 2024

Conversation

ashors1
Copy link
Collaborator

@ashors1 ashors1 commented Jul 17, 2024

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

@ashors1 ashors1 requested a review from cuichenx July 17, 2024 18:31
@ashors1 ashors1 added Run CICD and removed Run CICD labels Jul 17, 2024
@ashors1 ashors1 requested a review from athitten July 18, 2024 00:55
@ashors1 ashors1 added Run CICD and removed Run CICD labels Jul 18, 2024
build_kwargs["blend_per_split"] = [
get_blend_from_list(paths["train"]),
get_blend_from_list(paths["validation"]),
get_blend_from_list(paths["test"]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashors1 does get_blend_from_list(paths["train"]) work even when you have multiple data files. For ex: {"train": /datafile1/, /datafile2/}. Also in this case if weights are ignored then is the dataset built with all samples from both /datafile1/ and /datafile2/ ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, get_blend_from_list(paths["train"]) works when you have multiple paths. You're also able to pass in weights by interleaving them with the paths. For example, the following would work:

paths={
            "train": [25, PATH1, 75, PATH2],
            "validation": [PATH3, PATH4],
            "test": ['1', PATH5], 
        }

The only time the weights are not used is when limit_val_batches <= 1.0, in which case we want to return the full validation dataset. In this case, users are expected not to provide weights for the paths.

@ashors1 ashors1 added Run CICD and removed Run CICD labels Jul 19, 2024
@ericharper ericharper added 2.0.0rc1 bug Something isn't working labels Jul 19, 2024
@ashors1 ashors1 requested a review from athitten July 19, 2024 23:08
Copy link
Collaborator

@athitten athitten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @ashors1! Also for future references might be good to document the behavior of the megatron datasets as to what is supported and what is not.

@ashors1 ashors1 merged commit 5143065 into r2.0.0rc1 Jul 23, 2024
332 checks passed
@ashors1 ashors1 deleted the ashors/nemo-ux-dataloader-distributions branch July 23, 2024 03:13
github-actions bot pushed a commit that referenced this pull request Jul 23, 2024
…t distributions (#9771)

* support building train/valid/test datasets from separate distributions

Signed-off-by: ashors1 <[email protected]>

* add minimal test

Signed-off-by: ashors1 <[email protected]>

* Apply isort and black reformatting

Signed-off-by: ashors1 <[email protected]>

* set limit_val_batches for nemo 2 example

Signed-off-by: ashors1 <[email protected]>

* improve assert statement

Signed-off-by: ashors1 <[email protected]>

* Apply isort and black reformatting

Signed-off-by: ashors1 <[email protected]>

---------

Signed-off-by: ashors1 <[email protected]>
Signed-off-by: ashors1 <[email protected]>
Co-authored-by: ashors1 <[email protected]>
ashors1 added a commit that referenced this pull request Jul 26, 2024
…t distributions (#9771) (#9841)

* support building train/valid/test datasets from separate distributions



* add minimal test



* Apply isort and black reformatting



* set limit_val_batches for nemo 2 example



* improve assert statement



* Apply isort and black reformatting



---------

Signed-off-by: ashors1 <[email protected]>
Signed-off-by: ashors1 <[email protected]>
Co-authored-by: Anna Shors <[email protected]>
Co-authored-by: ashors1 <[email protected]>
BoxiangW pushed a commit to BoxiangW/NeMo that referenced this pull request Jul 30, 2024
…t distributions (NVIDIA#9771) (NVIDIA#9841)

* support building train/valid/test datasets from separate distributions

* add minimal test

* Apply isort and black reformatting

* set limit_val_batches for nemo 2 example

* improve assert statement

* Apply isort and black reformatting

---------

Signed-off-by: ashors1 <[email protected]>
Signed-off-by: ashors1 <[email protected]>
Co-authored-by: Anna Shors <[email protected]>
Co-authored-by: ashors1 <[email protected]>
Signed-off-by: Boxiang Wang <[email protected]>
xuanzic pushed a commit to xuanzic/NeMo that referenced this pull request Aug 1, 2024
…t distributions (NVIDIA#9771) (NVIDIA#9841)

* support building train/valid/test datasets from separate distributions

* add minimal test

* Apply isort and black reformatting

* set limit_val_batches for nemo 2 example

* improve assert statement

* Apply isort and black reformatting

---------

Signed-off-by: ashors1 <[email protected]>
Signed-off-by: ashors1 <[email protected]>
Co-authored-by: Anna Shors <[email protected]>
Co-authored-by: ashors1 <[email protected]>
Signed-off-by: Vivian Chen <[email protected]>
monica-sekoyan pushed a commit that referenced this pull request Oct 14, 2024
…t distributions (#9771) (#9841)

* support building train/valid/test datasets from separate distributions



* add minimal test



* Apply isort and black reformatting



* set limit_val_batches for nemo 2 example



* improve assert statement



* Apply isort and black reformatting



---------

Signed-off-by: ashors1 <[email protected]>
Signed-off-by: ashors1 <[email protected]>
Co-authored-by: Anna Shors <[email protected]>
Co-authored-by: ashors1 <[email protected]>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
…t distributions (NVIDIA#9771) (NVIDIA#9841)

* support building train/valid/test datasets from separate distributions



* add minimal test



* Apply isort and black reformatting



* set limit_val_batches for nemo 2 example



* improve assert statement



* Apply isort and black reformatting



---------

Signed-off-by: ashors1 <[email protected]>
Signed-off-by: ashors1 <[email protected]>
Co-authored-by: Anna Shors <[email protected]>
Co-authored-by: ashors1 <[email protected]>
Signed-off-by: Hainan Xu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Run CICD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants