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

Add "offline" data cache generation support #9576

Merged
merged 7 commits into from
Jul 23, 2024
Merged

Conversation

dimapihtar
Copy link
Collaborator

@dimapihtar dimapihtar commented Jul 1, 2024

What does this PR do ?

  1. Adds "offline" data cache generation support. The training script will be stopped once data cache is generated.
  2. Enable mcore's num_dataset_builder_threads param usage.

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)

Signed-off-by: dimapihtar <dpihtar@gmail.com>
@github-actions github-actions bot added the NLP label Jul 1, 2024
Signed-off-by: dimapihtar <dpihtar@gmail.com>
@ericharper ericharper added the 2.0.0rc1 Planned release label Jul 18, 2024
@samskillman
Copy link

What is the reasoning behind overloading num_workers for the num_dataset_builder_threads, instead of passing num_dataset_builder_threads in as a separate config parameter?

I could imagine a case where I set num_dataset_builder_threads to a very large number (64 or 128) but wouldn't want that many workers during the typical data loading. That would allow many workloads to specify a high num_dataset_builder_threads without needing to explicitly use the data_cache_generation_only offline step.

Instead I would suggest num_dataset_builder_threads as an explicit new parameter in megatron_gpt_config.yaml, and default it to 1 to mirror https://github.com/NVIDIA/Megatron-LM/blob/e33c8f78a35765d5aa37475a144da60e8a2349d1/megatron/core/datasets/blended_megatron_dataset_config.py#L48

@dimapihtar
Copy link
Collaborator Author

What is the reasoning behind overloading num_workers for the num_dataset_builder_threads, instead of passing num_dataset_builder_threads in as a separate config parameter?

I could imagine a case where I set num_dataset_builder_threads to a very large number (64 or 128) but wouldn't want that many workers during the typical data loading. That would allow many workloads to specify a high num_dataset_builder_threads without needing to explicitly use the data_cache_generation_only offline step.

Instead I would suggest num_dataset_builder_threads as an explicit new parameter in megatron_gpt_config.yaml, and default it to 1 to mirror https://github.com/NVIDIA/Megatron-LM/blob/e33c8f78a35765d5aa37475a144da60e8a2349d1/megatron/core/datasets/blended_megatron_dataset_config.py#L48

thank you for the review, fixed.

Signed-off-by: dimapihtar <dpihtar@gmail.com>
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 @dimapihtar !

@dimapihtar dimapihtar merged commit 00fe96f into main Jul 23, 2024
263 of 407 checks passed
@dimapihtar dimapihtar deleted the dpykhtar/ds_updates branch July 23, 2024 16:45
tonyjie pushed a commit to tonyjie/NeMo that referenced this pull request Jul 24, 2024
* add "offline" data cache generation support

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert config

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add comment for data_cache_generation_only usage

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add num_dataset_builder_threads param

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix comment

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
akoumpa pushed a commit that referenced this pull request Jul 25, 2024
* add "offline" data cache generation support

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert config

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add comment for data_cache_generation_only usage

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add num_dataset_builder_threads param

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix comment

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
BoxiangW pushed a commit to BoxiangW/NeMo that referenced this pull request Jul 30, 2024
* add "offline" data cache generation support

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert config

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add comment for data_cache_generation_only usage

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add num_dataset_builder_threads param

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix comment

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: Boxiang Wang <boxiangw@nvidia.com>
dimapihtar added a commit that referenced this pull request Jul 31, 2024
Signed-off-by: dimapihtar <dpihtar@gmail.com>
pablo-garay pushed a commit that referenced this pull request Jul 31, 2024
* copy of #9576

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
Co-authored-by: dimapihtar <dimapihtar@users.noreply.github.com>
xuanzic pushed a commit to xuanzic/NeMo that referenced this pull request Aug 1, 2024
* add "offline" data cache generation support

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert config

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add comment for data_cache_generation_only usage

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add num_dataset_builder_threads param

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix comment

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: Vivian Chen <xuanzic@example.com>
kchike pushed a commit to kchike/NeMo that referenced this pull request Aug 8, 2024
* add "offline" data cache generation support

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert config

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add comment for data_cache_generation_only usage

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* add num_dataset_builder_threads param

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix comment

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: kchike <kohei.chike@jp.ricoh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants