support ifbench for LLMs. - #2542
Open
lkk12014402 wants to merge 2 commits into
Open
Conversation
Signed-off-by: lkk12014402 <kaokao.lv@intel.com>
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a self-contained IFBench reproduction workflow under benchmark/ifbench/ to evaluate instruction-following for LLMs against an OpenAI-compatible endpoint, using Nemotron 3 Ultra-aligned generation/scoring settings.
Changes:
- Introduces a one-shot driver script (
run_ifbench.sh) that clones upstream IFBench, overlays local config + evaluation logic, sets up a venv, and runs evaluation. - Adds an end-to-end generator+scorer (
evaluate_model.py) that supports consensus repeats and writes per-repeat + aggregated results. - Provides Nemotron-aligned defaults via
configs/config.py(pydantic-settings) andconfigs/env.template, plus usage documentation inREADME.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| benchmark/ifbench/run_ifbench.sh | Driver to clone IFBench, set up environment, apply config overlays, and run the evaluation. |
| benchmark/ifbench/README.md | Documentation for running IFBench reproduction and explaining parameters/results. |
| benchmark/ifbench/evaluate_model.py | End-to-end generation + scoring against an OpenAI-compatible /chat/completions endpoint. |
| benchmark/ifbench/configs/env.template | Template .env with Nemotron-aligned defaults for endpoint + generation settings. |
| benchmark/ifbench/configs/config.py | Pydantic-settings loader for .env configuration used by evaluate_model.py. |
Comment on lines
+143
to
+146
| prompt_to_response = {inp.prompt: responses[inp.key] for inp in inputs} | ||
| strict = [evaluation_lib.test_instruction_following_strict(i, prompt_to_response) for i in inputs] | ||
| loose = [evaluation_lib.test_instruction_following_loose(i, prompt_to_response) for i in inputs] | ||
| return strict, loose |
Comment on lines
+86
to
+90
| except Exception as e: | ||
| last_exc = e | ||
| if attempt < max_retries: | ||
| time.sleep(min(2**attempt, 30)) | ||
| continue |
Comment on lines
+198
to
+217
| parser.add_argument("--no-thinking", dest="enable_thinking", action="store_false", help="Disable thinking mode") | ||
| parser.add_argument("--seed", type=int, default=settings.seed, help="Base seed; repeat i uses seed+i") | ||
| parser.add_argument("--workers", type=int, default=settings.workers) | ||
| parser.add_argument( | ||
| "--request-timeout", | ||
| type=float, | ||
| default=settings.request_timeout, | ||
| help="Per-request timeout in seconds (Nemotron: 3600)", | ||
| ) | ||
| parser.add_argument( | ||
| "--max-retries", | ||
| type=int, | ||
| default=settings.max_retries, | ||
| help="Retries per request on timeout/error (Nemotron: 10)", | ||
| ) | ||
| parser.add_argument( | ||
| "--num-repeats", type=int, default=settings.num_repeats, help="Consensus repeats (Nemotron uses 8)" | ||
| ) | ||
| parser.add_argument("--limit", type=int, default=None, help="Only evaluate the first N prompts (smoke test)") | ||
| parser.add_argument("--save-responses", action="store_true", help="Also dump generated responses per repeat") |
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.
Description
IFBench evaluation