Repository navigation
fix(gguf): cancel through Llama.abort() instead of a logits processor - #39
Merged
duckyshell merged 2 commits intoSep 29, 2026
Merged
Conversation
llama-cpp-python 0.3.48 wraps any logits_processor in a CustomSampler adapter that loops over the full vocabulary in Python for every token, cutting Direct GGUF decode speed 3-4x. Use Llama.abort() (0.3.37+) when the runtime provides it and keep the logits processor for older runtimes. Fixes duckyshell#38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Fixes #38.
Problem: Direct GGUF passes a cancel
logits_processoron every request. In llama-cpp-python 0.3.48 this makes the sampler loop over the full vocabulary (~248K for Qwen) in Python for every token. Qwen3.8-27B decode ran at 7.7 tok/s in Writer against 26–28 tok/s in other nodes.Change: When the runtime has
Llama.abort()(0.3.37+), Writer passes no logits processor and cancels throughabort(). A small watcher keeps setting the abort flag until the call returns, because_create_completionclears it after MTMD media evaluation. Runtimes 0.3.34–0.3.36 keep the existing path.Tests:
test_frontend_regressionsfails locally only becausehappy-domis not installed; it fails the same way on unmodifiedmain.🤖 Generated with Claude Code