Repository navigation
feat(aiperf-qual): qualify images_text_to_text instruction VLMs on OCRBench #2639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cd5aad0
4db3957
aa20663
7ccabd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # The Idefics3 runtime decodes greedily and declares only max_new_tokens and do_sample: OCRBench's sampling fields | ||
| # (already greedy: temperature 0, top_k 1) and enable_thinking are removed (a null removes the suite's field). | ||
| absolute: [{name: ocrbench, request: {enable_thinking: null, temperature: null, top_k: null, top_p: null}}] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| reference: | ||
| requirements: families/smolvlm/requirements.txt # the SmolVLM2 processor needs num2words |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| reference: | ||
| requirements: families/smolvlm/requirements.txt # the SmolVLM2 processor needs num2words |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ | |
| "testcases": [ | ||
| { | ||
| "name": "gemma-3n-e4b-bf16", | ||
| "test_image": "data/test_img.jpeg", | ||
| "prompt": "Describe this image in one sentence.", | ||
|
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consume each new manifest key in its family's The architecture test allows a testcase key only when that family's
Each listed key causes a violation in
|
||
| "premerge": true, | ||
| "reference_precision": "fp32", | ||
| "reference_backend": "hf_transformers", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,12 +94,12 @@ def _native_build_dir() -> Path: | |
| return native | ||
|
|
||
|
|
||
| def _images(directory: Path): | ||
| """The test photographs as decoded RGB arrays, raw files and lossless PNGs.""" | ||
| def _images(directory: Path, photo: str): | ||
| """The case's photograph and the car photograph as decoded RGB arrays, raw files and lossless PNGs.""" | ||
| from PIL import Image | ||
|
|
||
| result = {} | ||
| for name in ("test_img.jpeg", "test_img_car.jpeg"): | ||
| for name in (Path(photo).name, "test_img_car.jpeg"): | ||
| image = Image.open(ROOT / "data" / name).convert("RGB") | ||
| pixels = np.asarray(image) | ||
| raw, png = directory / f"{name}.rgb", directory / f"{name}.png" | ||
|
|
@@ -113,7 +113,7 @@ def _images(directory: Path): | |
|
|
||
| def _conversations(images, max_new_tokens): | ||
| """(name, messages) with image parts as {"image": name} placeholders.""" | ||
| first, second = "test_img.jpeg", "test_img_car.jpeg" | ||
| first, second = images | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the case prompt in a conversation. The conversations use fixed
|
||
| return [ | ||
| ("describe", [{"role": "user", "parts": [{"image": first}, {"text": PROMPTS["describe"]}]}]), | ||
| ("system", [{"role": "system", "parts": [{"text": "You answer as briefly as possible."}]}, | ||
|
|
@@ -309,9 +309,9 @@ def test_e2e(case_name, request, tmp_path): | |
| # The end-of-sequence ids the builder writes into the bundle. | ||
| stop_ids = validate_processing(checkpoint, ModelConfig.from_dir(checkpoint))["eos_token_ids"] | ||
| max_new_tokens = int(case["max_new_tokens"]) | ||
| images = _images(tmp_path) | ||
| images = _images(tmp_path, case["test_image"]) | ||
| conversations = _conversations(images, max_new_tokens) | ||
| record_evidence("inputs", {"prompt": PROMPTS["describe"], "image": ROOT / "data" / "test_img.jpeg", | ||
| record_evidence("inputs", {"prompt": PROMPTS["describe"], "image": ROOT / case["test_image"], | ||
| "conversations": [_summary(name, messages) | ||
| for name, messages in conversations]}) | ||
| margin = None | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Template choice is inferred from a missing field, which misreports PaliGemma.
The new branch treats an image-text runtime with no
use_chat_templatefield as always templated. PaliGemma has no chat template. Its prompt builder states this (families/paligemma/runtime/prompt.cpp:19), and its config view does not declare the field. A request withuse_chat_template: truetherefore loses that flag and runs as a raw prompt, with no error. A request withuse_chat_template: falsefails with "always applies its chat template", which is wrong for this runtime.The field's absence does not separate the two cases. SmolVLM also declares no such field, and this PR relies on it accepting
true.Decide the template behavior from an explicit runtime capability, not from field absence. A runtime that does not apply a template must reject
use_chat_template: true. Itsfalserequest must run the raw prompt. A runtime that applies a template must keep acceptingtrue. The inspected code has no such capability, so the design must add one. This comment does not prescribe the mechanism.Source: Coding guidelines