mcpField
N
nemo-evaluator-sdk

nemo-evaluator-sdk

github.com/orchestra-researchテスト・品質14.1k951 回インストール19 週間前に更新
リポジトリ

nemo-evaluator-sdk について

NeMo Evaluator SDKは、再現性のあるLLM評価を必要とするチーム向けのベンチマークツールです。コンテナで複数のベンチマークを実行でき、ローカルのDocker、Slurm、Leptonクラウドに対応します。

主な機能

  1. 01複数のハーネスによるベンチマーク
  2. 02再現可能なコンテナ評価
  3. 03ローカル、Slurm、クラウドで実行
  4. 04評価結果のエクスポート
  5. 05CLIとPython API

活用シーン

  1. 01OpenAI互換エンドポイントでのモデル評価
  2. 02Slurmクラスターでの大規模評価
  3. 03複数モデルのベンチマーク比較
  4. 04安全性と視覚言語タスクの評価

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/orchestra-research/ai-research-skills --skill nemo-evaluator-sdk

インストール後、Claude Code で/nemo-evaluator-sdkを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
adapter-system.md
configuration.md
custom-benchmarks.md
execution-backends.md

詳細

NeMo Evaluator SDK - エンタープライズ向け LLM ベンチマーク

クイックスタート

NeMo Evaluator SDK は、18 以上のハーネスにまたがる 100 以上のベンチマークで LLM を評価します。コンテナ化された再現可能な評価を、マルチバックエンド実行(ローカル Docker、Slurm HPC、Lepton クラウド)で行います。

インストール:

pip install nemo-evaluator-launcher

API キーを設定して評価を実行:

export NGC_API_KEY=nvapi-your-key-here

# Create minimal config
cat > config.yaml << 'EOF'
defaults:
  - execution: local
  - deployment: none
  - _self_

execution:
  output_dir: ./results

target:
  api_endpoint:
    model_id: meta/llama-3.1-8b-instruct
    url: https://integrate.api.nvidia.com/v1/chat/completions
    api_key_name: NGC_API_KEY

evaluation:
  tasks:
    - name: ifeval
EOF

# Run evaluation
nemo-evaluator-launcher run --config-dir . --config-name config

利用可能なタスクを表示:

nemo-evaluator-launcher ls tasks

一般的なワークフロー

ワークフロー 1: 標準ベンチマークでモデルを評価

任意の OpenAI 互換エンドポイントで、主要な学術ベンチマーク(MMLU、GSM8K、IFEval)を実行します。

チェックリスト:

Standard Evaluation:
- [ ] Step 1: Configure API endpoint
- [ ] Step 2: Select benchmarks
- [ ] Step 3: Run evaluation
- [ ] Step 4: Check results

ステップ 1: API エンドポイントを設定

# config.yaml
defaults:
  - execution: local
  - deployment: none
  - _self_

execution:
  output_dir: ./results

target:
  api_endpoint:
    model_id: meta/llama-3.1-8b-instruct
    url: https://integrate.api.nvidia.com/v1/chat/completions
    api_key_name: NGC_API_KEY

セルフホスト可能なエンドポイント(vLLM、TRT-LLM)の場合:

target:
  api_endpoint:
    model_id: my-model
    url: http://localhost:8000/v1/chat/completions
    api_key_name: ""  # No key needed for local

ステップ 2: ベンチマークを選択

設定にタスクを追加します:

evaluation:
  tasks:
    - name: ifeval           # Instruction following
    - name: gpqa_diamond     # Graduate-level QA
      env_vars:
        HF_TOKEN: HF_TOKEN   # Some tasks need HF token
    - name: gsm8k_cot_instruct  # Math reasoning
    - name: humaneval        # Code generation

ステップ 3: 評価を実行

# Run with config file
nemo-evaluator-launcher run \
  --config-dir . \
  --config-name config

# Override output directory
nemo-evaluator-launcher run \
  --config-dir . \
  --config-name config \
  -o execution.output_dir=./my_results

# Limit samples for quick testing
nemo-evaluator-launcher run \
  --config-dir . \
  --config-name config \
  -o +evaluation.nemo_evaluator_config.config.params.limit_samples=10

ステップ 4: 結果を確認

# Check job status
nemo-evaluator-launcher status <invocation_id>

# List all runs
nemo-evaluator-launcher ls runs

# View results
cat results/<invocation_id>/<task>/artifacts/results.yml
ワークフロー 2: Slurm HPC クラスターで評価を実行

HPC インフラストラクチャで大規模な評価を実行します。

チェックリスト:

Slurm Evaluation:
- [ ] Step 1: Configure Slurm settings
- [ ] Step 2: Set up model deployment
- [ ] Step 3: Launch evaluation
- [ ] Step 4: Monitor job status

ステップ 1: Slurm の設定

# slurm_config.yaml
defaults:
  - execution: slurm
  - deployment: vllm
  - _self_

execution:
  hostname: cluster.example.com
  account: my_slurm_account
  partition: gpu
  output_dir: /shared/results
  walltime: "04:00:00"
  nodes: 1
  gpus_per_node: 8

ステップ 2: モデルデプロイメントをセットアップ

deployment:
  checkpoint_path: /shared/models/llama-3.1-8b
  tensor_parallel_size: 2
  data_parallel_size: 4
  max_model_len: 4096

target:
  api_endpoint:
    model_id: llama-3.1-8b
    # URL auto-generated by deployment

ステップ 3: 評価を起動

nemo-evaluator-launcher run \
  --config-dir . \
  --config-name slurm_config

ステップ 4: ジョブのステータスを監視

# Check status (queries sacct)
nemo-evaluator-launcher status <invocation_id>

# View detailed info
nemo-evaluator-launcher info <invocation_id>

# Kill if needed
nemo-evaluator-launcher kill <invocation_id>
ワークフロー 3: 複数のモデルを比較

同じタスクで複数のモデルをベンチマークし、比較します。

チェックリスト:

Model Comparison:
- [ ] Step 1: Create base config
- [ ] Step 2: Run evaluations with overrides
- [ ] Step 3: Export and compare results

ステップ 1: ベース設定を作成

# base_eval.yaml
defaults:
  - execution: local
  - deployment: none
  - _self_

execution:
  output_dir: ./comparison_results

evaluation:
  nemo_evaluator_config:
    config:
      params:
        temperature: 0.01
        parallelism: 4
  tasks:
    - name: mmlu_pro
    - name: gsm8k_cot_instruct
    - name: ifeval

ステップ 2: モデルの上書き設定で評価を実行

# Evaluate Llama 3.1 8B
nemo-evaluator-launcher run \
  --config-dir . \
  --config-name base_eval \
  -o target.api_endpoint.model_id=meta/llama-3.1-8b-instruct \
  -o target.api_endpoint.url=https://integrate.api.nvidia.com/v1/chat/completions

# Evaluate Mistral 7B
nemo-evaluator-launcher run \
  --config-dir . \
  --config-name base_eval \
  -o target.api_endpoint.model_id=mistralai/mistral-7b-instruct-v0.3 \
  -o target.api_endpoint.url=https://integrate.api.nvidia.com/v1/chat/completions

ステップ 3: エクスポートして比較

# Export to MLflow
nemo-evaluator-launcher export <invocation_id_1> --dest mlflow
nemo-evaluator-launcher export <invocation_id_2> --dest mlflow

# Export to local JSON
nemo-evaluator-launcher export <invocation_id> --dest local --format json

# Export to Weights & Biases
nemo-evaluator-launcher export <invocation_id> --dest wandb
ワークフロー 4: 安全性および Vision-Language の評価

安全性ベンチマークと VLM タスクでモデルを評価します。

チェックリスト:

Safety/VLM Evaluation:
- [ ] Step 1: Configure safety tasks
- [ ] Step 2: Set up VLM tasks (if applicable)
- [ ] Step 3: Run evaluation

ステップ 1: 安全性タスクを設定

evaluation:
  tasks:
    - name: aegis              # Safety harness
    - name: wildguard          # Safety classification
    - name: garak              # Security probing

ステップ 2: VLM タスクを設定

# For vision-language models
target:
  api_endpoint:
    type: vlm  # Vision-language endpoint
    model_id: nvidia/llama-3.2-90b-vision-instruct
    url: https://integrate.api.nvidia.com/v1/chat/completions

evaluation:
  tasks:
    - name: ocrbench           # OCR evaluation
    - name: chartqa            # Chart understanding
    - name: mmmu               # Multimodal understanding

使用すべき場面と代替手段

NeMo Evaluator を使用する場合:

  • 1 つのプラットフォームで 18 以上のハーネスからの 100 以上のベンチマーク が必要な場合
  • Slurm HPC クラスターまたはクラウドで評価を実行する場合
  • 再現可能なコンテナ化された評価が必要な場合
  • OpenAI 互換 API(vLLM、TRT-LLM、NIM)に対して評価する場合
  • 結果のエクスポート(MLflow、W&B)を備えた エンタープライズグレードの評価が必要な場合

代わりに次の代替手段を使用する場合:

  • lm-evaluation-harness: 迅速なローカル評価のための、より簡単なセットアップが必要な場合
  • bigcode-evaluation-harness: コードベンチマークのみに特化している場合
  • HELM: Stanford のより広範な評価(公平性、効率性)が必要な場合
  • カスタムスクリプト: 非常に特化したドメイン評価が必要な場合

対応ハーネスとタスク

ハーネスタスク数カテゴリ
lm-evaluation-harness60+MMLU、GSM8K、HellaSwag、ARC
simple-evals20+GPQA、MATH、AIME
bigcode-evaluation-harness25+HumanEval、MBPP、MultiPL-E
safety-harness3Aegis、WildGuard
garak1セキュリティプロービング
vlmevalkit6+OCRBench、ChartQA、MMMU
bfcl6Function calling v2/v3
mtbench2マルチターン会話
livecodebench10+ライブコーディング評価
helm15医療ドメイン
nemo-skills8数学、科学、エージェント

よくある問題

問題: コンテナの pull が失敗する

NGC の認証情報が設定されていることを確認してください:

docker login nvcr.io -u '$oauthtoken' -p $NGC_API_KEY

問題: タスクに環境変数が必要

一部のタスクでは HF_TOKEN や JUDGE_API_KEY が必要です:

evaluation:
  tasks:
    - name: gpqa_diamond
      env_vars:
        HF_TOKEN: HF_TOKEN  # Maps env var name to env var

問題: 評価がタイムアウトする

並列度を上げるか、サンプル数を減らしてください:

-o +evaluation.nemo_evaluator_config.config.params.parallelism=8
-o +evaluation.nemo_evaluator_config.config.params.limit_samples=100

問題: Slurm ジョブが開始されない

Slurm のアカウントとパーティションを確認してください:

execution:
  account: correct_account
  partition: gpu
  qos: normal  # May need specific QOS

問題: 想定と異なる結果になる

設定が報告されている設定と一致しているか確認してください:

evaluation:
  nemo_evaluator_config:
    config:
      params:
        temperature: 0.0  # Deterministic
        num_fewshot: 5    # Check paper's fewshot count

CLI リファレンス

コマンド説明
run設定を使用して評価を実行
status <id>ジョブのステータスを確認
info <id>ジョブの詳細情報を表示
ls tasks利用可能なベンチマークを一覧表示
ls runsすべての実行を一覧表示
export <id>結果をエクスポート(mlflow/wandb/local)
kill <id>実行中のジョブを終了

設定の上書き例

# Override model endpoint
-o target.api_endpoint.model_id=my-model
-o target.api_endpoint.url=http://localhost:8000/v1/chat/completions

# Add evaluation parameters
-o +evaluation.nemo_evaluator_config.config.params.temperature=0.5
-o +evaluation.nemo_evaluator_config.config.params.parallelism=8
-o +evaluation.nemo_evaluator_config.config.params.limit_samples=50

# Change execution settings
-o execution.output_dir=/custom/path
-o execution.mode=parallel

# Dynamically set tasks
-o 'evaluation.tasks=[{name: ifeval}, {name: gsm8k}]'

Python API の使用

CLI を使わずにプログラムから評価を行う場合:

from nemo_evaluator.core.evaluate import evaluate
from nemo_evaluator.api.api_dataclasses import (
    EvaluationConfig,
    EvaluationTarget,
    ApiEndpoint,
    EndpointType,
    ConfigParams
)

# Configure evaluation
eval_config = EvaluationConfig(
    type="mmlu_pro",
    output_dir="./results",
    params=ConfigParams(
        limit_samples=10,
        temperature=0.0,
        max_new_tokens=1024,
        parallelism=4
    )
)

# Configure target endpoint
target_config = EvaluationTarget(
    api_endpoint=ApiEndpoint(
        model_id="meta/llama-3.1-8b-instruct",
        url="https://integrate.api.nvidia.com/v1/chat/completions",
        type=EndpointType.CHAT,
        api_key="nvapi-your-key-here"
    )
)

# Run evaluation
result = evaluate(eval_cfg=eval_config, target_cfg=target_config)

応用トピック

マルチバックエンド実行: references/execution-backends.md を参照してください 設定の詳細解説: references/configuration.md を参照してください アダプターとインターセプターのシステム: references/adapter-system.md を参照してください カスタムベンチマークの統合: references/custom-benchmarks.md を参照してください

要件

  • Python: 3.10〜3.13
  • Docker: ローカル実行に必要
  • NGC API キー: コンテナのプルおよび NVIDIA Build の利用に必要
  • HF_TOKEN: 一部のベンチマーク(GPQA、MMLU)で必要

リソース

コメント