Commit 48909b6
Add vision genai inference path for multi-file VLM evaluation (microsoft#2488)
## Describe your changes
Adds `_inference_vision_genai` method to `OnnxEvaluator` that enables
`olive run` to evaluate multi-file ONNX vision-language models (e.g.,
Qwen3-VL) using `onnxruntime-genai`.
### Problem
Vision-language models exported via `onnxruntime-genai` produce multiple
ONNX files (`vision.onnx`, `text.onnx`, `embedding.onnx`) with a
`genai_config.json`. The existing `_inference_vision` method only
supports single-file ONNX models with classification-style forward pass.
This prevented using `olive run --config` for evaluation of
autoregressive VLMs.
### Solution
- Auto-detect genai vision models by checking if `genai_config.json`
contains a `vision` field
- Route to new `_inference_vision_genai` method which uses `og.Model`,
`multimodal_processor`, and `og.Generator` for autoregressive text
generation
- Follows the same pattern as the existing speech genai inference
(`_inference_text_genai` for Whisper, `_inference_text_genai_streaming`
for Nemotron)
- Falls back to existing `_inference_vision` for single-file ONNX VQA
models
### Usage
```json
{
"input_model": {
"type": "OnnxModel",
"model_path": "path/to/models",
"onnx_file_name": "text.onnx"
}
}
```
The evaluator will auto-detect `genai_config.json` in the model
directory and use the genai path.
### Related
- Depends on: microsoft#2476 (vision metrics: exact_match, relaxed_accuracy,
word_sort_ratio)
- Tested with: Qwen3-VL-2B-Instruct on AI2D benchmark in olive-recipes
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8c5b096 commit 48909b6
4 files changed
Lines changed: 359 additions & 19 deletions
File tree
- olive
- data
- component
- evaluator
- test/evaluator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| 390 | + | |
| 391 | + | |
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
| |||
408 | 410 | | |
409 | 411 | | |
410 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
| |||
438 | 444 | | |
439 | 445 | | |
440 | 446 | | |
441 | | - | |
| 447 | + | |
442 | 448 | | |
443 | 449 | | |
444 | 450 | | |
445 | 451 | | |
| 452 | + | |
| 453 | + | |
446 | 454 | | |
447 | 455 | | |
448 | 456 | | |
| |||
452 | 460 | | |
453 | 461 | | |
454 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
455 | 473 | | |
456 | 474 | | |
457 | 475 | | |
458 | 476 | | |
459 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
460 | 484 | | |
461 | 485 | | |
462 | 486 | | |
| |||
472 | 496 | | |
473 | 497 | | |
474 | 498 | | |
475 | | - | |
| 499 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
585 | 599 | | |
586 | 600 | | |
587 | 601 | | |
| |||
593 | 607 | | |
594 | 608 | | |
595 | 609 | | |
596 | | - | |
597 | | - | |
598 | | - | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
599 | 620 | | |
600 | 621 | | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
608 | 625 | | |
609 | 626 | | |
610 | 627 | | |
| |||
795 | 812 | | |
796 | 813 | | |
797 | 814 | | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
798 | 951 | | |
799 | 952 | | |
800 | 953 | | |
| |||
0 commit comments