recipe(owlvit): add verified CPU fp32 and fp16 support#1155
Draft
kujin66 wants to merge 3 commits into
Draft
Conversation
Author
|
APPROVE Reviewer checks performed from PR branch
Coverage annotation: full for charter target EP |
kujin66
marked this pull request as ready for review
July 21, 2026 03:50
ssss141414
marked this pull request as draft
July 22, 2026 16:49
ssss141414
approved these changes
Jul 22, 2026
ssss141414
left a comment
Contributor
There was a problem hiding this comment.
APPROVE
Independent final-head review at 3c8ebb41971f8e6dd472f0e3726063ed0867abbf:
- Planner baseline is still current
main(5deebd422e95f28fe8fd912ee50ce874710187b3); no replan was needed. - History was fast-forwarded without force; the original contributor commit remains in ancestry.
- Diff is limited to the two nested CPU recipes, generalized HTP exporter binding, and focused exporter regressions.
examples/recipes/README.mdis unchanged; no OwlViT/model-ID branch exists. - Focused Ruff passes; the complete changed unit file passes (
28 passed). Full-repository Ruff reports six pre-existing failures outside this PR's diff; GitHub's final-head lint check passes. - Both recipes parse. Independent artifact inspection confirms exact semantic inputs (
input_idsINT32[1,16],pixel_valuesFLOAT[1,3,768,768],attention_maskINT32[1,16]), expected outputs, 1,025/1,030 nodes, 417 FLOAT versus 417 FLOAT16 initializers, valid external data, and fp16 weights at 50.0% of fp32. - Recipe-free acceptance, CPU runtime, disclosed
winml perfpost-result native exit, public-rule component/op analysis, and Lane A knowledge evidence are complete. - Independent named-input L2 rerun against pinned revision
4b420debb9c806fc4caf9ecc8efb72208c0db892passes for all four outputs: minimum cosine fp320.9999999999958579, fp160.9999971841176521. - L3 remains correctly
CLI-BLOCKED; final-head command exits 2 becausezero-shot-object-detectionis absent fromwinml eval(tracked by #1147). - All 9 final-head checks pass. Review threads: 0 total / 0 unresolved. Coverage is full for mandatory CPU fp32/fp16.
The PR intentionally remains Draft.
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 verified CPU support for
google/owlvit-base-patch16zero-shot object detection in fp32 and fp16, and fixes a class-wide exporter defect that could attach keyword-input ONNX names to the wrong tensor shapes. The contribution is Effort L1 / Outcome L1: shared input-name binding code, focused regressions, and exact nested CPU recipes. Goal L2 passes for both precisions; Goal L3 is CLI-BLOCKED becausewinml evaldoes not supportzero-shot-object-detection.Model metadata
What the model does
OWL-ViT performs open-vocabulary object detection: it embeds an image and one or more text queries into a shared representation, then returns a class score and normalized bounding box for each image patch so objects can be localized from natural-language labels not fixed at training time.
4b420debb9c806fc4caf9ecc8efb72208c0db892,OwlViTForObjectDetectionin Transformers 4.57.6, and its concrete forward/output contract (verified).Primary user stories
verifiedfrom the pinned model card and concrete Transformers example.)Supported tasks
zero-shot-object-detectionThe checkpoint declares the task; Transformers resolves
OwlViTForObjectDetectionandOwlViTProcessor; Optimum registers vendor ONNX support;winml inspectresolvesAutoModelForZeroShotObjectDetection,OwlViTOnnxConfig, and the generic WinML inference class.Model architecture
OwlViTForObjectDetectionwraps a CLIP-like dual encoder with 12-layer text and vision Transformers, reshapes 768 × 768 image patches into a 48 × 48 feature map, and applies independent class and box heads to 2,304 patch queries.verified).Validation and support evidence
Baseline
main:5deebd422e95f28fe8fd912ee50ce874710187b3; WinML CLI0.2.0.owlvithas vendor tasksfeature-extractionandzero-shot-object-detection; WinML adds no override (VENDOR-ONLY).Build complete in 101.6s; the graph had 1,007 nodes at opset 17.pixel_valuescarriedINT32[1,16], whileinput_idscarriedFLOAT[1,3,768,768]. Export success therefore did not establish valid input binding.1620.309 ms, p501620.510 ms,0.62 samples/s, and RSS delta1259.54 MB, then exited with Windows status-1073741819; those numbers are runtime-floor evidence only because the graph names were misbound.Task 'zero-shot-object-detection' is not supported by winml eval.pixel_valuesbeforeinput_ids; keyword invocation was name-safe while ONNXinput_namesremained positional.Goal
Outcome
gim-home/ModelKitArtifacts#177(draft Lane A PR).Per-EP/device/precision results — including perf and eval data
Goal ladder
0.999999999996339; maximum absolute delta0.00030899050.9999972712410103; maximum absolute delta0.21773243winml evalwinml evalPerf
A deterministic named-input CPU harness exited cleanly.
winml perf --memoryindependently produced closely matching complete JSON and the memory phases below before a host-native post-result exit-1073741819; that abnormal exit is retained rather than hidden.1831.759 ms1833.853 ms0.546 samples/s+1257.45 MB0 MB2324.970 ms2313.103 ms0.430 samples/s+1977.68 MB0 MBThe CLI's independent figures were fp32 mean/p50
1834.173/1886.136 ms, fp16 mean/p502319.768/2190.031 ms, and reported model precisionsfp32/fp16respectively.Eval
Exact blocker:
Error: Task 'zero-shot-object-detection' is not supported by winml eval.The task registry gap is tracked by #1147; no dataset or metric was fabricated.Delta
HTPExporter._resolve_keyword_input_names()orders ONNX names by the complete, unambiguousinspect.signature(model.forward)intersection for keyword tracing. It falls back safely for incomplete matches and preserves models with explicitget_export_args()positional protocols.28 passed.Build complete in 84.2s, withinput_ids INT32[1,16],pixel_values FLOAT[1,3,768,768], andattention_mask INT32[1,16].cpu/cpucoverage path. The fp16 recipe addsquant.mode: fp16; its artifact has 417 FLOAT16 initializers and304,811,008external-data bytes versus fp32609,623,040.model_type == "owlvit"branch.examples/recipes/README.mdremains untouched.Analyze summary — component level and op level
Static public-rule analysis completed for both artifacts; this is compatibility analysis, not runtime execution.
Component-level summary
Einsumand selectedCast/Sqrtsignatures remain unknown in rule-backed dataCastnodesThe unmapped nodes are optimizer-generated reshape/fusion helpers that lost semantic scope names; they remain explicit rather than being guessed into components.
Op-level summary
Einsumand selectedCast/SqrtsignaturesCastnodesRule-less/all-unknown groups: CPU, CUDA, MIGraphX, DML, and VitisAI.
Reproduce commands