feat(inference): lm-eval-harness based accuracy evaluation + vllm suite integration - #268
feat(inference): lm-eval-harness based accuracy evaluation + vllm suite integration #268atnair-amd wants to merge 9 commits into
Conversation
…harness First unit of the lm-eval-harness accuracy evaluation system: the config.json-side task selection schema, split from threshold/gating values which will be joined in at runtime by a later unit.
Second unit of the accuracy harness: pure JSON -> {scalar: float}
projector for lm-eval-harness results.json payloads. Walks every
numeric metric with no per-task registry, so group tasks (e.g.
RULER's per-seq-length metrics) fall out of the same walk.
…tom suites Adds the accuracy field to both suites' VariantConfig classes (defaulting to an empty AccuracyConfig so existing configs load unchanged), imports the shared test_accuracy_eval lifecycle stage into each suite's test module, and places it in collection order right after the perf-metric stage.
- exclude the top-level "accuracy" threshold key from sweep-cell coverage checks (was tripping the extra-key/typo detector); delegate vllm_config_loader's inline check to the shared validator - gate accuracy threshold evaluation on enforce_thresholds, matching test_metric's existing record-only convention - route chat-template tasks to /v1/chat/completions instead of always using /v1/completions - wrap exec_on_head tuple-unpack and JSON parse failures in run_accuracy_tasks as RuntimeError instead of letting raw ValueError/JSONDecodeError propagate - select the newest results*.json by mtime instead of an arbitrary find ordering, guarding against stale results from a prior run
…e tasks build_lm_eval_cmd switched the model backend/endpoint to local-chat-completions for tasks with apply_chat_template=True but never passed lm-eval's own --apply_chat_template flag, so lm-eval sent plain-string prompts and the chat-completions client asserted on every request. Verified on a live 2N DeepSeek-R1 accuracy run where this aborted mmlu_pro and blocked all subsequent tasks in the same test_accuracy_eval invocation.
788cf53 to
fccabeb
Compare
Scope this feature to vllm only until it's been validated against ATOM hardware. Removes the accuracy field from InferenceXAtomVariantConfig, the test_accuracy_eval import/collection-order entry in the ATOM suite, and the corresponding ATOM-specific unit tests. The shared lm_eval_job.py/lm_eval_parsing.py/accuracy_config.py machinery and test_accuracy_eval itself are untouched -- vllm's wiring is unaffected.
Each accuracy task now gets its own pytest node (test_accuracy_eval[<id>]) instead of one collapsed row covering every configured task, matching the test_metric/test_gpu_metric per-metric row convention. Task nodes are gated independently: a run failure or threshold violation in one task no longer sets the shared lifecycle.failed flag, so sibling tasks still execute rather than being skipped by a prior task's outcome. pytest_generate_tests parametrizes accuracy_task from config.json's accuracy.tasks, including the empty-list case (auto-skips a single node, same UX as before).
Review (head
|
Jira: AIMVT-269
Summary
Adds an lm-eval-harness based accuracy evaluation capability, opt-in per suite via config.json.
accuracy_config.py):AccuracyTask/AccuracyConfig(pydantic,extra=forbid) hold task selection only — id/task/num_fewshot/metadata/include_path/num_concurrent/apply_chat_template/gen_kwargs. Rejects duplicate task ids.lm_eval_parsing.py):project()auto-discovers real numeric metrics from an lm-evalresults.jsonpayload and flattens them into a single dict, keyedtask.metric__filter.lm_eval_job.py): builds thelm_evalCLI invocation (local-completions vs local-chat-completions, model_args, gen_kwargs, metadata) and runs it viaorch.exec_on_headagainst an already-live inference server, then locates and parses the resultingresults*.json.inference_suite_lifecycle.py::test_accuracy_eval): shared, opt-in pytest stage — skips cleanly if a prior stage failed or no accuracy tasks are configured, records per-task results vialifecycle.record, and gates each task independently againstthreshold.json'saccuracy.<task_id>block whenenforce_thresholdsis set (record-only otherwise).accuracy: AccuracyConfigfield added to bothVariantConfig(vllm) andInferenceXAtomVariantConfig(inferencex_atom), defaulting to empty so existing configs are unaffected.test_accuracy_evalimported into both suites' test modules and inserted into collection order right after the perf-metric stage.Not included in this PR: the
long_isl_osl_stresscustom lm-eval task (its gibberish/repetition scoring logic needs its own design pass — deferred).Test plan
./.cvs_venv/bin/python -m pytest cvs/lib/inference/unittests/ --cluster_file /dev/null --config_file /dev/null— 249 passed (2 pre-existing, unrelated failures intest_inferencing_config_loader.pypersist with or without this branch)test_accuracy_evalinserted