Skip to content

Add FullContextOnnxLabelScorer - #241

Open
larissakl wants to merge 16 commits into
masterfrom
full-context-onnx-label-scorer
Open

larissakl wants to merge 16 commits into
masterfrom
full-context-onnx-label-scorer

Conversation

@larissakl

@larissakl larissakl commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds a FullContextOnnxLabelScorer, that forwards either the input feature at the current timestep or the full encoder state sequence, together with the complete label history through a single ONNX model. It's structurally analogous to FixedContextOnnxLabelScorer, but the history is never truncated.

I moved the SeqStepScoringContext to ScoringContexts.[hh|cc] again to reuse it for this label scorer.

@larissakl
larissakl marked this pull request as ready for review July 15, 2026 08:43
Comment thread src/Nn/LabelScorer/CMakeLists.txt Resolved
@larissakl
larissakl requested a review from SimBe195 July 16, 2026 17:07
larissakl and others added 3 commits August 13, 2026 15:35
When every scoring context of a group was already in the score cache, the
`continue` skipped the rest of the loop body, including the part that builds the
score accessors from the cache. All contexts of that group were then returned as
std::nullopt, which the search reads as "not ready to score this context yet".

`forwardBatch` already returns early on an empty batch, so the check can simply
be dropped.

This does not currently happen in a normal decode: a scoring context is
identified by its label sequence and its time step, and every decode step
appends a label and advances the time step, so the contexts of a step are never
cached yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants