Repository navigation
Conversation
Reads Inkling 2 Small's config.json into the shapes the engine needs and refuses by key every layout it does not run: the layer types, the fixed switches, the quantization, the draft head and the vision tower. Fixtures are the release's config.json and the tiny-random checkpoint's. The host step is test-inkling2-host.
Reads a safetensors header into entries of name, dtype and shape, sorted by name, for the dtypes this family stores: BF16, F32, F8_E4M3 and U8. A dtype it does not store, a rank past four, a length past the file and bad JSON are each refused.
The map names every tensor a config implies, backbone, vision tower and draft head, with its dtype and shape, and checks a safetensors header against it: missing, wrong and unknown tensors are reported by name. A layer's expert format is read from its tensors, U8 for NVFP4 and F8 for MXFP8. The plan derives sliding and global layers, the block boundaries and the number of states each attention-residual input sums over. The draft head's rnn_proj sizes and fuse_weight's columns are read from two headers, tiny-random/inkling-2 and the release, not from code; fuse_weight's six rows stay open. The fixtures fold the two header tables of tiny-random/inkling-2 with their sha256. Real headers are checked when TF_INKLING2_TINY names tiny-random's two files, and when TF_INKLING2_REAL names the release's 24 shard headers and mtp.safetensors.
Image parts (image, input_image, image_url) and --vision are refused with their own words until the vision tower has kernels; audio and unknown part types are refused too, and text parts, plain strings and string parts pass. A part without a type is read as text, as the chat template reads it. Nothing calls these checks yet: there is no host.
The release's chat template renders 24 chat cases byte for byte, thinking effort names and numbers included, and raises for an unknown effort or one out of range. The tokenizer encodes the rendered prompts and 6 plain texts to the reference's ids and decodes them back when TF_INKLING2_CKPT names the release's tokenizer.json. A cut tokenizer.json (its added tokens, its byte alphabet and the first 1,500 merges, same split regex) runs on every build against 14 cases, with a control that another split regex changes its ids. The expected prompts and ids come from the transformers and tokenizers libraries.
inkling2_fixtures.py writes the files under zig/src/families/inkling2/ fixtures from the release's files and the tiny-random checkpoint's safetensors headers: the prompt and id cases through transformers, the cut tokenizer and its cases through tokenizers, and the folded tensor tables with their sha256. The library versions are pinned and checked; --check compares the committed files without writing.
The notice for the files taken from the Inkling 2 Small release and from the tiny-random checkpoint.
refusal.zig and its test have no caller: the server that would call them is not in this slice. They move to the slice that adds the host. The step description and the package's test list no longer name them.
The AutoTokenizer.from_pretrained call in inkling2_fixtures.py takes local_files_only=True, so a mistyped --release fails instead of reaching the hub.
names.check and names.precisions take core/safetensors.zig's Header, read with its headerSize and parseHeader, in place of the family's own parser and dtype enum. header.zig and its test are gone, and the host test module imports the core reader. names.merge joins the headers of a checkpoint's files and refuses a name held twice.
…he K loop Each thread's input, weight and scale/bias cp.async addresses are set up once; a stage only adds its group offset. The copies, their order and their shared-memory bytes are unchanged, so outputs stay bit-equal to prefill_kernel. Co-authored-by: terrapinelf <166810331+terrapinelf@users.noreply.github.com>
C4 of #2444: a store that declares tails cuts at any row its request schedule allows, and a keep off a page edge holds one copy of the partial page per prefix group, made by copy_rows and never written again; a later prompt that repeats those rows, their lookahead, images and namespace resumes there and copies the page into its own. Tails count in the page limits, reclaim and eviction like parts, and a store without them keeps every mark, hit and eviction of P2.2.
A resume at a tail takes its private page from the stream's promise, trims it back on failure, and leaves the store's copy unwritten; an idle tail is reclaimed before a page a stream still maps, so the pool's census stays exact across the tail's whole life.
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.
CI for a landing train: #3578 #2825 #3329 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.