You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pdf): fp32 layout retry for pages the int8 quant loses; model inventory
Same build, same models, same bill: one machine's CPU converts it
perfectly, another's dissolves page 1 into orphan one-liners — every table
gone — while its CUDA build is fine. The default int8 layout graph keeps
its confidences near the 0.5 label thresholds, and a different CPU's
quantized kernels (AVX-VNNI vs AVX2, CUDA's mixed fallback) can flip a
whole page's detections under them. Verified live: DOCLING_RS_FP32=1 fixed
the page on the affected machine.
The guard: when a dense digital page (≥15 text cells) ends up with
detections covering <50% of its text cells, that one page re-runs on the
fp32 graph — lazily loaded, only when the int8 file was auto-selected
(explicit DOCLING_LAYOUT_ONNX / DOCLING_RS_FP32 choices are respected) —
and whichever detections cover more win, with a warning naming both
coverages. Coverage = fraction of non-empty cells some detection claims at
docling's 0.2 intersection-over-self (assemble::layout_cell_coverage,
unit-tested). The full corpus never trips the guard (0 firings) and stays
byte-identical: 5/14 strict + 6/14 ws-normalized, same per-fixture diffs.
Diagnostics so "wrong models" stops being a mystery: docling-pdf's new
model_inventory() resolves what every stage would load right now (layout
int8/fp32 pick, TableFormer's decoder ranking via the extracted
tableformer::resolved_paths — shared with load so it can't drift — OCR
language pair, pdfium), with found/size per file. docling re-exports it;
docling-serve logs it at startup and serves it in /v1/config (documented
in openapi.yaml), so two deployments converting differently is one curl
diff away.
Verified: with the threshold temporarily forced the fallback loads and
converts (bill unchanged, 22 table rows); at the real threshold the bill
and the whole groundtruth corpus never trigger it. Unit tests for the
coverage metric; fmt/clippy clean.
Signed-off-by: artiz <artem.kustikov@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EY5KAiquN4YpVf2PXEQkVT
0 commit comments