Repository navigation
llama: enable shape-aware sampler probing - #29180
Closed
aparmp-quic wants to merge 2 commits into
Closed
aparmp-quic wants to merge 2 commits into
aparmp-quic wants to merge 2 commits into
Conversation
Contributor
Author
|
cc: @max-krasnyansky |
Member
|
@ggerganov any comments/suggestions on this? |
Member
|
This change would require a major version bump. If we can just reduce the probe size to something like 128k, I would prefer this since it's much simpler solution. |
Member
New PR coming shortly. |
Member
|
@ggerganov |
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.
Overview
Backend sampler capability checks currently use a fixed candidate count when probing backend support. This may reject valid backend configurations for models with smaller vocabularies.
This change makes sampler probing shape-aware by using the actual model vocabulary size when evaluating backend support.
Additional information
The sampler currently checks backend support using a hardcoded candidate count of 1024 * 1024. Since models can have different vocabulary sizes, this can incorrectly reject valid TOP_K configurations.
Motivation: This issue was identified while enabling TOP_K support for the Hexagon backend (PR #29113). Model vocabularies such as Qwen (~152K) and Gemma (~262K) are significantly smaller than the probe size, which can incorrectly reject otherwise supported configurations. The sampler now uses the model vocabulary size during backend capability probing.
Requirements