Skip to content

test(inkling): P1 tiny parity against a golden from mlx-lm #2086 (#650) - #754

Merged
goodmai merged 1 commit into
mainfrom
test/inkling-p1-parity
Nov 23, 2026
Merged

goodmai merged 1 commit into
mainfrom
test/inkling-p1-parity

Conversation

@goodmai

@goodmai goodmai commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Adds the P1 "Tiny parity (#228)" gate from #650: basalt's Inkling 2 against the reference implementation in ml-explore/mlx-lm#2086, on the same weights.

How the golden was made

  1. TinyModel.make(.inkling2Loop) (seed 650) was saved with MLX.save as config.json + model.safetensors.
  2. That directory was loaded with strict=True into mlx-lm #2086, pinned at jundot/mlx-lm@e2b5bbd3bd. All 173 parameter names match. Two adjustments were needed:
    • the three *.query vectors were reshaped from (1, d) to (d,);
    • the config gained swa_num_attention_heads, swa_num_key_value_heads and swa_head_dim, equal to the global values. #2086 requires them; basalt ignores them, and the real config sets them equal anyway.
  3. #2086 then produced the golden in Fixtures/Inkling2/mlxlm2086_tiny_golden.json from 40 fixed tokens:
    • the argmax at every position;
    • full logits at positions 0, 19 and 39;
    • 16 greedy tokens decoded through its prompt cache.

Before writing the golden, the full logits were compared directly: max |Δ| 5.4e-6, mean 5.6e-7, argmax equal at 40/40.

Test

InklingReferenceParityTests:

  • the argmax matches exactly and logits are within 1e-3;
  • the 16 greedy tokens match exactly through basalt's caches, covering the window cache past its 8-token window and the 3-pass loop.

2/2 pass. Strict build, comment and size gates are clean.

Not covered

Part of #650.

🤖 Generated with Claude Code

https://claude.ai/code/session_012cicguZMN3jhNGmf5327oh

…gmax at 40 positions, logits within 1e-3, 16 greedy tokens through the caches (#650)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012cicguZMN3jhNGmf5327oh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant