Repository navigation
feat(bench): parity capture and compare tooling, FP16 PE engine gate run (WP-0.1) - #238
Merged
Merged
Conversation
parity.py capture ingests the pinned COCO set into a fresh project, trains clusters once and stores per-stage outputs (detector boxes, crop rectangles, PE crop and whole-frame vectors, cluster fields, labels, optional core-route and VLM probes) as capture.json plus a float16 NPZ with the environment, engine and manifest record. parity.py compare measures a candidate against a reference (box matching, cosine, kNN overlap, cluster agreement and purity against COCO ground truth, label agreement), applies the thresholds of parity_gates.json and exits non-zero on failure (#208).
The FP16 PE engine passes every parity gate against the FP32 plan in two independent runs, with a same-plan repeat as the noise floor; the wave plan notes what the first runs established (detector run-to-run variation, vectors read from the datastore, the cluster step needs the auto-label worker) (#208).
…ling # Conflicts: # CHANGELOG.md
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.
Closes #208
What
scripts/bench/parity.pywith two subcommands, the accuracy gate for every v0.6.0 change (WP-0.1):captureingests the pinned 2,000-image COCO set into a fresh project through the public routes, trains clusters once, and writescapture.json+ a float16arrays.npz(detector boxes/classes/scores, integer crop rectangles, PE crop and whole-frame vectors, cluster id/distance/similarity/core, stored class, COCO ground-truth class, optional VLM labels, MobileCLIP / face / OCR probes).capture.jsoncarries hardware, git sha and dirty flag, container image ids, Triton model configs, the engine record (label, free KEY=VALUE pairs, plan size and sha256), the manifest hash and the sha256 of the NPZ.comparepairs two captures by image, box overlap and class name (never by id), measures the gate metrics (box matching, cosine min/mean/p01/median, kNN overlap and near-duplicate decisions, ARI/NMI, nearest-reference-centroid agreement, k-means objective, purity against COCO classes, kNN class precision, label vote, OCR exact match) and appliesscripts/bench/parity_gates.json(values from the plan). Exit 0 PASS, 1 FAIL (SKIP fails only with--strict), 2 unusable input.--outwrites a small summary JSON and markdown.Modules:
parity_metrics.py(pure maths),parity_store.py(format),parity_assemble.py,parity_gates.py,parity_capture.py(HTTP),parity_env.py,parity.py(CLI). Every file is under 700 lines.Tests
tests/bench/test_parity_*.py: 87 offline tests on synthetic boxes, vectors, labellings, strings and a fake stack (httpx.MockTransport), no GPU or Docker. Written failing-first (import error before the module). Mutation check: 18 injected mutants (flipped IoU comparison, dropped class-name check, cosine without norm, kNN keeping self, purity min, ARI without expectation, gate operator flipped, skipped sha256 and union checks, ...); 2 survived the first suite and were killed by added tests, none survive.FP16 PE engine against FP32 (live, isolated compose project, GPU 0, published v0.5.0 images)
FP16 passes every gate in two independent runs (4 and 1 uploads in flight); P-vlm is skipped (no VLM configured). The same-plan FP32 repeat is the noise floor.
Full tables:
docs/PERFORMANCE.md("Wave 0 parity and FP16 gates"), summaries indocs/benchmarks/parity/.Findings worth knowing
curation).Checks
pre-commit run --from-ref origin/main --to-ref HEADexit 0,check_docs_vs_code.pyclean,pytest tests/bench tests/curation/test_script_api_prefix.py tests/test_no_model_name_literals.py156 passed.