Repository navigation
feat: the model's draft head as the guesser, on the CPU, on the device and in the server - #34
Merged
Merged
Conversation
…ds the model's intermediate values
…serve uses the model's draft head
…n its plumbing; two regenerated
…omment is marked as text
… are undone before the drafter is told; an engine that asks for no guesses does not keep a drafter in step; review fixes
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.
What
The model's own draft head as the guesser, on the CPU and on the device, and wired into the server. Inkling 2 Mini on the GB10, same prompt, same text: 28.1 tokens per second without guesses, 33.5 with the head proposing 2 a sweep.
Drafteris generic over the model's values and has two new methods with defaults:wants(after how many layer applications the running sum is wanted) andfed(told after every batch what was kept).Inkling::tapkeeps the wanted values per batch. A drafter that only reads the text is unchanged.dluth-model/src/inkling/mtp.rs: the head on the CPU in 32-bit floats, the reference for the device.dluth-cuda/src/draft_head.rsandkernels/draft_head.cu: the head on the device.dluth-cuda serveloads the head when the checkpoint has one and proposes 2 a sweep.--head offand--guesseschange that. A head that cannot be read is done without, with the reason printed.examples/generate.rs head [most]measures it. Learning note 25; README updated.How the head's weights are used was worked out from the public papers (arXiv 2606.02091, arXiv 2607.05147) and from measurements on the checkpoint. Three points of that reading are still open and are each worth a few percent of right guesses; the note names them. A wrong reading cannot change the text: a guess is only kept when it is the model's own choice.
Measured
GB10, 199 tokens after the first, greedy:
Through the server, 300 new tokens: an explanation 33.3, a Rust function with tests 39.1, the explanation with drawn tokens at temperature 1, 30.4.
How it was checked
Review
Changes requested. Fixed:
--head offdid not help when the head's description could not be read. A head that is off is now not looked at.Declined: