-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 tutorial for Llama-3-8B lora training and deployment #9359
Conversation
shashank3959
commented
Jun 3, 2024
- Adds a notebook for Llama-3-8b LoRA PEFT with NeMo FW
- Adds a notebook for sending multi-LoRA inference request to NVIDIA NIM
- Adds README that includes instructions fore context and set up
* Adds a notebook for Llama-3-8b LORA PEFT with NeMo FW * Adds a notebook for sending multi-LoRA inference request to NIM * Adds README that includes instructions fore context and set up Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
052b5b4
to
3376844
Compare
@chrisalexiuk-nvidia @vinhngx could you please review? |
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Adding @nealvaidya for any review comments covering the NIM part |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few things, mostly in readme. NIM notebook looks good
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
tutorials/llm/llama-3/README.rst
Outdated
`2. Multi-LoRA inference with NVIDIA NIM <./llama3-lora-deploy-nim.ipynb>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
This is a demonstration of deploying multiple LoRA adapters with NVIDIA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This procedure demonstrates how to deploy multiple LoRA adapters with NVIDIA . . .
tutorials/llm/llama-3/README.rst
Outdated
Hugging Face model formats. We will deploy the PubMedQA LoRA adapter | ||
from the first notebook, alongside two other already trained LoRA adapters | ||
(`GSM8K <https://github.com/openai/grade-school-math>`__, | ||
`SQuAD <https://rajpurkar.github.io/SQuAD-explorer/>`__) that are | ||
available on NVIDIA NGC as examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will deploy the PubMedQA LoRA adapter
from the first notebook, alongside two previously trained LoRA adapters
(GSM8K <https://github.com/openai/grade-school-math>
,
SQuAD <https://rajpurkar.github.io/SQuAD-explorer/>
) that are
available on NVIDIA NGC as examples.
tutorials/llm/llama-3/README.rst
Outdated
``NOTE``: While it’s not necessary to complete the LoRA training and | ||
obtain the adapter from the previous notebook (“Creating a LoRA adapter | ||
with NeMo Framework”) to follow along with this one, it is recommended | ||
if possible. You can still learn about LoRA deployment with NIM using | ||
the other adapters downloaded from NGC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. note::
Although it’s not necessary that you complete the LoRA training and secure the adapter from the preceding notebook (“Creating a LoRA adapter with NeMo Framework”) to proceed with this one, it is advisable. Regardless, you can continue to learn about LoRA deployment with NIM using other adapters that you’ve downloaded from NVIDIA NGC.
tutorials/llm/llama-3/README.rst
Outdated
1. Download example LoRA adapters | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Download the example LoRA adapters.
Comment on edits: Changes this step to a sentence and remove the Heading 3 tag ^^^^^^^^^^^^^^^^^^
tutorials/llm/llama-3/README.rst
Outdated
1. Download example LoRA adapters | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
The following steps assume that you have authenticated with NGC and downloaded the CLI tool, as mentioned in pre-requisites. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following steps assume that you have authenticated with NGC and downloaded the CLI tool, as listed in the Requirements section.
tutorials/llm/llama-3/README.rst
Outdated
2. Prepare the LoRA model store | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Prepare the LoRA model store.
Comment on edits: Changes this step to a sentence and remove the Heading 3 tag ^^^^^^^^^^^^^^^^^^
tutorials/llm/llama-3/README.rst
Outdated
3. Set-up NIM | ||
^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Set Up NIM.
Comment on edits: Changes this step to a sentence and remove the Heading 3 tag ^^^^^^^^^^^^^^^^^^
tutorials/llm/llama-3/README.rst
Outdated
-p 8000:8000 \ | ||
nvcr.io/nim/meta/llama3-8b-instruct:1.0.0 | ||
|
||
The first time you run the command, it will download the model and cache it in ``$NIM_CACHE_PATH`` so subsequent deployments are even faster. There are several options to configure NIM other than the ones listed above, and you can find a full list in `NIM configuration <https://docs.nvidia.com/nim/large-language-models/latest/configuration.html>`__ documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several options to configure NIM other than the ones listed above. You can find a full list in NIM configuration documentation.
tutorials/llm/llama-3/README.rst
Outdated
4. Start the notebook | ||
^^^^^^^^^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Start the notebook.
Comment on edits: Changes this step to a sentence and remove the Heading 3 tag ^^^^^^^^^^^^^^^^^^
tutorials/llm/llama-3/README.rst
Outdated
From another terminal, follow the same instructions as the previous | ||
notebook to launch Jupyter Lab, and navigate to `this notebook <./llama3-lora-deploy-nim.ipynb>`__. | ||
|
||
You may use the same NeMo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the same NeMo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed review of ReadMe.rst
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
tutorials/llm/llama-3/README.rst
Outdated
@@ -1,63 +1,47 @@ | |||
Llama 3 LoRA fine-tuning and deployment with NeMo Framework and NVIDIA NIM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Llama 3 LoRA Fine-Tuning and Deployment with NeMo Framework and NVIDIA NIM
Comment on edits: Missed this change. Title should be capitalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed one change. Title should be capitalized: Llama 3 LoRA Fine-Tuning and Deployment with NeMo Framework and NVIDIA NIM
Signed-off-by: Shashank Verma <shashank3959@gmail.com>
Approved comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving based on other reviews.
* Add tutorial for Llama-3-8B lora training and deployment * Adds a notebook for Llama-3-8b LORA PEFT with NeMo FW * Adds a notebook for sending multi-LoRA inference request to NIM * Adds README that includes instructions fore context and set up Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Add inference for other LoRAs in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in path in LoRA training notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typos and add end-2-end diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor issue in architecture diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Convert README from .md to .rst Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Incorporate review suggestions Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Remove access token Invaidate and removes HF access token Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix broken link to NIM docs Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor typo in README parameter name Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix gramma and inconsistencies in style and formatting Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Capitalize Title Signed-off-by: Shashank Verma <shashank3959@gmail.com> --------- Signed-off-by: Shashank Verma <shashank3959@gmail.com> Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
* Add tutorial for Llama-3-8B lora training and deployment * Adds a notebook for Llama-3-8b LORA PEFT with NeMo FW * Adds a notebook for sending multi-LoRA inference request to NIM * Adds README that includes instructions fore context and set up Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Add inference for other LoRAs in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in path in LoRA training notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typos and add end-2-end diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor issue in architecture diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Convert README from .md to .rst Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Incorporate review suggestions Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Remove access token Invaidate and removes HF access token Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix broken link to NIM docs Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor typo in README parameter name Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix gramma and inconsistencies in style and formatting Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Capitalize Title Signed-off-by: Shashank Verma <shashank3959@gmail.com> --------- Signed-off-by: Shashank Verma <shashank3959@gmail.com>
* Add tutorial for Llama-3-8B lora training and deployment * Adds a notebook for Llama-3-8b LORA PEFT with NeMo FW * Adds a notebook for sending multi-LoRA inference request to NIM * Adds README that includes instructions fore context and set up Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Add inference for other LoRAs in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in path in LoRA training notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typos and add end-2-end diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor issue in architecture diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Convert README from .md to .rst Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Incorporate review suggestions Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Remove access token Invaidate and removes HF access token Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix broken link to NIM docs Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor typo in README parameter name Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix gramma and inconsistencies in style and formatting Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Capitalize Title Signed-off-by: Shashank Verma <shashank3959@gmail.com> --------- Signed-off-by: Shashank Verma <shashank3959@gmail.com>
* Add tutorial for Llama-3-8B lora training and deployment * Adds a notebook for Llama-3-8b LORA PEFT with NeMo FW * Adds a notebook for sending multi-LoRA inference request to NIM * Adds README that includes instructions fore context and set up Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Add inference for other LoRAs in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in path in LoRA training notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typos and add end-2-end diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor issue in architecture diagram Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Convert README from .md to .rst Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix typo in deployment notebook Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Incorporate review suggestions Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Minor updates to README Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Remove access token Invaidate and removes HF access token Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix broken link to NIM docs Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix minor typo in README parameter name Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Fix gramma and inconsistencies in style and formatting Signed-off-by: Shashank Verma <shashank3959@gmail.com> * Capitalize Title Signed-off-by: Shashank Verma <shashank3959@gmail.com> --------- Signed-off-by: Shashank Verma <shashank3959@gmail.com>