Notes from an independent NVFP4 port of Inkling on One RTX 5090

#24
by alexmv2025 - opened

What was converted. Inkling (952B total / 28B active, architecture
inkling_mm_model, text tower inkling) was adapted to the C++20/CUDA
Blackwell-only engine. The pure-BF16 checkpoint (108 safetensors shards) becomes
a 500 GB tree: the dense planes upload to a single RTX 5090 (~14.3 GiB
resident) and the 16 384 routed-expert records (256 experts × 64 MoE layers)
stay memory-mapped on the host and stream in per token. The vision (8 tensors),
audio (2) and MTP (160) towers are ballast — counted in the index, never applied.

This is a NEW family member, not a sibling of Inkling-2-Small. The base
release is a different architecture: no RoPE and no relative-bank clipping
(the bank is a plain learned bias over distance), attention scale 1/head_dim
with per-head RMS-normed q/k, static short convolutions conv(x)+x with no
normalizer, a plain residual (no depth-mixing block stack), 256 experts
top-6 + 2 shared-sink, a muP /24 head and no softcap. It shares the family
name and the tiktoken tokenizer (kind 2), nothing else.

Pure BF16 → standard NVFP4. Unlike the sibling (which carried the release's
own mixed NVFP4/MXFP8 precision verbatim), the base release is pure BF16, so
every dense and routed weight is requantized to NVFP4 (E2M1 nibbles, per-16
E4M3 block scales, per-tensor global scale amax/6). Norms, biases, the
relative bank, the short-conv taps, the router and embed/unembed stay high
precision. The requantization is faithful: the engine matches the release's own
modelling code (driven on the real weights, bf16, truncated layers) at every
layer 0–6 with cosine 0.999+
(relL2 3e-3…4.8e-2, the bf16-vs-fp32 rounding
floor). Knowledge sanity perplexity 3.84 (< log(100) = 4.6).

The two defects that cost the model its knowledge

Both were invisible to every byte-level check and were caught only by the
release modelling code driven on real weights — the same lesson the sibling
taught, recurring on a different release.

  1. The routed w13_weight is ROW-INTERLEAVED, not halves. The release
    conversion_mapping.py ("inkling_mm_model") applies Interleave(dim=1) to
    de-interleave [g0,u0,g1,u1,…] into [gate;up] before the forward chunks the
    output — exactly as it does for shared_w13_weight and the dense w13_dn.
    The converter (and both of my references, and my first HF oracle) split the
    slab in halves, pairing every gate row with the wrong up row. Every MoE layer
    diverged from the release forward (L2 relL2 jumped 7e-3 → 4e-2, L5/L6 cos
    0.86). The fix is TakeParityRows (gate = even rows, up = odd), pinned
    test-first by flipping the fixture's RoutedW13 to interleaved and the
    ROW PAIRING 3 assertion. After the fix the reference matches the release at
    every layer (cos 0.9998+).

  2. The base release's residual stream genuinely explodes — FP16 overflows at
    five points.
    The residual reaches 1.3e6 by layer 65 (1.9e5 at layer 8
    position 0). This is the model's own bf16 behaviour, not a defect: the fp32
    reference reproduces it and matches the release. But FP16 (max 65504)
    overflowed at: the residual stream itself, the residual-path short convs
    (~1.9e5), the expert/shared down GEMV (a shared expert reached ~9.6e5),
    and the wo attention-output projection (attn_o ~881 × wo at the deep
    layers). Each overflow produced NaN that propagated to the K cache and killed
    decoding. The fix carries the residual in FP32 end to end:
    RunNormF32, RunShortConvF32, RunExpertAccumulateF32 /
    RunSharedAccumulateF32, and ProjF32 for wo. Raw and framed prompts now
    decode at all lengths without NaN.

What the checkpoint forced into the engine

  • Rel-bank attention, no RoPE. Each token's relative state (r_proj, 16
    profiles) projects onto a learned bank spanning rel_extent backward
    distances (1024 full / 512 sliding) and gathers one bias per distance, zero
    beyond the extent. q/k are RMS-normed per head; scale is 1/head_dim.
  • Hybrid attention. 55 sliding layers (window 512, 16 kv heads) and 11 full
    layers (ids {5,11,…,65}, 8 kv heads, extent 1024). 64 q heads × 128, q_dim
    8192 ≠ hidden 6144.
  • Four static short convolutions per layer (conv(x)+x, k=4, no
    normalizer): on raw k, raw v, post-attention, post-MLP. The v conv output must
    be stored back to the KV cache (the first defect fixed: it was computed but
    never written, so the cache held the raw v projection).
  • MoE routing is sigmoid with a selection-only bias, joint renorm over the
    6 selected routed + 2 shared logits (logsigmoid, softmax, × route_scale 8 ×
    gate.global_scale). The router weight has 258 rows (256 routed + 2 shared);
    the bias covers only the 256 routed. Both stay high precision.
  • muP head: final hidden /24 before unembed, no softcap. eos 200006, no BOS.
  • Inline reasoning. The model emits <|content_thinking|> (200008) first,
    reasons, then <|content_text|> (200004) before the answer. SelfCheck uses
    answer_window=48 / selfcheck_max_gen=48; CODE uses
    answer_start_token_id=200004 to cut to the final answer; FSI/CODE/DET use
    max_new_tokens=1024 so the reasoning span completes.

Gates (real tree, kOff, one target at a time)

gate result
SelfCheck PASS ×3 bit-exact, framed Paris ("The capital of France is Paris.")
FSI 3/3 (template-derived golden, 1024 budget)
CODE 3/3 (template-derived, answer_start_token_id=200004)
DET 3/3 (deterministic)
tool round-trip PASS (get_weather{"city":"Paris"})
knowledge sanity perplexity 3.84

FSI/CODE/DET goldens are template-derived (the 952B source is not runnable
locally) and say so in source. The CODE-03 regex failure was an extraction
artifact, not a model defect: the model's answer was correct
(\b[0-9A-F]{4}\b), but the first-anchor extractor grabbed a reasoning bullet
((so [0-9A-F])); answer_start_token_id resolves it.

Perf

Read-bound, as the pre-engine estimate predicted (~0.5–1.5 t/s): 28B active of
952B, the per-token expert read dominates. Seeded 1.68 t/s (perf) / 1.66 t/s
(r3)
at the canonical 2048-token protocol, TTFT ~15.2 s, ~132 W on a 575 W
card (tests/perf/perf_baselines.json, Release harness). The card is barely
loaded — the wall is the per-token expert read, not compute. Re-measured clean
(GPU idle, no concurrent workload): 1.68 / 1.66 t/s, agreeing within ~1%.

BMH SelfCheck Model Standard

The full ingestion report — including the internal evidence, CTest gate targets (test_inkling_moe_base_*), end-to-end FP32 residual kernels, and the C++20/CUDA runtime — is available in the public repository:
• Full Ingestion Report: https://github.com/Alex7MV/logestix/blob/main/docs/model-reports/2026-11-18-Inkling.md
• Repository: https://github.com/Alex7MV/logestix

Sign up or log in to comment