feat(benchmark): add reproducible NeMo Gym routing comparison - #595
Draft
afourniernv wants to merge 1 commit into
Draft
feat(benchmark): add reproducible NeMo Gym routing comparison#595afourniernv wants to merge 1 commit into
afourniernv wants to merge 1 commit into
Conversation
Signed-off-by: Alex Fournier <afournier@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
benchmark/nemo_gym/, a version-pinned workflow for comparing two Switchyard routing conditions on the same NeMo Gym MMLU-Redux tasks:strong-onlyalways uses the strong target.policy-modeluses an LLM classifier to select the efficient or strong target.The runner builds the current checkout's
switchyard-server, gives each condition a fresh proxy and output directory, and captures Gym rollouts alongside Switchyard statistics and metrics. The comparator pairs matching task/repeat rows before reporting reward, answer and classifier tokens, latency, model totals, and classifier fail-opens.This adds no production dependency, API, or request-path change.
Why
Gym already provides the
switchyard_modeladapter, but Switchyard did not have an executable repository example for using it to compare a routed strategy with a fixed-model baseline. This makes that workflow reproducible from a Switchyard checkout and keeps failed or mismatched rollouts visible in the comparison.Closes #559
Linear: SYGH-96
Builds on NVIDIA-NeMo/Gym#2141, which added Gym's Switchyard model-server adapter.
Notes for reviewers
Start with
benchmark/nemo_gym/README.mdfor the workflow, thenrun.shfor process and artifact ownership, andcompare.pyfor pairing and accounting semantics.The example uses attached mode so it exercises the current Switchyard checkout rather than Gym's pinned released wheel. It starts a fresh proxy per condition because router state and
/v1/statsare process-wide, and it snapshots statistics before shutdown because Gym's attached-mode snapshot is best-effort.Validation:
env -u OPENROUTER_API_KEY -u NVIDIA_API_KEY -u OPENAI_API_KEY -u ANTHROPIC_API_KEY uv run pytest tests/ -q -m "not integration"— 121 passed, 2 deselected, 2 subtests passeduv run ruff check .uv run mypy switchyardbash -n benchmark/nemo_gym/run.shgit diff --checkcargo run --release -p switchyard-server -- --config benchmark/nemo_gym/routes.toml --dry-runThe limited live run validates the integration and accounting only; it is not presented as a model-quality benchmark.