recipe(owlv2-large-patch14-finetuned): add CPU zero-shot detection configs#1196
Draft
fuliucansheng wants to merge 1 commit into
Draft
recipe(owlv2-large-patch14-finetuned): add CPU zero-shot detection configs#1196fuliucansheng wants to merge 1 commit into
fuliucansheng wants to merge 1 commit into
Conversation
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.
Summary
Adds CPU recipe coverage for
google/owlv2-large-patch14-finetuned, an OWLv2 open-vocabulary zero-shot object detector exported through Optimum'sOwlV2OnnxConfigand WinML's generic inference path. This is an L0 recipe-only contribution: currentmaincan export and run the model, and this PR records verified CPU fp32/fp16 coverage with checked-in recipes.Model metadata
What the model does:
google/owlv2-large-patch14-finetuneddetects objects described by text queries in an image. The checkpoint combines a CLIP-style text tower, a large ViT image tower, and object-detection heads that emit class logits, normalized boxes, and text/image embeddings.Primary user stories:
Owlv2ForObjectDetectionarchitectureSupported tasks:
zero-shot-object-detectionModel architecture:
Source/confidence: pinned checkpoint config resolves
model_type: owlv2,architectures: [Owlv2ForObjectDetection], image size 1008, patch size 14, vocab size 49408, text hidden size 768, vision hidden size 1024, and processor classesOwlv2Processor,CLIPTokenizer, andOwlv2ImageProcessor.Validation and support evidence
Baseline
Baseline was run from current
origin/mainatace130f20e36df44ebf7de6cf0356235c8ee79fdwithwinml, version 0.2.0.winml inspectAutoModelForZeroShotObjectDetection, exporterOwlV2OnnxConfig, WinML classWinMLModelForGenericTask; taskzero-shot-object-detection; default exported input order is displayed aspixel_values,input_ids,attention_mask.owlv2: vendor task includeszero-shot-object-detection; WinML adds no extra task override.Owlv2ForObjectDetectionwith 468 modules and 437.6M parameters; export tagged 1987/1987 nodes; final artifact emitted.winml eval --schema --task zero-shot-object-detectionreports the task is not supported by the eval registry, so no task metric is available through the CLI today.Baseline
winml config -p fp32 --ep cpu --device cpuandwinml config -p fp16 --ep cpu --device cpuare the sources for the checked-in recipes.Goal
Effort: L0. Goal ceiling: L1. Outcome: L0 recipe-only.
Success means the checked-in CPU fp32/fp16 recipes build structurally valid ONNX artifacts and run
winml perfon CPU. L2/L3 are not claimed for this PR: the eval CLI has nozero-shot-object-detectiontask, and no task metric is reported.Outcome
Highest verified goal: L1 PASS on CPU for both fp32 and fp16. Coverage is full for the targeted EP set (
cpu/cpu/fp32,cpu/cpu/fp16); no accelerator tuples are claimed.Shipped recipes:
examples/recipes/google_owlv2-large-patch14-finetuned/cpu/cpu/zero-shot-object-detection_fp32_config.jsonexamples/recipes/google_owlv2-large-patch14-finetuned/cpu/cpu/zero-shot-object-detection_fp16_config.jsonMethodology friction observed: none. Model finding applied: OWLv2 checked-in recipes keep
export.input_tensorsinOwlv2ForObjectDetection.forward(input_ids, pixel_values, attention_mask)order so ONNX input names stay aligned when the recipe is used directly.Per-EP/device/precision results
input_ids [1,16] int32,pixel_values [1,3,1008,1008] float32,attention_mask [1,16] int32; outputslogits [1,5184,1],pred_boxes [1,5184,4],text_embeds [1,1,768],image_embeds [1,72,72,1024]; 1439 nodes; external data colocated withmodel.onnx.--precision fp16; fp16 stage complete in 17.3s; FLOAT16 initializers present; model data is about 829.2 MB vs 1658.4 MB for fp32; 1444 nodes.winml eval --schema --task zero-shot-object-detectionreports unsupported task; supported task list does not includezero-shot-object-detection.Delta
Both recipes are generated from current
winml configoutput with explicit CPU targeting, then refined to declareexport.input_tensorsin the model forward-signature order:/export/input_tensors/0/namepixel_valuesinput_idsOwlv2ForObjectDetection.forward(input_ids, pixel_values, attention_mask)./export/input_tensors/1/nameinput_idspixel_valuesThe fp32 recipe preserves
quant: null; the fp16 recipe preserves the generated fp16 quantization block and model metadata. No source code or tests are changed, andexamples/recipes/README.mdis untouched.Reducibility: recipe-only is appropriate because WinML/Optimum already resolves the task, loader, exporter, and generic WinML inference class. This PR is a per-checkpoint verified CPU coverage declaration plus a checked-in forward-order recipe, not a class-wide source fix.
Analyze summary
Static rule analysis completed with partial-success exit semantics: QNN/OpenVINO rows were complete, while VitisAI has no rule data and is all-unknown. This is compatibility analysis, not runtime execution.
Component-level summary
Div,Erf,Add,Mul; unknownSqrt,Einsum,Cast. OpenVINO NPU: unknownSqrt,Einsum,Cast. VitisAI: no rule data.Expand, GELU-relatedDiv,Erf,Add,Mul; unknownSqrt,Cast,Einsum. OpenVINO NPU: unknownSqrt,Cast,Einsum. VitisAI: no rule data.Op-level summary
Reproduce commands