Skip to content

Commit 958105d

Browse files
committed
add quickstart for nemo fw
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
1 parent 4d524a2 commit 958105d

File tree

4 files changed

+74
-33
lines changed

4 files changed

+74
-33
lines changed

docs/get-started/_snippets/arc_challenge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
top_p=0,
4343
parallelism=1,
4444
extra={
45-
"tokenizer": "/checkpoints/llama-3_2-1b-instruct_v2.0/context/nemo_tokenizer",
45+
"tokenizer": "/checkpoint/context/nemo_tokenizer",
4646
"tokenizer_backend": "huggingface",
4747
},
4848
),
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#!/usr/bin/env python3
15+
16+
# [snippet-start]
17+
from nemo_evaluator.api import evaluate
18+
from nemo_evaluator.api.api_dataclasses import (
19+
ApiEndpoint,
20+
EvaluationConfig,
21+
EvaluationTarget,
22+
)
23+
24+
# Configure evaluation
25+
api_endpoint = ApiEndpoint(
26+
url="http://0.0.0.0:8080/v1/completions/",
27+
type="completions",
28+
model_id="megatron_model",
29+
)
30+
target = EvaluationTarget(api_endpoint=api_endpoint)
31+
config = EvaluationConfig(type="gsm8k", output_dir="results")
32+
33+
# Run evaluation
34+
results = evaluate(target_cfg=target, eval_cfg=config)
35+
print(results)
36+
# [snippet-end]

docs/get-started/quickstart/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ Unified CLI experience with automated container management, built-in orchestrati
4646
Programmatic control with full adapter features, custom configurations, and direct API access for integration into existing workflows.
4747
:::
4848

49+
:::{grid-item-card} {octicon}`gear;1.5em;sd-mr-1` NeMo Framework Container
50+
:link: gs-quickstart-nemo-fw
51+
:link-type: ref
52+
**For NeMo Framework Users**
53+
54+
End-to-end training and evaluation of large language models (LLMs).
55+
:::
56+
4957
:::{grid-item-card} {octicon}`container;1.5em;sd-mr-1` Container Direct
5058
:link: gs-quickstart-container
5159
:link-type: ref
@@ -272,5 +280,6 @@ nemo-evaluator-launcher run --config-dir packages/nemo-evaluator-launcher/exampl
272280
273281
NeMo Evaluator Launcher <launcher>
274282
NeMo Evaluator Core <core>
283+
NeMo Framework Container <nemo-fw>
275284
Container Direct <container>
276285
```

docs/get-started/quickstart/nemo-fw.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
orphan: true
3-
---
4-
51
(gs-quickstart-nemo-fw)=
62
# Evaluate checkpoints trained by NeMo Framework
73

@@ -13,51 +9,43 @@ The NeMo Evaluator is integrated within NeMo Framework, offering streamlined dep
139
## Prerequisites
1410

1511
- Docker with GPU support
16-
- NeMo Framework docker container
12+
- [NeMo Framework docker container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo/tags)
13+
- Your model checkpoint (or use [Llama 3.2 1B Instruct](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/llama-3_2-1b-instruct) for testing)
1714

1815
## Quick Start
1916

20-
### 1. Start NeMo Framework Container
21-
22-
For optimal performance and user experience, use the latest version of the [NeMo Framework container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo/tags). Please fetch the most recent `$TAG` and run the following command to start a container:
2317

2418
```bash
25-
docker run --rm -it -w /workdir -v $(pwd):/workdir \
19+
# 1. Start NeMo Framework Container
20+
21+
TAG=...
22+
CHECKPOINT_PATH=/path/to/checkpoint/lama-3_2-1b-instruct_v2.0" # use absolute path
23+
24+
docker run --rm -it -w /workdir -v $(pwd):/workdir -v $CHECKPOINT_PATH:/checkpoint/ \
2625
--entrypoint bash \
2726
--gpus all \
2827
nvcr.io/nvidia/nemo:${TAG}
2928
```
3029
31-
### 2. Deploy a Model
32-
3330
```bash
34-
# Deploy a NeMo checkpoint
31+
# Run inside the container:
32+
33+
# 2. Deploy a Model
3534
python \
3635
/opt/Export-Deploy/scripts/deploy/nlp/deploy_ray_inframework.py \
37-
--nemo_checkpoint "/path/to/your/checkpoint" \
36+
--nemo_checkpoint /checkpoint \
3837
--model_id megatron_model \
3938
--port 8080 \
4039
--host 0.0.0.0
41-
```
42-
43-
### 3. Evaluate the Model
44-
45-
```python
46-
from nemo_evaluator.api import evaluate
47-
from nemo_evaluator.api.api_dataclasses import ApiEndpoint, EvaluationConfig, EvaluationTarget
4840
49-
# Configure evaluation
50-
api_endpoint = ApiEndpoint(
51-
url="http://0.0.0.0:8080/v1/completions/",
52-
type="completions",
53-
model_id="megatron_model"
54-
)
55-
target = EvaluationTarget(api_endpoint=api_endpoint)
56-
config = EvaluationConfig(type="gsm8k", output_dir="results")
41+
# Start Python in a new terminal
42+
# 3. Launch evaluation:
43+
```
5744
58-
# Run evaluation
59-
results = evaluate(target_cfg=target, eval_cfg=config)
60-
print(results)
45+
```{literalinclude} ../_snippets/nemo_fw_basic.py
46+
:language: python
47+
:start-after: "# [snippet-start]"
48+
:end-before: "# [snippet-end]"
6149
```
6250

6351

@@ -86,7 +74,7 @@ Deploy multiple instances of your model:
8674
```shell
8775
python \
8876
/opt/Export-Deploy/scripts/deploy/nlp/deploy_ray_inframework.py \
89-
--nemo_checkpoint "meta-llama/Llama-3.1-8B" \
77+
--nemo_checkpoint /checkpoint \
9078
--model_id "megatron_model" \
9179
--port 8080 \ # Ray server port
9280
--num_gpus 4 \ # Total GPUs available
@@ -120,3 +108,11 @@ if __name__ == "__main__":
120108
)
121109
evaluate(target_cfg=eval_target, eval_cfg=eval_config)
122110
```
111+
112+
## Next Steps
113+
114+
- Explore {ref}`deployment-nemo-fw` for other deployment options
115+
- Integrate evaluation into your training pipeline
116+
- Run deployment and evaluation with NeMo Run
117+
- Configure adapters and interceptors for advanced evaluation scenarios
118+
- Explore {ref}`tutorials-overview`

0 commit comments

Comments
 (0)