Skip to content

recipe(yolos-fashionpedia): add object detection recipes#1125

Draft
kujin66 wants to merge 3 commits into
mainfrom
kujin66/add-yolos-fashionpedia-recipe
Draft

recipe(yolos-fashionpedia): add object detection recipes#1125
kujin66 wants to merge 3 commits into
mainfrom
kujin66/add-yolos-fashionpedia-recipe

Conversation

@kujin66

@kujin66 kujin66 commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Adds nested CPU recipe coverage for the pinned YOLOS Fashionpedia object-detection checkpoint:

  • examples/recipes/valentinafevu_yolos-fashionpedia/cpu/cpu/object-detection_fp32_config.json
  • examples/recipes/valentinafevu_yolos-fashionpedia/cpu/cpu/object-detection_fp16_config.json

The model is already exportable on current main, so this remains an L0 recipe-only contribution. No source, test, skill, or README files are changed.

Original recipe contribution and model selection are credited to @kujin66 (jinkun@microsoft.com); the contributor-authored commit is preserved after rebasing onto current main.

Frozen identity and scope

Field Value
Model valentinafevu/yolos-fashionpedia
Model revision 0cfdb77c01cfbf0838b940ecff9c572f84c9d4f4
Architecture / task yolos / YolosForObjectDetection / object-detection
Dataset detection-datasets/fashionpedia
Dataset revision 80845435ce686b8a9dbf70a05452fbfb8e09cdd7
Target tuples CPU fp32, CPU fp16
Planner effort / outcome / goal ceiling L0 / L0 / L3
Current-main baseline 5deebd422e95f28fe8fd912ee50ce874710187b3

Optimum natively registers YOLOS object detection. Current main recipe-free export, optimize, perf, and pinned Fashionpedia evaluation all succeed; the recipe supplies exact CPU precision and authoritative evaluation metadata rather than a model-class source fix.

Export contract

  • Input: pixel_values, float32 [1, 3, 512, 864]
  • Outputs: logits [1, 100, 47], pred_boxes [1, 100, 4]
  • 46 Fashionpedia labels plus the YOLOS no-object class
  • Opset 17; named I/O preserved in both artifacts

Verification

All final evidence was collected from a fresh detached checkout of commit 2d15c75a4b005ec60cceb1f04e3cde83a32d534c using the immutable local Hugging Face snapshot above.

Goal CPU fp32 CPU fp16
L0 build / structure PASS - 400 nodes, 223 FLOAT initializers PASS - 403 nodes, 223 FLOAT16 initializers
L1 mean / p50 371.121 / 355.785 ms 490.999 / 487.474 ms
L1 throughput 2.69 samples/s 2.04 samples/s
L1 RSS total delta 302.08 MB 594.91 MB
L2 max relative L2, 3 named-input cases 4.107905e-7 (threshold 1e-4) 3.402890e-4 (threshold 2e-2)
L3 Fashionpedia mAP 0.0081833834 0.0081833834
L3 mAP50 / mAP75 0.0334050804 / 0.0009040034 0.0334050804 / 0.0009040034

L3 used pinned val, deterministic first 10 streaming samples, 93 ground truths, and 1000 predictions with image / objects and absolute xywh boxes. Both precisions exactly match the current-main fp32 baseline mAP on this sample.

The fp16 artifact is smaller, but CPU fp16 is slower and uses more RSS on this host; this PR claims compatibility and parity, not a CPU speedup.

Component and operator analysis

  • Final component mapping: fp32 400/400 nodes and fp16 403/403 nodes mapped across embeddings, all 12 encoder layers, final layer normalization, class head, box head, and optimizer-generated functional nodes.
  • Final operator inventory: 14 fp32 op types; fp16 adds Cast for 15.
  • Static all-EP analysis: every op type is supported by available rule data for TensorRT RTX GPU, QNN GPU/NPU, and OpenVINO CPU/GPU/NPU.
  • CUDA, MIGraphX, DML, CPU, and VitisAI have no rule data in this analyzer snapshot and therefore report unknown, not unsupported. GeluPattern is informationally unknown.
  • These are static compatibility results; runtime evidence in this PR is CPUExecutionProvider only.

Quality gates

  • Ruff: PASS
  • Whole-package mypy: PASS
  • Affected models CI partition (models, loader, datasets, export): PASS
  • Final-head GitHub checks: required before review completion

Host note

This machine's auto-installed OpenVINO 1.8.15.0 plugin cannot load because openvino.dll is missing. Without isolation, valid CPU perf/eval JSON is written and process teardown exits with Windows 0xC0000005. Final evidence uses the established fail-closed review shim to disable the broken Windows ML EP catalog while retaining ONNX Runtime CPUExecutionProvider; all final build, perf, and eval commands exit 0. This is host packaging friction, not a YOLOS recipe or methodology blocker.

@kujin66

kujin66 commented Jul 16, 2026

Copy link
Copy Markdown
Author

Reviewer-style verification (not a formal GitHub approval; same account authored the PR):

  • PR branch head: e5cd3ec33bfaa14eaf037be937b720c394810274.
  • Scope check: diff is limited to examples/recipes/README.md plus the two examples/recipes/valentinafevu_yolos-fashionpedia/*.json recipe files. No source, tests, or skill files are included.
  • Baseline freshness: PR body cites origin/main/baseline HEAD 904c20109ab31d737c5132c3686ab404236edd57; current origin/main was refreshed and matches that commit.
  • Recipe check: object-detection_fp16_config.json uses quant.mode=fp16; rebuilt artifact temp/yolos_fashionpedia_fp16_recipe2/model.onnx has 226 FLOAT16 initializers and preserved I/O. object-detection_w8a8_config.json artifact contains QDQ nodes (QuantizeLinear=440, DequantizeLinear=666).
  • L0/L1 evidence: PR body includes build output dirs, build-complete lines, structural I/O shapes, CPU provider snapshot, and w8a8 perf numbers.
  • CI: all checks are passing at time of comment: license/cla, lint, Analyze (Python), CodeQL, and all test jobs.

Remaining gate: external maintainer/reviewer approval and conversion from Draft to Ready.

@ssss141414 ssss141414 added the model-scale-by-skill Model support PR created or maintained by the adding-model-support skill label Jul 21, 2026
@ssss141414
ssss141414 force-pushed the kujin66/add-yolos-fashionpedia-recipe branch from 9ac2bbf to 2d15c75 Compare July 22, 2026 20:07
@ssss141414

Copy link
Copy Markdown
Contributor

APPROVE

Independent final-head re-verification completed for 2d15c75a4b005ec60cceb1f04e3cde83a32d534c (review verdict comment, not a same-account formal GitHub approval).

  • Fresh remote checkout: clean; diff is exactly the nested CPU fp32/fp16 recipe pair; README unchanged.
  • Contributor credit: original jinkun <jinkun@microsoft.com> authored commit remains in history after rebase onto current main.
  • Identity pins: model 0cfdb77c01cfbf0838b940ecff9c572f84c9d4f4; Fashionpedia 80845435ce686b8a9dbf70a05452fbfb8e09cdd7.
  • Independent rebuild: fp32 and fp16 both exit 0; reproduced bit-identical artifact hashes fc3d5b68...ef79c and d39e0e57...78bfe.
  • Structure/parity: named pixel_values I/O preserved; 400 fp32 nodes / 403 fp16 nodes; 223 FLOAT / 223 FLOAT16 initializers; max relative L2 3.627619e-7 / 3.275043e-4, both below thresholds.
  • Independent CPU perf/RSS: fp32 mean/p50 364.092/360.761 ms, RSS 302.60 MB; fp16 530.519/484.239 ms, RSS 595.07 MB.
  • Independent pinned L3: both precisions mAP 0.0081833834, mAP50 0.0334050804, mAP75 0.0009040034 on the same 10 deterministic val samples.
  • Tester all-EP evidence is bound to the bit-identical artifact hashes: 400/400 and 403/403 components mapped; every op supported on rule-backed TensorRT RTX, QNN GPU/NPU, and OpenVINO CPU/GPU/NPU; rule-less EPs remain unknown, not unsupported.
  • Local gates: Ruff PASS; mypy PASS (409 files); affected models partition PASS (1351 passed, 6 skipped, 1 xfailed).
  • Final-SHA GitHub checks: 9/9 completed successfully, including CodeQL, lint, license/CLA, and all five CI partitions.
  • Review threads: 0 total / 0 unresolved.
  • Metadata: draft preserved; sole required label model-scale-by-skill preserved.

The earlier author verification comment is superseded by this current-main, final-head fp32/fp16 evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model-scale-by-skill Model support PR created or maintained by the adding-model-support skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants