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

switch to mcore dataset [with FIM support] #8149

Merged
merged 49 commits into from
Jan 25, 2024
Merged

switch to mcore dataset [with FIM support] #8149

merged 49 commits into from
Jan 25, 2024

Conversation

dimapihtar
Copy link
Collaborator

@dimapihtar dimapihtar commented Jan 10, 2024

What does this PR do ?

  1. Switches to megatron core dataset.
  2. Adds FIM support.
  3. Adds starcoder config.

Collection: NLP

Changelog

  • Added additional functions in oreder to use mcore ds.
  • Changed NeMo ds classes to mcore ds classes (megatron_gpt_model.py).
  • Created gpt_fim_dataset.py with GPTFIMDatasetConfig and GPTFIMDataset classes in order to use FIM techinque.
  • Added new config for starcoder models (megatron_starcoder_config.yaml).

Usage

Example of FIM usage. This part should be added to the data section in the model config:

add_fim: True # Set to True to use FIM
    fim:
      # fill in the middle
      rate: 0.5 # Probability to convert a training sample into a "Fill-in-the-Middle" format. Must be between 0 and 1
      spm_rate: 0.5 # Probability that the a FIM sample uses the SPM format over the PSM format
      split_sample: null # String around which to split the sample for FIM. If None (default), FIM is applied on the sample-level
      fragment_rate: 0.5 # Rate of FIM on each fragment when fim_split_sample is not None
      no_prefix: null # Do not apply FIM to fragments that start with this prefix
      extra_tokens:
        prefix: "<fim_prefix>"
        middle: "<fim_middle>"
        suffix: "<fim_suffix>"
        pad: "<fim_pad>"
        eod: "<|endoftext|>"

Jenkins CI

To run Jenkins, a NeMo User with write access must comment jenkins on the PR.

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 <[email protected]>
@github-actions github-actions bot added the NLP label Jan 10, 2024
@dimapihtar dimapihtar changed the title switch to mcore dataset switch to mcore dataset [with FIM support] Jan 15, 2024
@github-actions github-actions bot added the CI label Jan 16, 2024
@dimapihtar
Copy link
Collaborator Author

jenkins

Signed-off-by: dimapihtar <[email protected]>
@dimapihtar
Copy link
Collaborator Author

jenkins

@dimapihtar
Copy link
Collaborator Author

jenkins

@dimapihtar
Copy link
Collaborator Author

jenkins

@dimapihtar
Copy link
Collaborator Author

jenkins

@dimapihtar
Copy link
Collaborator Author

jenkins

@dimapihtar
Copy link
Collaborator Author

jenkins

Copy link
Collaborator

@ericharper ericharper 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!

@ericharper ericharper merged commit a93589d into main Jan 25, 2024
15 checks passed
@ericharper ericharper deleted the dpykhtar/mcore_ds branch January 25, 2024 22:30
yaoyu-33 pushed a commit that referenced this pull request Jan 31, 2024
* switch to mcore dataset

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* fix rank issue

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

* fix rank issue

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unnecessary prints

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

* fix typo

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add FIM support

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* change if statement

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

* add starcoder config

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

* add starcoder config

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

* remove commented lines

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

* code changes

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

* change mcore commit

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

* add copyright header

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

* code changes

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

* remove if statement

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

* fix batch for fine-tuning

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

* move is_dataset_built_on_rank function

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* config changes

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

* revert gpt config

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

* revert falcon model

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

* fix falcon tests

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

* fix tests

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* comment out MockGPTDataset test

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

---------

Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: Dmytro Pykhtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
stevehuang52 pushed a commit that referenced this pull request Jan 31, 2024
* switch to mcore dataset

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* fix rank issue

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

* fix rank issue

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unnecessary prints

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

* fix typo

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add FIM support

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* change if statement

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

* add starcoder config

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

* add starcoder config

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

* remove commented lines

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

* code changes

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

* change mcore commit

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

* add copyright header

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

* code changes

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

* remove if statement

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

* fix batch for fine-tuning

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

* move is_dataset_built_on_rank function

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* config changes

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

* revert gpt config

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

* revert falcon model

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

* fix falcon tests

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

* fix tests

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* comment out MockGPTDataset test

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

---------

Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: Dmytro Pykhtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: stevehuang52 <[email protected]>
ssh-meister pushed a commit to ssh-meister/NeMo that referenced this pull request Feb 15, 2024
* switch to mcore dataset

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* fix rank issue

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

* fix rank issue

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unnecessary prints

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

* fix typo

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add FIM support

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* change if statement

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

* add starcoder config

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

* add starcoder config

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

* remove commented lines

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

* code changes

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

* change mcore commit

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

* add copyright header

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

* code changes

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

* remove if statement

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

* fix batch for fine-tuning

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

* move is_dataset_built_on_rank function

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* config changes

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

* revert gpt config

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

* revert falcon model

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

* fix falcon tests

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

* fix tests

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* comment out MockGPTDataset test

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

---------

Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: Dmytro Pykhtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Sasha Meister <[email protected]>
pablo-garay pushed a commit that referenced this pull request Mar 19, 2024
* switch to mcore dataset

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* fix rank issue

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

* fix rank issue

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unnecessary prints

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

* fix typo

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add FIM support

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* change if statement

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

* add starcoder config

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

* add starcoder config

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

* remove commented lines

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

* code changes

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

* change mcore commit

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

* add copyright header

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

* code changes

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

* remove if statement

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

* fix batch for fine-tuning

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

* move is_dataset_built_on_rank function

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* config changes

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

* revert gpt config

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

* revert falcon model

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

* fix falcon tests

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

* fix tests

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* comment out MockGPTDataset test

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

---------

Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: Dmytro Pykhtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Pablo Garay <[email protected]>
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
* switch to mcore dataset

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* fix rank issue

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

* fix rank issue

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unnecessary prints

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

* fix typo

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add FIM support

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* change if statement

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

* add starcoder config

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

* add starcoder config

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

* remove commented lines

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

* code changes

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

* change mcore commit

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

* add copyright header

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

* code changes

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

* remove if statement

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

* fix batch for fine-tuning

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

* move is_dataset_built_on_rank function

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove commented lines

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

* config changes

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

* revert gpt config

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

* revert falcon model

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

* fix falcon tests

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

* fix tests

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert gpt config

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

* comment out MockGPTDataset test

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

---------

Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: Dmytro Pykhtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

None yet

2 participants