-
Notifications
You must be signed in to change notification settings - Fork 8
docs: Add Quickstart and tutorials for NeMo FW #375
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
958105d
add quickstart for nemo fw
marta-sd eeaf41f
link notebooks for nemo fw
marta-sd 8f1f668
add nemo-run tutorial
marta-sd 1e8a14a
Merge branch 'main' into martas/nemo-fw-docs
marta-sd 6270783
fix prerequisites for NeMo FW quickstart
marta-sd d0e6383
move comment on evaluation inside the snippet
marta-sd 4a14ba2
Apply suggestions from code review
marta-sd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| #!/usr/bin/env python3 | ||
|
|
||
| # [snippet-start] | ||
| # Start Python in a new terminal | ||
| # 3. Launch evaluation: | ||
|
|
||
| from nemo_evaluator.api import evaluate | ||
| from nemo_evaluator.api.api_dataclasses import ( | ||
| ApiEndpoint, | ||
| EvaluationConfig, | ||
| EvaluationTarget, | ||
| ) | ||
|
|
||
| # Configure evaluation | ||
| api_endpoint = ApiEndpoint( | ||
| url="http://0.0.0.0:8080/v1/completions/", | ||
| type="completions", | ||
| model_id="megatron_model", | ||
| ) | ||
| target = EvaluationTarget(api_endpoint=api_endpoint) | ||
| config = EvaluationConfig(type="gsm8k", output_dir="results") | ||
|
|
||
| # Run evaluation | ||
| results = evaluate(target_cfg=target, eval_cfg=config) | ||
| print(results) | ||
| # [snippet-end] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,23 @@ | ||
| --- | ||
| orphan: true | ||
| --- | ||
|
|
||
| (tutorials-overview)= | ||
|
|
||
| # Tutorials | ||
|
|
||
| Master {{ product_name_short }} with hands-on tutorials and practical examples. | ||
|
|
||
| ## Before You Start | ||
|
|
||
| Before starting the tutorials, ensure you have: | ||
|
|
||
| - **NeMo Framework Container**: Running the latest [NeMo Framework container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo) | ||
| - **Model Checkpoint**: Access to a NeMo 2.0 checkpoint (tutorials use Llama 3.2 1B Instruct) | ||
| - **GPU Resources**: CUDA-compatible GPU with sufficient memory | ||
| - **Jupyter Environment**: Ability to run Jupyter notebooks | ||
|
|
||
| --- | ||
|
|
||
| ## Available Tutorials | ||
|
|
||
| Build your expertise with these progressive tutorials: | ||
|
|
||
| ::::{grid} 1 2 2 2 | ||
| :gutter: 1 1 1 2 | ||
|
|
||
| :::{grid-item-card} {octicon}`play;1.5em;sd-mr-1` 1. MMLU Evaluation | ||
| :link: https://github.com/NVIDIA-NeMo/Eval/tree/main/tutorials/mmlu.ipynb | ||
| :link-type: url | ||
| Deploy models and run evaluations with the MMLU benchmark for both completions and chat endpoints. | ||
| ::: | ||
|
|
||
| :::{grid-item-card} {octicon}`package;1.5em;sd-mr-1` 2. Simple Evals Framework | ||
| :link: https://github.com/NVIDIA-NeMo/Eval/tree/main/tutorials/simple-evals.ipynb | ||
| :link-type: url | ||
| Discover how to extend evaluation capabilities by installing additional frameworks and running HumanEval coding assessments. | ||
| ::: | ||
|
|
||
| :::{grid-item-card} {octicon}`tools;1.5em;sd-mr-1` 3. Custom Tasks | ||
| :link: https://github.com/NVIDIA-NeMo/Eval/tree/main/tutorials/wikitext.ipynb | ||
| :link-type: url | ||
| Master custom evaluation workflows by running WikiText benchmark with advanced configuration and log-probability analysis. | ||
| :::{grid-item-card} {octicon}`play;1.5em;sd-mr-1` Evaluation with NeMo Framework | ||
| :link: nemo-fw/index | ||
| :link-type: doc | ||
| Deploy models and run evaluations using NeMo Framework container. | ||
| ::: | ||
|
|
||
| :::{grid-item-card} {octicon}`package-dependents;1.5em;sd-mr-1` 4. Create a Framework Definition File | ||
| :::{grid-item-card} {octicon}`package-dependents;1.5em;sd-mr-1` Create a Framework Definition File | ||
| :link: create-framework-definition-file | ||
| :link-type: ref | ||
| Integrate your custom evaluation framework with {{ product_name_short }} by creating a Framework Definition File (FDF). | ||
| ::: | ||
|
|
||
| :::: | ||
|
|
||
| ## Run the Tutorials | ||
|
|
||
| 1. Start NeMo Framework Container: | ||
| ```bash | ||
| docker run --rm -it -w /workdir -v $(pwd):/workdir \ | ||
| --entrypoint bash --gpus all \ | ||
| nvcr.io/nvidia/nemo:${TAG} | ||
| ``` | ||
|
|
||
| 2. Launch Jupyter: | ||
| ```bash | ||
| jupyter lab --ip=0.0.0.0 --port=8888 --allow-root | ||
| ``` | ||
|
|
||
| 3. Navigate to the `tutorials/` directory and open the desired notebook | ||
| :::: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
|
|
||
| # Tutorials for NeMo Framework | ||
|
|
||
| ## Before You Start | ||
|
|
||
| Before starting the tutorials, ensure you have: | ||
|
|
||
| - **NeMo Framework Container**: Running the latest [NeMo Framework container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo) | ||
| - **Model Checkpoint**: Access to a NeMo 2.0 checkpoint (tutorials use Llama 3.2 1B Instruct) | ||
| - **GPU Resources**: CUDA-compatible GPU with sufficient memory | ||
| - **Jupyter Environment**: Ability to run Jupyter notebooks | ||
|
|
||
| --- | ||
|
|
||
| ## Available Tutorials | ||
|
|
||
| Build your expertise with these progressive tutorials: | ||
|
|
||
| ::::{grid} 1 2 2 2 | ||
| :gutter: 1 1 1 2 | ||
|
|
||
| :::{grid-item-card} {octicon}`rocket;1.5em;sd-mr-1` Orchestrating evaluations with NeMo Run | ||
| :link: nemo-run | ||
| :link-type: doc | ||
| Launch deployment and evaluation jobs using NeMo Run. | ||
| ::: | ||
|
|
||
| :::{grid-item-card} {octicon}`play;1.5em;sd-mr-1` Basic evaluation with MMLU Evaluation | ||
| :link: https://github.com/NVIDIA-NeMo/Eval/tree/main/tutorials/mmlu.ipynb | ||
| :link-type: url | ||
| Deploy models and run evaluations with the MMLU benchmark for both completions and chat endpoints. | ||
| ::: | ||
|
|
||
| :::{grid-item-card} {octicon}`package;1.5em;sd-mr-1` Enable additional evaluation harnesses | ||
| :link: https://github.com/NVIDIA-NeMo/Eval/tree/main/tutorials/simple-evals.ipynb | ||
| :link-type: url | ||
| Discover how to extend evaluation capabilities by installing additional harnesses and running HumanEval coding assessments. | ||
| ::: | ||
|
|
||
| :::{grid-item-card} {octicon}`tools;1.5em;sd-mr-1` Configure custom tasks | ||
| :link: https://github.com/NVIDIA-NeMo/Eval/tree/main/tutorials/wikitext.ipynb | ||
| :link-type: url | ||
| Master custom evaluation workflows by running WikiText benchmark with advanced configuration and log-probability analysis. | ||
| ::: | ||
|
|
||
|
|
||
| :::: | ||
|
|
||
| ## Run the Notebook Tutorials | ||
|
|
||
| 1. Start NeMo Framework Container: | ||
| ```bash | ||
| docker run --rm -it -w /workdir -v $(pwd):/workdir \ | ||
| --entrypoint bash --gpus all \ | ||
| nvcr.io/nvidia/nemo:${TAG} | ||
| ``` | ||
|
|
||
| 2. Launch Jupyter: | ||
| ```bash | ||
| jupyter lab --ip=0.0.0.0 --port=8888 --allow-root | ||
| ``` | ||
|
|
||
| 3. Navigate to the `tutorials/` directory and open the desired notebook |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.