Fix multi-input ONNX binding and add OWLv2 CPU fp32 recipe#1101
Open
ssss141414 wants to merge 6 commits into
Open
Fix multi-input ONNX binding and add OWLv2 CPU fp32 recipe#1101ssss141414 wants to merge 6 commits into
ssss141414 wants to merge 6 commits into
Conversation
6b10ded to
df5aee3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OWLv2 zero-shot object detection support (CPU fp32)
Adds verified CPU fp32 coverage for
google/owlv2-base-patch16and fixes the generalized multi-input ONNX export bug discovered while producing the recipe.Why this is not recipe-only
The initial recipe listed
[pixel_values, input_ids, attention_mask].torch.onnx.exportinvoked the model safely with keyword arguments, but appliedinput_namespositionally inforward()order. For OWLv2 (input_ids, pixel_values, attention_mask), the ONNX graph therefore labeled the rank-2 text tensor aspixel_valuesand the rank-4 image tensor asinput_ids. Named-input perf/eval then failed withInvalid rank for input: pixel_values Got: 4 Expected: 2.Reordering one recipe only hid this framework bug. Commit
72cd79effixesHTPExporter._convert_model_to_onnx()so the default kwargs export path derives ONNX input-name order from the model'sforward()signature. Models implementing the existingget_export_args()positional protocol retain their explicit binding behavior.The existing regression test previously asserted only that both names existed, so swapped bindings passed. It now asserts the exact name-to-shape mapping and reproduces the former failure when run against old
main.Recipe
examples/recipes/google_owlv2-base-patch16/cpu/cpu/zero-shot-object-detection_fp32_config.jsoninput_ids[1,16] int32,pixel_values[1,3,960,960] float32,attention_mask[1,16] int32logits,pred_boxes,text_embeds,image_embedsclamp_constant_values=truequant: null)The earlier
_fp16filename was inaccurate: the recipe usesquant: nulland this run contains only fp32 evidence. Commit920a3047renames it to_fp32. No fp16 or accelerator recipe is claimed without exact tuple evidence.Verification
test_pytorch_export.pyplus related patcher tests)model.onnx.data= 585.2 MBPrecision / EP evidence matrix
winml analyze --ep allon the available host reported OpenVINO CPU 1020 supported / 5 unknown boundary casts. Provider availability is not used to infer support for untested tuples.