Skip to content

Commit 3f159aa

Browse files
authored
Fix observability_evaluation_and_profiling example notebook (#1874)
* This notebook was installing the `nvidia-nat-profiling` package which was dropped in v1.5, causing the notebook to install nat v1.3 * Replace the model with a nano model to avoid being rate limited during the eval steps. * Update `migration-guide.md` to fix profiler installation instructions. * Replace broken documentation links (unrelated link check errors found in CI) ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/resources/contributing/index.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. ## Summary by CodeRabbit * **Documentation** * Updated NeMo Customizer links in the finetuning guide; revised packaging/install guidance to replace the profiling extra with profiler and document the eval/profiler split. * **Examples** * Updated Microservices setup link and cleaned README whitespace/formatting. * **Notebooks** * Switched profiling extra name to profiler and added eval where applicable; updated generated model/config defaults (model selection and token limits) and bumped notebook kernel/Python metadata. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - https://github.com/mnajafian-nv - Bryan Bednarski (https://github.com/bbednarski9) URL: #1874
1 parent b685539 commit 3f159aa

5 files changed

Lines changed: 31 additions & 24 deletions

File tree

docs/source/improve-workflows/finetuning/dpo_with_nemo_customizer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919

2020
# DPO with NeMo Customizer
2121

22-
This guide covers Direct Preference Optimization (DPO) training using the NeMo Agent Toolkit finetuning harness integrated with [NVIDIA NeMo Customizer](https://docs.nvidia.com/nemo/microservices/latest/fine-tune/index.html).
22+
This guide covers Direct Preference Optimization (DPO) training using the NeMo Agent Toolkit finetuning harness integrated with [NVIDIA NeMo Customizer](https://docs.nvidia.com/nemo/microservices/latest/customizer/index.html).
2323
This integration enables preference-based finetuning of large language models using NVIDIA's enterprise-grade training infrastructure.
2424

2525
## Understanding DPO
@@ -947,4 +947,4 @@ See the example's README for detailed instructions.
947947
- [Extending the Finetuning Harness](../../extend/custom-components/finetuning.md) - Creating custom components
948948
- [OpenPipe ART Integration](rl_with_openpipe.md) - Alternative RL training with ART
949949
- [Custom Evaluators](../../extend/custom-components/custom-evaluator.md) - Creating reward functions
950-
- [NeMo Customizer Documentation](https://docs.nvidia.com/nemo/microservices/latest/fine-tune/index.html) - Official NeMo Customizer documentation
950+
- [NeMo Customizer Documentation](https://docs.nvidia.com/nemo/microservices/latest/customizer/index.html) - Official NeMo Customizer documentation

docs/source/resources/migration-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,19 @@ NVIDIA NeMo Agent Toolkit 1.2 changed the name and API. Compatibility aliases an
133133
- All prior meta-packages have been removed.
134134
- `nvidia-nat-all` (no replacement, though `nvidia-nat[most]` extra does exist)
135135
- `nvidia-nat-ingestion` (no replacement; examples directly use dependencies)
136-
- `nvidia-nat-profiling` (use `nvidia-nat[profiling]`)
136+
- `nvidia-nat-profiling` (use `nvidia-nat[profiler]`)
137137

138138
#### Evaluation Package Split
139139

140-
Evaluation and profiling implementations moved out of core into the `nvidia-nat-eval` package.
140+
Evaluation and profiling implementations moved out of core into the `nvidia-nat-eval` and `nvidia-nat-profiler` packages.
141141

142142
To migrate:
143143
- Install evaluation support when needed:
144144
- `pip install "nvidia-nat[eval]"`
145145
- `pip install nvidia-nat-eval`
146146
- Install profiling support when needed:
147-
- `pip install "nvidia-nat[profiling]"`
148-
- `pip install "nvidia-nat-eval[profiling]"`
147+
- `pip install "nvidia-nat[profiler]"`
148+
- `pip install "nvidia-nat[eval, profiler]"`
149149
- Treat these commands as eval-owned commands that require `nvidia-nat-eval`: `nat eval`, `nat red-team`, and `nat sizing`.
150150

151151
#### Import Path Changes

examples/finetuning/dpo_tic_tac_toe/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The model learns to prefer responses similar to the chosen examples while avoidi
5353
## Prerequisites
5454

5555
> [!IMPORTANT]
56-
> This example assumes you are already familiar with the NVIDIA NeMo Microservices platform and have it set up and running. If you're new to NeMo Microservices, please refer to the [NeMo Microservices Setup Guide](https://docs.nvidia.com/nemo/microservices/latest/get-started/setup/index.html) first.
56+
> This example assumes you are already familiar with the NVIDIA NeMo Microservices platform and have it set up and running. If you're new to NeMo Microservices, please refer to the [NeMo Microservices Setup Guide](https://docs.nvidia.com/nemo/microservices/latest/index.html) first.
5757
5858
### 1. Python Environment
5959

@@ -276,10 +276,10 @@ For non-terminal positions without forced outcomes, the scorer uses these featur
276276

277277
## Installation
278278

279-
This example is meant to be run using a NeMo Agent Toolkit installation from source. You
279+
This example is meant to be run using a NeMo Agent Toolkit installation from source. You
280280
can follow the [NeMo Agent Toolkit Installation Guide](../../../docs/source/get-started/installation.md) to set up your environment.
281281

282-
Then:
282+
Then:
283283

284284
```bash
285285
uv pip install -e examples/finetuning/dpo_tic_tac_toe

examples/notebooks/observability_evaluation_and_profiling.ipynb

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,11 @@
572572
},
573573
"source": [
574574
"There are several optional subpackages available for `nvidia-nat`. For this example, we will rely on three subpackages:\n",
575+
"* The `eval` subpackage contains components for evaluation.\n",
575576
"* The `langchain` subpackage contains useful components for integrating and running within [LangChain](https://python.langchain.com/docs/introduction/).\n",
576577
"* The `llama-index` subpackage contains useful components for integrating and running within [LlamaIndex](https://developers.llamaindex.ai/python/framework/).\n",
577578
"* The `phoenix` subpackage contains components for integrating with [Phoenix](https://phoenix.arize.com/).\n",
578-
"* The `profiling` subpackage contains components common for profiling with NeMo Agent Toolkit."
579+
"* The `profiler` subpackage contains components common for profiling with NeMo Agent Toolkit."
579580
]
580581
},
581582
{
@@ -589,18 +590,20 @@
589590
"outputs": [],
590591
"source": [
591592
"%%bash\n",
593+
"uv pip show -q \"nvidia-nat-eval\"\n",
594+
"nat_eval_installed=$?\n",
592595
"uv pip show -q \"nvidia-nat-langchain\"\n",
593596
"nat_langchain_installed=$?\n",
594597
"uv pip show -q \"nvidia-nat-llama-index\"\n",
595598
"nat_llama_index_installed=$?\n",
596599
"uv pip show -q \"nvidia-nat-phoenix\"\n",
597600
"nat_phoenix_installed=$?\n",
598-
"uv pip show -q \"nvidia-nat-profiling\"\n",
599-
"nat_profiling_installed=$?\n",
600-
"if [[ ${nat_langchain_installed} -ne 0 || ${nat_llama_index_installed} -ne 0 || ${nat_phoenix_installed} -ne 0 || ${nat_profiling_installed} -ne 0 ]]; then\n",
601-
" uv pip install \"nvidia-nat[langchain,llama-index,phoenix,profiling]\"\n",
601+
"uv pip show -q \"nvidia-nat-profiler\"\n",
602+
"nat_profiler_installed=$?\n",
603+
"if [[ ${nat_eval_installed} -ne 0 || ${nat_langchain_installed} -ne 0 || ${nat_llama_index_installed} -ne 0 || ${nat_phoenix_installed} -ne 0 || ${nat_profiler_installed} -ne 0 ]]; then\n",
604+
" uv pip install \"nvidia-nat[eval,langchain,llama-index,phoenix,profiler]\"\n",
602605
"else\n",
603-
" echo \"nvidia-nat[langchain,llama-index,phoenix,profiling] is already installed\"\n",
606+
" echo \"nvidia-nat[eval,langchain,llama-index,phoenix,profiler] is already installed\"\n",
604607
"fi"
605608
]
606609
},
@@ -1101,10 +1104,9 @@
11011104
"llms:\n",
11021105
" nim_llm:\n",
11031106
" _type: nim\n",
1104-
" model_name: meta/llama-3.3-70b-instruct\n",
1107+
" model_name: nvidia/nemotron-3-nano-30b-a3b\n",
11051108
" temperature: 0.0\n",
1106-
" max_tokens: 2048\n",
1107-
" context_window: 32768\n",
1109+
" max_tokens: 16384\n",
11081110
" api_key: $NVIDIA_API_KEY\n",
11091111
"\n",
11101112
"embedders:\n",
@@ -1881,6 +1883,11 @@
18811883
}
18821884
],
18831885
"metadata": {
1886+
"kernelspec": {
1887+
"display_name": "Python 3",
1888+
"language": "python",
1889+
"name": "python3"
1890+
},
18841891
"language_info": {
18851892
"codemirror_mode": {
18861893
"name": "ipython",
@@ -1891,7 +1898,7 @@
18911898
"name": "python",
18921899
"nbconvert_exporter": "python",
18931900
"pygments_lexer": "ipython3",
1894-
"version": "3.12.9"
1901+
"version": "3.13.2"
18951902
}
18961903
},
18971904
"nbformat": 4,

examples/notebooks/optimize_model_selection.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@
176176
"%%bash\n",
177177
"uv pip show -q \"nvidia-nat-langchain\"\n",
178178
"nat_langchain_installed=$?\n",
179-
"uv pip show -q \"nvidia-nat-profiling\"\n",
180-
"nat_profiling_installed=$?\n",
181-
"if [[ ${nat_langchain_installed} -ne 0 || ${nat_profiling_installed} -ne 0 ]]; then\n",
182-
" uv pip install \"nvidia-nat[langchain,profiling]\"\n",
179+
"uv pip show -q \"nvidia-nat-profiler\"\n",
180+
"nat_profiler_installed=$?\n",
181+
"if [[ ${nat_langchain_installed} -ne 0 || ${nat_profiler_installed} -ne 0 ]]; then\n",
182+
" uv pip install \"nvidia-nat[langchain,profiler]\"\n",
183183
"else\n",
184-
" echo \"nvidia-nat[langchain,profiling] is already installed\"\n",
184+
" echo \"nvidia-nat[langchain,profiler] is already installed\"\n",
185185
"fi"
186186
]
187187
},

0 commit comments

Comments
 (0)