You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Benchmark CLI follow-ups: clarify --backend help and include evaluator config in eval cache key (microsoft#2552)
## Describe your changes
Follow-ups to microsoft#2420 addressing the remaining (non-blocking) review
comments.
**`olive benchmark` `--backend` help text** — Reworded to clarify it
applies to lm-eval evaluation (not just "ONNX model evaluation"):
`ort`/`ortgenai` require ONNX input, `ortgenai` additionally requires
GenAI-packaged model assets (e.g. `genai_config.json`), and `auto`
infers the backend from the model type.
**Evaluation cache key now includes the evaluator config** —
`Engine._evaluate_model` previously keyed the evaluation cache on
`model_id` + accelerator only, so re-running the same model with a
different `--backend` (i.e. `model_class`), or different lm-eval
`tasks`/`limit`/`batch_size`/metrics, would silently reuse a stale
cached result. The key now folds in
`hash_dict(evaluator_config.to_json())`, so any change to the evaluation
parameters produces a distinct cache entry. The key is internal to
`_evaluate_model` (only `_load_evaluation`/`_cache_evaluation` consume
it); footprints still record the raw `model_id`.
**Tests** — Added `model_class`-absent backward-compat assertions to
`test_benchmark_command_hfmodel`/`test_benchmark_command_onnxmodel`, and
a new `test_evaluate_model_cache_key_includes_evaluator_config` engine
test (same config → cache hit; different config → cache miss).
## Checklist before requesting a review
- [x] Add unit tests for this change.
- [x] Make sure all tests can pass.
- [ ] Update documents if necessary.
- [x] Lint and apply fixes to your code by running `lintrunner -a`
- [x] Is this a user-facing change? If yes, give a description of this
change to be included in the release notes.
- `olive benchmark` no longer reuses a cached evaluation result when
re-running the same model with a different `--backend` or different
lm-eval parameters; the `--backend` help text was also clarified.
## (Optional) Issue link
Follow-up to microsoft#2420.
Co-authored-by: Gopalakrishnan Nallasamy <gopalakrishnan.nallasamy@microsoft.com>
0 commit comments