Skip to content

fix(inkling): IDOT opt-in — the fast path is x86-only and not token-equivalent - #1080

Merged
JustVugg merged 1 commit into
devfrom
fix/inkling-idot-optin
Aug 18, 2026
Merged

fix(inkling): IDOT opt-in — the fast path is x86-only and not token-equivalent#1080
JustVugg merged 1 commit into
devfrom
fix/inkling-idot-optin

Conversation

@JustVugg

Copy link
Copy Markdown
Owner

Follow-through on #712's review finding (credit @kreuzzelg): inkling's IDOT fast path exists only under __AVX2__ and quantizes activations per 32-block, while the scalar route is byte-exact — so with the old on-by-default, the same model with the same settings produced different tokens on x86 vs ARM, and no measurement ever blessed that default.

Same class and same one-line fix as olmoe (#1044) and qwen36: IDOT=1 restores the fast path explicitly; the default is now the byte-exact route on every ISA.

Both call sites flipped (matmul_q, the dual variant). Build clean. Note this intentionally changes default behavior on x86 (exact-but-slower); users who had measured and accepted the int8 numerics opt back in with one env var.

A companion issue will track the structural gap this exposed: our tiny-oracle gates run on x86 only, so ARM-divergent paths are invisible to CI — ubuntu-24.04-arm runners can close that.

🤖 Generated with Claude Code

…quivalent

The int8-activation fast path exists only under __AVX2__ and quantizes
activations per 32-block; the scalar route is byte-exact. With the old
on-by-default, the same model with the same settings produced different
tokens on x86 vs ARM, and no measurement ever blessed that default.
Same class and same one-line fix as olmoe (#1044) and qwen36 (#712
review, kreuzzelg's finding). IDOT=1 restores the fast path explicitly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JustVugg
JustVugg merged commit 62b8d63 into dev Aug 18, 2026
20 checks passed
BColsey pushed a commit to BColsey/colibri that referenced this pull request Aug 18, 2026
…gg#1081)

Every tiny-oracle job ran on x86, so NEON branches were never compiled,
let alone executed — which is how the olmoe (JustVugg#1044) / qwen36 (JustVugg#712
review) / inkling (JustVugg#1080) IDOT class shipped undetected.

Two additions:

1. tests/test_int_kernel_exact.c — integer kernels have no rounding
   excuse: against a pure-C reference on the same inputs they must match
   bit for bit on every ISA. Covers dot_i4i8 (pair int4xint8),
   planarize_i4 round-trip, dot_i4p_u (K1 plane layout, the -8*sum(x)
   identity), and matmul_i4p_idot vs matmul_i4_idot bitwise. The test
   encodes the real activation contract: qrow_i8 clamps to [-127,127],
   and -128 must never reach the kernels (the abs/sign VNNI trick cannot
   represent its negation) — the first draft generated full-range int8
   and produced 30 false failures against the SHIPPED kernel, which is
   the contract documenting itself.

2. An ubuntu-24.04-arm job (timeout-bounded per JustVugg#953's direction):
   builds every engine (NEON compile coverage — K1's dot_i4p_u NEON
   branch had never been compiled by anyone), runs the exactness gate
   with the NEON branches live, and replays the glm_tiny teacher-forcing
   oracle against a fixture generated on the same runner (same-machine
   torch reference, no cross-ISA float excuses).

The x86 efficiency job also runs the exactness gate, so both ISAs hold
the same bar. deepseek-v4 tiny-check on ARM is follow-up (its ARCH
plumbing needs checking for aarch64 first).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JustVugg
JustVugg deleted the fix/inkling-idot-optin branch August 20, 2026 00:57
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