Connect top_k in Interpreter/Engine up to front-end vis#1308
Merged
nopdive merged 4 commits intoguidance-ai:mainfrom Jul 7, 2025
Merged
Connect top_k in Interpreter/Engine up to front-end vis#1308nopdive merged 4 commits intoguidance-ai:mainfrom
nopdive merged 4 commits intoguidance-ai:mainfrom
Conversation
Collaborator
|
LGTM! |
JC1DA
reviewed
Jul 7, 2025
|
|
||
| last_temperature = 1.0 | ||
| engine_output = None | ||
| issued_token: Optional[GenToken] = None |
Collaborator
There was a problem hiding this comment.
seems we only change the name here right?
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.
EngineOutputin favor of purely usingGenTokenExtraGenTokenExtrawhenever we have top-k (still just for generated tokens)get_next_token_with_top_ka bit for more readabilityReturning said
GenTokenExtrawas the missing bit of plumbing needed to get top-k to show up in vis. @nopdive note that vis is displaying base64 encoded token bytes instead of the actual bytes, so that still needs fixing.@JC1DA would appreciate your eyes on
get_next_token_with_top_kto make sure it's still correctThere are some remaining optimizations to be done, e.g. not computing unmasked probs at all if we're not doing vis. But I think that's "next PR territory", as afaik, this is not a regression.