Add TopP and MinP sampling to all engines#48
Open
stikves wants to merge 5 commits into
Open
Conversation
Implements TopP (nucleus) and MinP sampling for both the CPU CompositeSampler and the GPU MPSGraph pipelined engine, closing the sampling gap between sequential and pipelined paths. - Add `minP` parameter to SamplingConfiguration - Integrate MinP filtering in CompositeSampler (logit-space threshold) - Rewrite MPSGraphTopKSampler → MPSGraphCompositeSampler with full TopP + MinP support via exclusive cumsum and relative probability mask - Remove pipelined engine's topP rejection (all configs now supported) - Update MPSGraphSamplerFactory to accept full SamplingConfiguration and use K=1000 window when only topP/minP is specified - Add --min-p CLI option to llm-runner - Add comprehensive tests for CPU and GPU MinP/TopP paths
58d7f58 to
b15a895
Compare
Contributor
Author
|
These are the low hanging fruits in our samplers. The follow ups might require larger refactoring. |
tjia1818
approved these changes
Jun 16, 2026
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.
Implements TopP (nucleus) and MinP sampling for both the CPU CompositeSampler and the GPU MPSGraph pipelined engine, closing the sampling gap between sequential and pipelined paths.
minPparameter to SamplingConfiguration--min-pCLI option to llm-runner