Add LayoutLM v1 document-question-answering support (impira/layoutlm-invoices)#1096
Draft
ssss141414 wants to merge 1 commit into
Draft
Add LayoutLM v1 document-question-answering support (impira/layoutlm-invoices)#1096ssss141414 wants to merge 1 commit into
ssss141414 wants to merge 1 commit into
Conversation
ssss141414
force-pushed
the
shzhen/add-layoutlm-invoices
branch
from
July 15, 2026 04:13
37278b0 to
175b8e7
Compare
ssss141414
force-pushed
the
shzhen/add-layoutlm-invoices
branch
from
July 22, 2026 15:13
c3bb569 to
4c0ec9a
Compare
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.
Summary
Add verified CPU recipes for
impira/layoutlm-invoicesusing the LayoutLM question-answering support that is now present on currentmain.This PR is recipe-only. The earlier duplicate
layoutlm.py, registration import, and export tests were removed after rebasing onto currentmain(5deebd422e95f28fe8fd912ee50ce874710187b3).Model metadata
question-answeringwithLayoutLMForQuestionAnswering.start_logits,end_logits).Validation and support evidence
Baseline
Current
origin/mainat5deebd422e95f28fe8fd912ee50ce874710187b3already containssrc/winml/modelkit/models/hf/layoutlm.pyfrom #1093.Recipe-free current-main probe remains misrouted by checkpoint metadata:
Using current main's existing LayoutLM support with an explicit model-specific recipe succeeds; no additional source code is required.
Goal
Verify CPU
fp32andfp16recipe coverage, runtime performance, and numeric parity with PyTorch.Outcome
Recipe-only CPU support. No source or test files are added by this PR.
Per-EP/device/precision results
input_ids,bbox,attention_mask,token_type_ids; outputsstart_logits,end_logits; external data 508,803,072 bytesHost runtime provider:
CPUExecutionProvider.Delta
Compared with current main, this PR adds only two model-specific recipes. They select the existing main implementation through:
loader.task = question-answeringloader.model_class = LayoutLMForQuestionAnsweringtoken_type_ids, and boundedbboxvaluesAnalyze summary
Build hierarchy tagging mapped 638/638 ONNX nodes (100%). The artifact has four named LayoutLM inputs and the expected two extractive-QA outputs. Runtime rule data was unavailable on this host, so no unsupported-op count is claimed.
Quality gates
ruff check src/ tests/— PASSmypy -p winml.modelkit— PASS, 409 source filesgit diff --check— PASSReproduce commands