[#SAMPLE-6] Add state to logits processing#3
Draft
joelpaulkoch wants to merge 36 commits intomainfrom
Draft
Conversation
joelpaulkoch
commented
Oct 17, 2025
joelpaulkoch
commented
Oct 17, 2025
Member
Author
|
@xhr15 that should be everything we need for stateful logit processors in general. |
joelpaulkoch
commented
Oct 21, 2025
| initial_suppressed_index = Nx.tensor([opts[:initial_suppressed_index]]) | ||
|
|
||
| suppressed_index = | ||
| context.logits_processor_states[:next_suppressed_index] || initial_suppressed_index |
Member
Author
There was a problem hiding this comment.
Suggested change
| context.logits_processor_states[:next_suppressed_index] || initial_suppressed_index | |
| context.logits_processor_state[:next_suppressed_index] || initial_suppressed_index |
| length: Enum.count(sequence, &(&1 != 0)), | ||
| input_length: 1 | ||
| input_length: 1, | ||
| logits_processor_states: %{} |
Member
Author
There was a problem hiding this comment.
Suggested change
| logits_processor_states: %{} | |
| logits_processor_state: %{} |
The individual processor function see only a state, not all states of the batch
```
** (RuntimeError) unexpected vectorized axes in evaluator for operation :add: #Nx.Tensor<
vectorized[batch: 1]
s32[1]
Nx.Defn.Expr
tensor a s32[1]
b = reshape a s32[1][1]
```
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
604b60e to
572b748
Compare
572b748 to
ce92584
Compare
…er all batches now
…ictly related to statefull processing
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
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.
No description provided.