Skip to content

Add vitpose-plus-huge recipe + fix FP16 2GB protobuf limit#1099

Draft
ssss141414 wants to merge 2 commits into
mainfrom
shzhen/add-vitpose-plus-huge
Draft

Add vitpose-plus-huge recipe + fix FP16 2GB protobuf limit#1099
ssss141414 wants to merge 2 commits into
mainfrom
shzhen/add-vitpose-plus-huge

Conversation

@ssss141414

Copy link
Copy Markdown
Contributor

Summary

Adds winml-cli support for usyd-community/vitpose-plus-huge (keypoint-detection) and fixes an FP16-conversion crash that blocks every model whose fp32 export exceeds the protobuf 2 GB message limit.

Changes

  • examples/recipes/usyd-community_vitpose-plus-huge/keypoint-detection_fp16_config.json — new fp16 recipe (input pixel_values [1,3,256,192] float32, output heatmaps, VitPoseForPoseEstimation / vitpose loader, COCO-keypoints eval block). Mirrors the existing vitpose-plus-{base,small,large} recipes.
  • src/winml/modelkit/quant/fp16.pyconvert_to_fp16 now auto-detects large models and disables shape inference during conversion.

Why the FP16 fix

The ViT-Huge fp32 export is ~3.4 GB. ORT's convert_float_to_float16 runs ONNX shape inference by default, which serializes the model proto and exceeds protobuf's hard 2 GB message limit, raising google.protobuf.message.EncodeError: Failed to serialize proto. The fix estimates model size via ModelProto.ByteSize() (which itself raises past 2 GB — treated as a definitive "too large" signal) and passes disable_shape_infer=True when the model is at or above 90% of the 2 GB limit. This unblocks all >2 GB models, not just this one.

Validation

CPU-only (no NPU/GPU hardware available in this environment):

  • Build completes: Build complete in 661.9s, FP16 stage 71.4s (previously crashed with EncodeError).
  • Genuine fp16: FLOAT16 initializers = 948, FLOAT32 = 0; model.onnx.data 1.8 GB (half of the 3.6 GB fp32).
  • winml perf --device cpu --ep cpu: P50 746.49 ms, throughput 1.35 samples/sec.

Per-EP (QNN/OpenVINO/VitisAI/TensorRT) accuracy eval on all 10 buckets is deferred to CI on the appropriate hardware. This model is therefore not added to the recipe README total (which certifies all-10-bucket passes), consistent with the existing sibling vitpose recipes.

Draft — opening for review of the FP16 large-model fix and the recipe.

Add keypoint-detection fp16 recipe for usyd-community/vitpose-plus-huge. The ViT-Huge fp32 export is ~3.4 GB, and ORT's convert_float_to_float16 runs shape inference by default, which serializes the proto and exceeds protobuf's 2 GB message limit (EncodeError). convert_to_fp16 now auto-detects large models (>=90% of 2 GB via ByteSize with a raise-fallback) and passes disable_shape_infer=True, unblocking all >2 GB models. Validated CPU-only: genuine fp16 (FLOAT16=948, FLOAT32=0), build 661.9s, perf P50 746.49ms.
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