deepseek-v2-lite: registry + adapter scaffolding (argmax-match deferred) - #28
Merged
Conversation
Adds the central-registry row for DeepSeek-V2-Lite (27L/2048D/16H, 64 routed
experts, top-6, kv_lora_rank=512, qk_head_dim=192 with partial RoPE), the
deepseek package __init__, a tokenizer-family entry for DeepSeek's full-width
BOS/EOS sentinels, and a DeepSeek.from_spec factory that parses config.json
into Config and raises NotImplementedError with a pointer to the SPEC blockers
still required for argmax-match (RoPE interleave validation, untied LM head,
first_k_dense_replace=1 dense-MLP packing into the shared-expert slot,
MoE router sigmoid-then-top-k, safetensors->packed-numpy loader).
sk.load("deepseek-v2-lite") now reaches Config construction cleanly and exits
with a documented blocker list; the registry + tokenizer plumbing is mergeable
ahead of the kernel/loader fixes.
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
sk.load(\"deepseek-v2-lite\")through the central registry to a DeepSeek adapterfrom_specthat parses HFconfig.jsonintoConfig(27 layers, 2048 d_model, 16 heads, 64 routed + 2 shared experts, top-6, kv_lora_rank=512, partial-RoPE qk_head_dim=192).deepseektokenizer-family entry (<|begin▁of▁sentence|>/<|end▁of▁sentence|>) and themodels/deepseek/__init__.pypackage export.from_specfactory builds theConfigthen raisesNotImplementedErrorwith a pointer to the SPEC blockers; argmax-match against HF is not yet achieved.Honest status vs the original brief
Landed
__init__.py+ tokenizer family +Configparsing from HFconfig.json(including YaRNrope_scaling.{factor, mscale_all_dim, original_max_position_embeddings}).sk.load(\"deepseek-v2-lite\")reachesConfigconstruction cleanly and exits with a documented blocker list.Deferred (in priority order, all tracked in
SuperKittens/models/deepseek/SPEC.md)The SPEC port-status table lists 14 ✅ / 4 ⚠ needs-fix / 11 ❌ missing. For V2-Lite argmax-match the remaining items are:
sk_deepseek_load_weightstakes flat host pointers for every weight in_WEIGHT_FIELDS; the in-tree C++ loader (weights.c++) uses GGUF tensor names (blk.L.attn_q_a.weight) that V2-Lite's safetensors do not ship with. The minimal path is a Python streamer that materialises packed bf16→fp16 arrays frommodel.safetensors.index.json.first_k_dense_replace=1dense-MLP layer-0 packing. Layer 0 uses a plain MLP withintermediate_size=10944, notshared_n_int=2816. The shared-expert slot needs a per-layer width or a separate L=0 buffer.dispatch_attnalready has therope_interleavebranch and arope_interleave_f32PSO is bound; needs numerical validation vs HF'sapply_rotary_pos_emb_interleave.moe_router_v3PSO): needs validation that V2-Lite'stopk_method=\"greedy\"path (no bias, no group restriction, no norm_topk_prob) is correctly handled at runtime.tie_word_embeddings=False. The dispatch already falls back tow_embedifw_lm_headis null — a dedicatedw_lm_headload path is required.Download
DeepSeek-V2-Lite weights were started downloading on derek (
~/SuperKittens/SuperKittens/model_weights/DeepSeek-V2-Lite) under tmux sessiondsdl. Progress at PR-open time: ~8.5 GB / ~31 GB.Test plan
python3 -c \"from SuperKittens.inference.registry import get_spec; print(get_spec('deepseek-v2-lite'))\"succeedspython3 -c \"import SuperKittens as sk; sk.load('deepseek-v2-lite')\"raisesNotImplementedErrorwith the documented blocker list (not an import or attribute error)[5, 100, 200, 300, 400]matches HF transformers' top-1m.chat(\"Hi\")produces a coherent first tokenWhy ship this as-is
The original 6-hour wall-clock plan called for landing 5 commits including the weight loader, kernel fixes (RoPE interleave wiring, dense-MLP layer-0 branch, MoE router sigmoid path, untied LM head), and end-to-end validation on derek. The weight download alone is ~31 GB at a ~50 MB/s ceiling and the kernel/loader bisection is multi-day work. Per the brief's hard-stop guidance, this PR ships the parts that are clean and mergeable today — the registry surface, the Config parsing, the tokenizer family entry — so the next PR can focus entirely on the loader + kernel bring-up without re-litigating the Python plumbing.
🤖 Generated with Claude Code