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

llm performance scripts #11736

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open

llm performance scripts #11736

wants to merge 34 commits into from

Conversation

malay-nagda
Copy link
Collaborator

@malay-nagda malay-nagda commented Jan 2, 2025

What does this PR do ?

Adds scripts for llm pre-training and fine-tuning, optimized for performance

Collection: [llm]

Changelog

Added arg params for HuggingFace Token, NEMO_HOME env var and fine-tuning scheme

-hf/--hf_token # needed for downloading checkpoints and tokenizers from HF
-nh/--nemo_home # needed for accessing locally stored checkpoints and tokenizers
-f/--finetuning # 'lora' or 'sft'. default is 'lora' 

Usage

python3 scripts/llm/performance/pretrain_llama3_8b.py -a <slurm_account> -p <slurm_partition>

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: Malay Nagda <[email protected]>
malay-nagda and others added 2 commits January 7, 2025 17:31
Signed-off-by: Malay Nagda <[email protected]>
@malay-nagda malay-nagda changed the title finetuning llama3 8b finetuning llama3 Jan 7, 2025
scripts/llm/performance/utils.py Fixed Show fixed Hide fixed
scripts/llm/performance/utils.py Fixed Show fixed Hide fixed
scripts/llm/performance/utils.py Fixed Show fixed Hide fixed
@github-actions github-actions bot added the NLP label Jan 13, 2025
@malay-nagda malay-nagda marked this pull request as ready for review January 13, 2025 09:36
@malay-nagda malay-nagda requested a review from erhoo82 January 13, 2025 09:36
Signed-off-by: Malay Nagda <[email protected]>
malay-nagda and others added 2 commits January 13, 2025 09:57
@malay-nagda malay-nagda changed the title finetuning llama3 llm performance scripts Jan 13, 2025
@malay-nagda malay-nagda requested a review from vysarge January 13, 2025 10:25
malay-nagda and others added 3 commits January 13, 2025 16:21
Signed-off-by: Malay Nagda <[email protected]>
Signed-off-by: Malay Nagda <[email protected]>
Signed-off-by: Malay Nagda <[email protected]>
Copy link
Contributor

[🤖]: Hi @malay-nagda 👋,

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

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g

scripts/llm/performance/utils.py Outdated Show resolved Hide resolved
scripts/llm/performance/utils.py Outdated Show resolved Hide resolved
Signed-off-by: Malay Nagda <[email protected]>
Signed-off-by: Malay Nagda <[email protected]>
Signed-off-by: Malay Nagda <[email protected]>
Signed-off-by: Malay Nagda <[email protected]>
Copy link
Contributor

beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base.


Your code was analyzed with PyLint. The following annotations have been identified:

************* Module nemo.collections.nlp.modules.common.tokenizer_utils
nemo/collections/nlp/modules/common/tokenizer_utils.py:73:0: C0301: Line too long (199/119) (line-too-long)
nemo/collections/nlp/modules/common/tokenizer_utils.py:96:0: C0301: Line too long (149/119) (line-too-long)
nemo/collections/nlp/modules/common/tokenizer_utils.py:131:0: C0301: Line too long (146/119) (line-too-long)
nemo/collections/nlp/modules/common/tokenizer_utils.py:233:0: C0301: Line too long (146/119) (line-too-long)
nemo/collections/nlp/modules/common/tokenizer_utils.py:42:0: C0115: Missing class docstring (missing-class-docstring)

-----------------------------------
Your code has been rated at 9.50/10

Mitigation guide:

  • Add sensible and useful docstrings to functions and methods
  • For trivial methods like getter/setters, consider adding # pylint: disable=C0116 inside the function itself
  • To disable multiple functions/methods at once, put a # pylint: disable=C0116 before the first and a # pylint: enable=C0116 after the last.

By applying these rules, we reduce the occurance of this message in future.

Thank you for improving NeMo's documentation!

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.

2 participants