Skip to content

Conversation

soluwalana
Copy link
Collaborator

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Updates the GPTSFTChatDataset to use the messages format from OpenAI
Updates sequence packing to be compatible with GPTSFTChatDataset

Collection: llm

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)

@soluwalana soluwalana force-pushed the solu/chat-dataset-changes branch from 3b2f54f to e198f58 Compare April 30, 2025 23:17
@ericharper ericharper requested a review from athitten April 30, 2025 23:24
@soluwalana soluwalana force-pushed the solu/chat-dataset-changes branch 2 times, most recently from 5f3f565 to 407cd34 Compare April 30, 2025 23:27
@soluwalana soluwalana force-pushed the solu/chat-dataset-changes branch from 431c39a to 330b15b Compare May 1, 2025 16:55
@soluwalana soluwalana force-pushed the solu/chat-dataset-changes branch from 9994375 to a313478 Compare May 2, 2025 17:57
@athitten
Copy link
Collaborator

athitten commented May 2, 2025

I reviewed that parts that I could and left comments, but I feel for changes in GPTSFTChatDataset class, nemo/collections/llm/gpt/data/packed_sequence.py, nemo/utils/sequence_packing_utils.py its good to get review from @cuichenx who is the PIC for SFT and packed sequence in NeMo. @cuichenx could you please review these files ? Thanks!

Also for nemo/collections/llm/gpt/model/llama_nemotron.py @suiyoubi could you please take a look ? Thanks!

cuichenx
cuichenx previously approved these changes May 8, 2025
Copy link
Collaborator

@cuichenx cuichenx left a comment

Choose a reason for hiding this comment

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

Thanks, all LGTM

suiyoubi
suiyoubi previously approved these changes May 8, 2025
Copy link
Collaborator

@suiyoubi suiyoubi left a comment

Choose a reason for hiding this comment

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

Looks good to me. thank you

athitten
athitten previously approved these changes May 9, 2025
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.

Thanks for addressing all comments @soluwalana ! LGTM

@github-actions github-actions bot removed the Run CICD label May 10, 2025
@soluwalana soluwalana dismissed stale reviews from athitten, suiyoubi, and cuichenx via 741d2f0 May 12, 2025 18:31
@soluwalana soluwalana force-pushed the solu/chat-dataset-changes branch from 33f8a5c to e7397c5 Compare May 12, 2025 19:43
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Sam O <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>
Copy link
Contributor

[🤖]: Hi @soluwalana 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc

@github-actions github-actions bot removed the Run CICD label May 29, 2025
Copy link
Collaborator

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

@cuichenx cuichenx merged commit 3768ea6 into main May 29, 2025
270 of 271 checks passed
@cuichenx cuichenx deleted the solu/chat-dataset-changes branch May 29, 2025 16:19
shjwudp pushed a commit to shjwudp/NeMo that referenced this pull request May 31, 2025
…y with packed sequences (NVIDIA-NeMo#13367)

* feat - GPTSFTChatDataset alignment with OpenAI Messages, compatibility with packed sequences

Signed-off-by: Sam O <[email protected]>

* feat - GPTSFTChatDataset alignment with OpenAI Messages, compatibility with packed sequences

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* lint

Apply isort and black reformatting

Signed-off-by: soluwalana <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>

* update test case

Signed-off-by: Sam Oluwalana <[email protected]>

* F string lint issue

Signed-off-by: Sam Oluwalana <[email protected]>

* Lint line length

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Apply isort and black reformatting

Signed-off-by: Sam Oluwalana <[email protected]>

* More lint

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* More lint

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Missing parameters

Signed-off-by: Sam Oluwalana <[email protected]>

* Don't download the model everytime

>

Signed-off-by: Sam Oluwalana <[email protected]>

* Code lint

Signed-off-by: Sam Oluwalana <[email protected]>

* Rollback change on whitespace in sentencepiece tokenizer

Signed-off-by: Sam Oluwalana <[email protected]>

* Ensure all loss_masks are labeled as loss_mask

Update Tests

Signed-off-by: Sam Oluwalana <[email protected]>

do not overwrite chat_template by default

Signed-off-by: Alexandros Koumparoulis <[email protected]>

Can't relative import test function

Signed-off-by: Sam Oluwalana <[email protected]>

.

* Apply isort and black reformatting

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

* Remove duplicate function left in for rebase only"

Signed-off-by: Sam Oluwalana <[email protected]>

* label loss mask actually loss mask (as there is an attention mask as well)

Signed-off-by: Sam Oluwalana <[email protected]>

* Lint line length

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* default use_hf_tokenzier_chat_template = True

Signed-off-by: Sam Oluwalana <[email protected]>

* Add original build_samples_mapping back in

Signed-off-by: Sam Oluwalana <[email protected]>

* PR feedback incorporation

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* PR feedback incorporation

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Fix tests

Signed-off-by: Sam O <[email protected]>

* Apply isort and black reformatting

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

* PR changes

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Skip eval unit test (NVIDIA-NeMo#13635)

Signed-off-by: Charlie Truong <[email protected]>

* Map directly to the NeMo tokenizer path

Signed-off-by: Sam Oluwalana <[email protected]>

* Rollback change pointing to image cache

Signed-off-by: Sam Oluwalana <[email protected]>

* Potential fix for code scanning alert no. 14984: Unused import

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Sam O <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>

* correct path in TestData

Signed-off-by: Sam Oluwalana <[email protected]>

* correct path in TestData

Signed-off-by: Sam Oluwalana <[email protected]>

---------

Signed-off-by: Sam O <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>
Signed-off-by: soluwalana <[email protected]>
Signed-off-by: Charlie Truong <[email protected]>
Signed-off-by: Sam O <[email protected]>
Co-authored-by: soluwalana <[email protected]>
Co-authored-by: Charlie Truong <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: jianbinc <[email protected]>
nasretdinovr pushed a commit to nasretdinovr/NeMo that referenced this pull request Aug 8, 2025
…y with packed sequences (NVIDIA-NeMo#13367)

* feat - GPTSFTChatDataset alignment with OpenAI Messages, compatibility with packed sequences

Signed-off-by: Sam O <[email protected]>

* feat - GPTSFTChatDataset alignment with OpenAI Messages, compatibility with packed sequences

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* lint

Apply isort and black reformatting

Signed-off-by: soluwalana <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>

* update test case

Signed-off-by: Sam Oluwalana <[email protected]>

* F string lint issue

Signed-off-by: Sam Oluwalana <[email protected]>

* Lint line length

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Apply isort and black reformatting

Signed-off-by: Sam Oluwalana <[email protected]>

* More lint

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* More lint

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Missing parameters

Signed-off-by: Sam Oluwalana <[email protected]>

* Don't download the model everytime

>

Signed-off-by: Sam Oluwalana <[email protected]>

* Code lint

Signed-off-by: Sam Oluwalana <[email protected]>

* Rollback change on whitespace in sentencepiece tokenizer

Signed-off-by: Sam Oluwalana <[email protected]>

* Ensure all loss_masks are labeled as loss_mask

Update Tests

Signed-off-by: Sam Oluwalana <[email protected]>

do not overwrite chat_template by default

Signed-off-by: Alexandros Koumparoulis <[email protected]>

Can't relative import test function

Signed-off-by: Sam Oluwalana <[email protected]>

.

* Apply isort and black reformatting

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

* Remove duplicate function left in for rebase only"

Signed-off-by: Sam Oluwalana <[email protected]>

* label loss mask actually loss mask (as there is an attention mask as well)

Signed-off-by: Sam Oluwalana <[email protected]>

* Lint line length

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* default use_hf_tokenzier_chat_template = True

Signed-off-by: Sam Oluwalana <[email protected]>

* Add original build_samples_mapping back in

Signed-off-by: Sam Oluwalana <[email protected]>

* PR feedback incorporation

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* PR feedback incorporation

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Fix tests

Signed-off-by: Sam O <[email protected]>

* Apply isort and black reformatting

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

* PR changes

Signed-off-by: Sam Oluwalana <[email protected]>

* Apply isort and black reformatting

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

* Skip eval unit test (NVIDIA-NeMo#13635)

Signed-off-by: Charlie Truong <[email protected]>

* Map directly to the NeMo tokenizer path

Signed-off-by: Sam Oluwalana <[email protected]>

* Rollback change pointing to image cache

Signed-off-by: Sam Oluwalana <[email protected]>

* Potential fix for code scanning alert no. 14984: Unused import

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Sam O <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>

* correct path in TestData

Signed-off-by: Sam Oluwalana <[email protected]>

* correct path in TestData

Signed-off-by: Sam Oluwalana <[email protected]>

---------

Signed-off-by: Sam O <[email protected]>
Signed-off-by: Sam Oluwalana <[email protected]>
Signed-off-by: soluwalana <[email protected]>
Signed-off-by: Charlie Truong <[email protected]>
Signed-off-by: Sam O <[email protected]>
Co-authored-by: soluwalana <[email protected]>
Co-authored-by: Charlie Truong <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants