From 76b6f40f5a3875dbc6bf7609f109dc44fcc6112d Mon Sep 17 00:00:00 2001 From: Yong Yue Date: Fri, 24 Jul 2026 10:39:29 +0800 Subject: [PATCH] recipe(google/owlvit-base-patch32): add verified CPU fp32/fp16 recipes Add zero-shot-object-detection recipes for google/owlvit-base-patch32 on CPU (fp32 and fp16), verified through L2 numeric parity against PyTorch (cosine > 0.9999 on all outputs). --- ...ero-shot-object-detection_fp16_config.json | 68 +++++++++++++++++++ ...ero-shot-object-detection_fp32_config.json | 55 +++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp16_config.json create mode 100644 examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp32_config.json diff --git a/examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp16_config.json b/examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp16_config.json new file mode 100644 index 000000000..01a68d450 --- /dev/null +++ b/examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp16_config.json @@ -0,0 +1,68 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "pixel_values", + "dtype": "float32", + "shape": [1, 3, 768, 768], + "value_range": [0, 1] + }, + { + "name": "input_ids", + "dtype": "int32", + "shape": [1, 16], + "value_range": [0, 49408] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [1, 16], + "value_range": [0, 2] + } + ], + "output_tensors": [ + { + "name": "logits" + }, + { + "name": "pred_boxes" + }, + { + "name": "text_embeds" + }, + { + "name": "image_embeds" + } + ] + }, + "optim": {}, + "quant": { + "mode": "fp16", + "samples": 10, + "calibration_method": "minmax", + "weight_type": "uint8", + "activation_type": "uint16", + "per_channel": false, + "symmetric": false, + "task": "zero-shot-object-detection", + "model_id": "google/owlvit-base-patch32", + "model_type": "owlvit", + "fp16_keep_io_types": true, + "fp16_op_block_list": null + }, + "compile": null, + "loader": { + "task": "zero-shot-object-detection", + "model_class": "AutoModelForZeroShotObjectDetection", + "model_type": "owlvit" + } +} diff --git a/examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp32_config.json b/examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp32_config.json new file mode 100644 index 000000000..8b59a039d --- /dev/null +++ b/examples/recipes/google_owlvit-base-patch32/cpu/cpu/zero-shot-object-detection_fp32_config.json @@ -0,0 +1,55 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "pixel_values", + "dtype": "float32", + "shape": [1, 3, 768, 768], + "value_range": [0, 1] + }, + { + "name": "input_ids", + "dtype": "int32", + "shape": [1, 16], + "value_range": [0, 49408] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [1, 16], + "value_range": [0, 2] + } + ], + "output_tensors": [ + { + "name": "logits" + }, + { + "name": "pred_boxes" + }, + { + "name": "text_embeds" + }, + { + "name": "image_embeds" + } + ] + }, + "optim": {}, + "quant": null, + "compile": null, + "loader": { + "task": "zero-shot-object-detection", + "model_class": "AutoModelForZeroShotObjectDetection", + "model_type": "owlvit" + } +}