Skip to content

Comments

fix cache dynamic dimension in image-text-to-text#421

Open
xadupre wants to merge 4 commits intomainfrom
fixitt
Open

fix cache dynamic dimension in image-text-to-text#421
xadupre wants to merge 4 commits intomainfrom
fixitt

Conversation

@xadupre
Copy link
Collaborator

@xadupre xadupre commented Feb 23, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to address dynamic-shape handling around KV-cache tensors for the image-text-to-text task, and adds a way to override the ONNX opset used by the Qwen2.5-VL export script.

Changes:

  • Adjust dynamic shape specifications for past_key_values in image_text_to_text inputs.
  • Gate the GenerationMixin.prepare_inputs_for_generation patch by an additional transformers version upper bound and update related unit test skip logic.
  • Add an optional opset parameter to the Qwen2.5-VL export entrypoint and update the CI export unit test to pass a specific opset.

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
onnx_diagnostic/torch_export_patches/patches/_patch_transformers_generation_mixin.py Adds an upper-bound version condition for when prepare_inputs_for_generation is patched.
onnx_diagnostic/tasks/image_text_to_text.py Updates dynamic-shape metadata for past_key_values (KV cache) to include a dynamic sequence/cache dimension.
onnx_diagnostic/ci_models/export_qwen25_vl.py Adds an optional opset argument and uses it to select target_opset.
_unittests/ut_torch_export_patches/test_patch_transformers.py Skips a subtest for transformers versions at/above the new boundary.
_unittests/ut_ci_models/test_ci_export.py Passes opset=24 into the Qwen2.5-VL export main() in the unit test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 199 to 203
atol: float = 0.01,
mismatch01: float = 0.1,
profile_exporter: bool = False,
opset: Optional[int] = None,
):
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opset was added as a main() parameter and is used to pick target_opset, but it is not wired to the CLI entrypoint: get_parser() in ci_helpers.py does not define an --opset option, and the __main__ call site doesn’t pass one. If the intent is to make opset user-configurable from the command line, add a parser argument and forward args.opset into main() (otherwise consider clarifying that this is only for programmatic use).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant