Skip to content

Commit 9915165

Browse files
marta-sdprokotg
andauthored
fix(local executor): use extra_docker_args instead of hard-coded --network=host (#286)
Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com> Signed-off-by: Marta Stepniewska-Dziubinska <marta-sd@users.noreply.github.com> Co-authored-by: prokotg <19536019+prokotg@users.noreply.github.com>
1 parent f1795e7 commit 9915165

File tree

6 files changed

+78
-7
lines changed

6 files changed

+78
-7
lines changed

docs/nemo-evaluator-launcher/configuration/execution/local.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ See the complete configuration structure in the [Local Config File](../../../../
99
## Key Settings
1010

1111
- **`output_dir`**: Directory where evaluation results will be saved (required)
12+
- **`extra_docker_args`**: Additional arguments to pass to the `docker run` command (optional). This flag allows advanced users to customize their setup (see [Advanced configuration](#advanced-configuration)).
1213

1314
Tips:
1415
- ensure Docker is running on your local machine
@@ -20,6 +21,21 @@ Examples:
2021
- [Auto Export Example](https://github.com/NVIDIA-NeMo/Evaluator/tree/main/packages/nemo-evaluator-launcher/examples/local_auto_export_llama_3_1_8b_instruct.yaml) - Local execution with automatic result export
2122
- [Limit Samples Example](https://github.com/NVIDIA-NeMo/Evaluator/tree/main/packages/nemo-evaluator-launcher/examples/local_limit_samples.yaml) - Local execution with limited samples
2223

24+
## Advanced configuration
25+
26+
You can customize your local executor by specifying `extra_docker_args`.
27+
This parameter allows you to pass any flag to the `docker run` command that is executed by the NeMo Evaluator Launcher.
28+
You can use it to mount additional volumes, set environment variables or customize your network settings.
29+
30+
For example, if you would like your job to use a specific docker network, you can specify:
31+
32+
```yaml
33+
execution:
34+
extra_docker_args: "--network my-custom-network"
35+
```
36+
37+
Replace `my-custom-network` with `host` to access the host network.
38+
2339
## Reference
2440

2541
- [Local Config File](../../../../packages/nemo-evaluator-launcher/src/nemo_evaluator_launcher/configs/execution/local.yaml)

docs/nemo-evaluator-launcher/tutorial.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ docker run --gpus all -p 8000:8000 vllm/vllm-openai:latest \
4949
--model meta-llama/Llama-3.1-8B-Instruct
5050
```
5151

52+
/// tip | Docker network settings
53+
When working with a locally-hosted endpoint and the local executor, make sure to configure your docker network settings via `extra_docker_args` parameter (see [Advanced configuration](../nemo-evaluator-launcher/configuration/execution/local.md#advanced-configuration) and [Deployment Frameworks Guide](tutorials/deployments/deployment-frameworks-guide.md))
54+
55+
5256
For more information, see:
5357

5458
For detailed deployment instructions, see the [Deployment Frameworks Guide](tutorials/deployments/deployment-frameworks-guide.md).

docs/nemo-evaluator-launcher/tutorials/deployments/deployment-frameworks-guide.md

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Models deployed with the frameworks listed below should work with nemo_evaluator
1818

1919
## Quick Setup Options
2020

21-
# vLLM
21+
### vLLM
2222

2323
vLLM is a fast and easy-to-use library for LLM inference and serving..
2424

@@ -32,15 +32,15 @@ docker run --gpus all -p 8000:8000 vllm/vllm-openai:latest \
3232
- [vLLM Documentation](https://docs.vllm.ai/en/latest/)
3333
- [vLLM Docker Deployment](https://docs.vllm.ai/en/stable/deployment/docker.html)
3434

35-
# SGLang
35+
### SGLang
3636

3737
SGLang is a fast serving framework for large language models and vision language models. It makes your interaction with models faster and more controllable by co-designing the backend runtime and frontend language. The core features include:
3838

3939
**Documentation:**
4040
- [SGLang Documentation](https://docs.sglang.ai/)
4141
- [SGLang Docker Deployment](https://github.com/sgl-project/sglang/tree/main/benchmark/deepseek_v3#using-docker-recommended)
4242

43-
# NeMo
43+
### NeMo
4444

4545
NeMo Framework is NVIDIA's GPU accelerated, end-to-end training framework for large language models (LLMs), multi-modal models and speech models. The Export-Deploy library ("NeMo Export-Deploy") provides tools and APIs for exporting and deploying NeMo and 🤗Hugging Face models to production environments. It supports various deployment paths including TensorRT, TensorRT-LLM, and vLLM deployment through NVIDIA Triton Inference Server.
4646

@@ -49,15 +49,15 @@ NeMo Framework is NVIDIA's GPU accelerated, end-to-end training framework for la
4949
- [NeMo Export-Deploy](https://github.com/NVIDIA-NeMo/Export-Deploy)
5050
- [NeMo Export-Deploy Scripts](https://github.com/NVIDIA-NeMo/Export-Deploy/tree/main/scripts)
5151

52-
# TRT-LLM
52+
### TRT-LLM
5353

5454
TRT-LLM provides optimized inference with OpenAI-compatible server through the `trtllm-serve` command.
5555

5656
**Documentation:**
5757
- [TensorRT-LLM Documentation](https://docs.nvidia.com/tensorrt-llm/index.html)
5858
- [TRT-LLM Server](https://nvidia.github.io/TensorRT-LLM/commands/trtllm-serve.html)
5959

60-
# NIM (NVIDIA Inference Microservices)
60+
### NIM (NVIDIA Inference Microservices)
6161

6262
NIM provides optimized inference microservices with OpenAI-compatible APIs.
6363

@@ -68,4 +68,50 @@ NIM provides optimized inference microservices with OpenAI-compatible APIs.
6868

6969
**Next Steps:**
7070
- [Local Evaluation of Existing Endpoint](../local-evaluation-of-existing-endpoint.md) - Learn how to run evaluations
71-
- [Testing Endpoint Compatibility](testing-endpoint-oai-compatibility.md) - Test your deployed endpoint with curl requests
71+
- [Testing Endpoint Compatibility](testing-endpoint-oai-compatibility.md) - Test your deployed endpoint with curl requests
72+
73+
74+
## Advance settings
75+
76+
If you are deploying the model locally with Docker, you can use a dedicated docker network.
77+
This will provide a secure connetion between deployment and evaluation docker containers.
78+
79+
```shell
80+
docker network create my-custom-network
81+
82+
docker run --gpus all --network my-custom-network --name my-phi-container vllm/vllm-openai:latest \
83+
--model microsoft/Phi-4-mini-instruct
84+
```
85+
86+
Then use the same network in the evaluator config:
87+
88+
```yaml
89+
defaults:
90+
- execution: local
91+
- deployment: none
92+
- _self_
93+
94+
execution:
95+
output_dir: my_phi_test
96+
extra_docker_args: "--network my-custom-network"
97+
98+
target:
99+
api_endpoint:
100+
model_id: microsoft/Phi-4-mini-instruct
101+
url: http://my-phi-container:8000/v1/chat/completions
102+
api_key_name: null
103+
104+
evaluation:
105+
tasks:
106+
- name: simple_evals.mmlu_pro
107+
overrides:
108+
config.params.limit_samples: 10 # TEST ONLY: Limits to 10 samples for quick testing
109+
config.params.parallelism: 1
110+
```
111+
112+
Alternatively you can expose ports as shown in the examples above and use the host network:
113+
114+
```yaml
115+
execution:
116+
extra_docker_args: "--network host"
117+
```

packages/nemo-evaluator-launcher/src/nemo_evaluator_launcher/configs/execution/local.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
#
1616
type: local
1717
output_dir: ???
18+
extra_docker_args: ""

packages/nemo-evaluator-launcher/src/nemo_evaluator_launcher/executors/local/executor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,13 @@ def execute_eval(cls, cfg: DictConfig, dry_run: bool = False) -> str:
164164
auto_export_config = cfg.execution.get("auto_export", {})
165165
auto_export_destinations = auto_export_config.get("destinations", [])
166166

167+
extra_docker_args = cfg.execution.get("extra_docker_args", "")
168+
167169
run_sh_content = (
168170
eval_template.render(
169171
evaluation_tasks=[evaluation_task],
170172
auto_export_destinations=auto_export_destinations,
173+
extra_docker_args=extra_docker_args,
171174
).rstrip("\n")
172175
+ "\n"
173176
)
@@ -178,6 +181,7 @@ def execute_eval(cls, cfg: DictConfig, dry_run: bool = False) -> str:
178181
eval_template.render(
179182
evaluation_tasks=evaluation_tasks,
180183
auto_export_destinations=auto_export_destinations,
184+
extra_docker_args=extra_docker_args,
181185
).rstrip("\n")
182186
+ "\n"
183187
)

packages/nemo-evaluator-launcher/src/nemo_evaluator_launcher/executors/local/run.template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ echo "$(date -u +%Y-%m-%dT%H:%M:%SZ)" > "$logs_dir/stage.pre-start"
3434
# Docker run with eval factory command
3535
(
3636
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ)" > "$logs_dir/stage.running"
37-
docker run --rm --shm-size=100g --network=host \
37+
docker run --rm --shm-size=100g {{ extra_docker_args }} \
3838
--name {{ task.container_name }} \
3939
--volume "$artifacts_dir":/results \
4040
{% for env_var in task.env_vars -%}

0 commit comments

Comments
 (0)