[Example] Add Top-n-sigma logit truncation custom logits processor - #7
Open
Jackie2049 wants to merge 1349 commits into
Open
[Example] Add Top-n-sigma logit truncation custom logits processor#7Jackie2049 wants to merge 1349 commits into
Jackie2049 wants to merge 1349 commits into
Conversation
Jackie2049
force-pushed
the
feature/top-n-sigma-logits-processor
branch
5 times, most recently
from
June 10, 2026 12:28
eefc3f0 to
2e95e18
Compare
Codekiing
force-pushed
the
feature/top-n-sigma-logits-processor
branch
from
June 11, 2026 08:38
e513f58 to
2683269
Compare
Jackie2049
force-pushed
the
feature/top-n-sigma-logits-processor
branch
2 times, most recently
from
June 11, 2026 13:37
1d2f067 to
9813229
Compare
Codekiing
force-pushed
the
feature/top-n-sigma-logits-processor
branch
from
June 11, 2026 13:48
9813229 to
1e74d63
Compare
Jackie2049
force-pushed
the
feature/top-n-sigma-logits-processor
branch
from
June 12, 2026 01:09
e00cfff to
f53ea0c
Compare
Codekiing
force-pushed
the
feature/top-n-sigma-logits-processor
branch
5 times, most recently
from
June 12, 2026 02:48
a3c15ac to
2f09705
Compare
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Adam Baranowski <adam.baranowski@poolside.ai>
…t#47483) Signed-off-by: Nick Hill <nickhill123@gmail.com>
Signed-off-by: Nick Hill <nickhill123@gmail.com>
…ate (vllm-project#47485) Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…g window (vllm-project#47217) Signed-off-by: Luciano Martins <lucianommartins@users.noreply.github.com> Co-authored-by: Luciano Martins <lucianommartins@users.noreply.github.com>
…er (vllm-project#44682) Co-authored-by: Bugen Zhao <i@bugenzhao.com> Signed-off-by: Ting Sun <suntcrick@gmail.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
…OS (vllm-project#47289) Signed-off-by: reidliu41 <reid201711@gmail.com>
…oject#47405) Signed-off-by: zengxian <xiangdong.zeng@intel.com>
…mitive-level profiling (vllm-project#47467) Signed-off-by: Evgeny Parshutin <eugeny.parshutin@intel.com>
Signed-off-by: zengxian <xiangdong.zeng@intel.com>
…llm-project#47995) Signed-off-by: Chris Leonard <chleonar@redhat.com>
…lm-project#48014) Signed-off-by: Nick Hill <nickhill123@gmail.com>
Signed-off-by: Kaihang Jiang <kaihangj@login-lyris02.lyris.clusters.nvidia.com>
…t#47894) Signed-off-by: Djordje Ramic <djoramic@amd.com>
…t#46661) Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg>
Signed-off-by: Tyler Michael Smith <tyler@tylermsmith.com> Signed-off-by: Tyler Michael Smith <tlrmchlsmth@gmail.com> Signed-off-by: Itay Etelis <itay.etelis@ibm.com> Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com> Signed-off-by: Or Ozeri <oro@il.ibm.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Itay Etelis <92247226+Etelis@users.noreply.github.com> Co-authored-by: Itay Etelis <itay.etelis@ibm.com> Co-authored-by: Or Ozeri <oro@il.ibm.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…-project#46718) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Signed-off-by: Roberto L. Castro <38211239+LopezCastroRoberto@users.noreply.github.com>
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
…lm-project#48010) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
…8046) Signed-off-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…llm-project#45880) Signed-off-by: zixi-qi <zixi@inferact.ai> Co-authored-by: Nick Hill <nickhill123@gmail.com>
…-project#47874) Signed-off-by: stefankoncarevic <stefan.koncarevic@amd.com> Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…GLE_TOKEN_DECODE (vllm-project#47144) Signed-off-by: Dino Music <Dino.Music@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
…n LoRA shrink (vllm-project#47944) Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com>
…llm-project#47849) Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: jiang1.li <jiang1.li@intel.com>
…roject#42478) Signed-off-by: JooHo Lee <BWAAEEEK@users.noreply.github.com> Signed-off-by: JooHo Lee <jooho414@gmail.com> Co-authored-by: JooHo Lee <BWAAEEEK@users.noreply.github.com>
Signed-off-by: Xianbao QIAN <xianbao.qian@gmail.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: wenjun.liu <wenjun.liu@intel.com> Signed-off-by: jun,du <jun.du@intel.com> Co-authored-by: jun,du <jun.du@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
Signed-off-by: Benjamin Chislett <bchislett@nvidia.com> Signed-off-by: Benjamin Chislett <chislett.ben@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
…ect#46415) Signed-off-by: muhammadfawaz1 <135441198+muhammadfawaz1@users.noreply.github.com> Co-authored-by: Mahad Durrani <114791389+mahadrehmann@users.noreply.github.com>
…code (vllm-project#46694) Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Co-authored-by: Nick Hill <nickhill123@gmail.com>
…llm-project#48096) Signed-off-by: Xianbao QIAN <xianbao.qian@gmail.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Cyrus Leung <tlleungac@connect.ust.hk> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
…ject#48100) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
… aren't misclassified as prefills (vllm-project#47381) Signed-off-by: Woosuk Kwon <woosuk@inferact.ai> Signed-off-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Nick Hill <nickhill123@gmail.com>
…lm-project#48101) Signed-off-by: khluu <khluu000@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…n-CUDA builds (vllm-project#47296) Signed-off-by: Tsvika Shapira <tsvika@moonmath.ai> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.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.
Summary
Closes #2
Adds an example demonstrating Top-nσ as a custom logits processor in vLLM, based on the paper:
What is Top-nσ?
Top-nσ is a logit-space dynamic truncation method that uses the standard deviation of the logit distribution to set a filtering threshold:
Unlike probability-space filters (top_p, min_p), it operates before softmax and adapts to distribution "peakiness":
How it compares to other truncation methods
Why Top-nσ?
Changes
examples/features/logits_processor/top_n_sigma.pyapply()method uses vectorized Torch operations (not Python per-row loop)Key properties
extra_argsmechanism (noSamplingParamschanges needed)Usage
Testing
facebook/opt-125mapply()is bit-for-bit identical to row-by-row loop across FP32/FP16 configsreq_info