NeMo Evaluator: Deployment Patterns
NeMo Evaluator: Deployment Patterns
Architecture
Pattern 1: Direct Evaluation (Local Environment)
Who: Research / training owner running benchmarks against a model endpoint.
What: Evaluator owns the full loop. Seeds problems from a local EvalEnvironment, calls the model, verifies, produces all artifacts.
Multi-benchmark configs support --resume for checkpoint-based recovery:
Artifacts produced: All. Full trajectory with request/response bindings, token counts, latency breakdown per phase, scoring details, failure categorization.
Environments: Any registered EvalEnvironment subclass — GSM8K, TriviaQA, or any BYOB benchmark.
Pattern 2: Serve for Gym Training
Who: Environment developer making an Evaluator benchmark available to Gym’s RL pipeline.
What: An EvalEnvironment is exposed as an HTTP service speaking Gym’s /seed_session + /verify protocol. Gym agents consume it during training. Evaluator independently evaluates the same benchmark with full observability.
Dual-consumer: Same service, two readers. Gym reads reward. Evaluator reads everything.
Pattern 3: Consume Remote Environment via Adapter
Who: Evaluation owner who wants Evaluator’s statistical rigor on an environment running elsewhere.
What: GymEnvironment connects to any server speaking seed_session/verify. Evaluator owns the model call in between, giving full trajectory capture even though the environment is remote.
Key: Evaluator owns the model call → full trajectory, tokens, latency regardless of where the environment runs.
Pattern 4: VLMEvalKit Benchmarks
Who: Research team evaluating vision-language models against VLMEvalKit’s 100+ benchmarks with Evaluator’s full observability.
What: VLMEvalKitEnvironment wraps VLMEvalKit datasets, handling image loading and scoring (MCQ, VQA, Y/N). The VLMSolver sends images + text to the model.
Pattern 5: Serve for ng_collect_rollouts
Who: Training team that needs batch rollout collection using Gym’s infrastructure.
What: nel serve exposes any EvalEnvironment as a Gym-compatible HTTP server. Gym agents and ng_collect_rollouts consume it via standard /seed_session + /verify endpoints.
JSONL row format (matches ng_collect_rollouts input spec):
Pattern 6: Regression Comparison
Who: CI pipeline or evaluation owner comparing model versions.
What: Two run bundles → score deltas with CI overlap check, Mann-Whitney U p-values, per-category deltas, runtime deltas.
Output:
Artifact Summary
Every evaluation run (all patterns) produces:
Environment Compatibility Matrix
BYOB: Writing a New Benchmark
Then:
Pattern 7: Distributed Evaluation on SLURM
User story: “I need to evaluate a 14k-problem benchmark with n=8 repeats. Running serially would take days. I want to shard across 16 SLURM nodes and merge results.”
Architecture
Config-Driven SLURM
SLURM evaluations are driven by a YAML config with a cluster: { type: slurm } block:
Shard merging is handled automatically when all array tasks complete.
How Sharding Works
Each SLURM array task gets SLURM_ARRAY_TASK_ID and SLURM_ARRAY_TASK_COUNT set automatically. nel eval run detects these (or NEL_SHARD_IDX/NEL_TOTAL_SHARDS) and computes its problem range:
Each shard writes its own artifacts to shard_N/. The merge job combines all results, recomputes global metrics (pass@k, CI), and aggregates runtime stats.
Serve on SLURM
For long-running Gym training, serve an environment as a SLURM service:
Environment Variables
Pattern 8: Docker / Docker Compose
User story: “I want to run evaluations in containers for reproducibility, or spin up a serve+eval stack locally.”
Files: Dockerfile, deploy/docker-compose.yaml
Pattern 9: Kubernetes
User story: “I need to run evaluations on our K8s cluster, with sharded jobs for large benchmarks and a persistent serve endpoint for Gym training.”
Single Evaluation Job
Sharded (Indexed Job)
Uses K8s completionMode: Indexed — each pod gets JOB_COMPLETION_INDEX mapped to NEL_SHARD_IDX.
Serve as K8s Service
Includes readiness/liveness probes on /health, ClusterIP service for internal discovery.
Files: deploy/k8s/eval-job.yaml, deploy/k8s/eval-indexed-job.yaml, deploy/k8s/serve-deployment.yaml
Pattern 10: Ray (Distributed)
User story: “Our Gym training already runs on Ray. I want to run distributed evaluation on the same Ray cluster.”
Each run_shard is a Ray remote task that runs run_evaluation() with a computed problem_range. Results are merged locally after all tasks complete. Works on existing Ray clusters used by Gym training.
File: src/nemo_evaluator/engine/ray_launcher.py
Pattern 11: GitLab CI Regression Gate
User story: “I want every MR to automatically evaluate the candidate model against the baseline and block merge if scores regress.”
Pipeline stages:
- eval:baseline — checks out target branch, runs eval
- eval:candidate — runs eval on MR branch
- regression:check — compares bundles, fails if any metric drops >5%
Produces regression.json artifact with per-metric deltas, CI overlap, and category breakdowns.
File: deploy/gitlab-ci-eval.yml
Deployment Matrix
All targets use the same nel eval run / nel serve commands, same sharding env vars (NEL_SHARD_IDX, NEL_TOTAL_SHARDS), and same artifact format. The only difference is the orchestration layer.