Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b160bcd
DeepSeek V4.1 Flash: configuration, Engram tables and resident weight…
akol1 Oct 13, 2026
c53616f
DeepSeek V4.1 Flash: Metal operators with fp64-dot references and the…
akol1 Oct 13, 2026
4e68261
THIRD_PARTY_NOTICES: the native DS4.1 reference follows DeepSeek-V4.1…
akol1 Oct 13, 2026
74b7541
DeepSeek V4.1 load: the router gate and bias ride the pack's dtypes
akol1 Oct 13, 2026
86b6eec
DeepSeek V4.1 load: the Engram gate weights ride f32 or bf16
akol1 Oct 13, 2026
611a130
DeepSeek V4.1: the kept-dense EXL3 form, for rank-split repacks
akol1 Oct 13, 2026
d20aea6
DeepSeek V4.1 reference: the kept-dense apply
akol1 Oct 13, 2026
c349413
DeepSeek V4.1: the rebase residue — one counters binding, the state-w…
akol1 Oct 14, 2026
6ad76e1
mHC fp64 ideal reference: the mix at rounding level, 1-ULP noise atte…
akol1 Oct 14, 2026
943d93f
CSA2 reference: FP64-ideal parameterization of the pool, RMS and spar…
akol1 Oct 14, 2026
1cf442a
csa2: FP64 stage harness, compressor pool + RMS, six adversarial inpu…
akol1 Oct 14, 2026
630f5d2
csa2: FP64 stage harness over the sparse attention kernel, with kerne…
akol1 Oct 14, 2026
0be1833
csa2: indexer stage harness — FP32/FP64 score comparison and top-k se…
akol1 Oct 14, 2026
2e56ff2
csa2: indexer stage receipts — carry the BF16 einsum/score boundaries…
akol1 Oct 14, 2026
79e59ac
csa2: sparse stage reads its own FP32 rounding level before the BF16 …
akol1 Oct 14, 2026
bba3e7d
csa2: per-stage harnesses for sinks, tile denominators, output mix an…
akol1 Oct 14, 2026
5c27e3d
csa2: measure how much score noise the top-k selection absorbs
akol1 Oct 14, 2026
2f9e506
The fp64 harness ports: dedupe the shared math helpers, fix the shard…
akol1 Oct 14, 2026
ffc7028
The oracle records the indexer's selection margins while it teaches
akol1 Oct 14, 2026
6e2a7ce
The indexer-margin capture at depth: one diagnostic token's selection…
akol1 Oct 14, 2026
f5c483e
the operator harnesses through zig fmt
akol1 Oct 14, 2026
8f63e8d
DeepSeek V4.1: the sparse output accumulates each 64-column tile in c…
akol1 Oct 14, 2026
8bfdf68
The dense EXL3 apply accumulates its dot as a hi/lo FP32 pair
akol1 Oct 15, 2026
efed9c1
DeepSeek V4.1: the token map ships its table generator and its unit t…
akol1 Oct 18, 2026
ec57308
DeepSeek V4.1: the family's comments on one line each, within the 120…
akol1 Oct 18, 2026
43b4ee8
DeepSeek V4.1 reference: the operator harnesses split at their seams
akol1 Oct 18, 2026
28f8dc7
DeepSeek V4.1: the reference and Metal comments on one line each
akol1 Oct 18, 2026
a9badee
DeepSeek V4.1 reference: fp64 tests for the Engram hash, gather and gate
akol1 Oct 19, 2026
32dc75a
DeepSeek V4.1 reference: hold the Engram gate to the registered kerne…
akol1 Oct 19, 2026
46a2fb3
DeepSeek V4.1 reference: the index tie fixture broadcasts row 0 into …
akol1 Oct 21, 2026
2485c13
test(contract): DeepSeek V4.1 sparse attention through the Metal kern…
akol1 Oct 21, 2026
14db390
Pass the span metadata the counter recorder now requires
akol1 Oct 21, 2026
e740bf0
Rebase the precision line onto 1.1.2
akol1 Oct 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
The dense EXL3 apply accumulates its dot as a hi/lo FP32 pair
The reference chain sums the dense-kept dot sequentially in FP64; the kernel's plain
FP32 loop crossed BF16 rounding boundaries on real rows. The 2.8bpw whole-model error
drops 5.163% to 5.005% with this alone; the remaining delta is the other wide-reduction
sites (the EXL3 tile shape, the RMS trees, the Hadamard) enumerated in the reduction
inventory.
  • Loading branch information
akol1 committed Oct 21, 2026
commit 8bfdf68cc96b9ef43abc0a83a4db3b5103ace94b
14 changes: 10 additions & 4 deletions zig/kernels/metal/core/exl3_projection.metal
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,16 @@ kernel void tf_exl3_dense(const device half* rotated [[buffer(0)]],
const device uint* input_ids [[buffer(4)]],
uint2 g [[thread_position_in_grid]]) {
const uint row = a.input_ids ? input_ids[g.y] : g.y;
float acc = 0;
for (uint k = 0; k < a.k; ++k)
acc += float(rotated[ulong(g.y) * a.k + k]) * float(weight[ulong(g.x) * a.k + k]);
sums[ulong(g.y) * a.n + g.x] = acc;
// The reference accumulates this dot in FP64 sequentially; a hi/lo pair carries the
// same exactness through FP32 (the products of half and bf16 values are exact here).
float hi = 0, lo = 0;
for (uint k = 0; k < a.k; ++k) {
float prod = float(rotated[ulong(g.y) * a.k + k]) * float(weight[ulong(g.x) * a.k + k]);
float t = hi + prod;
lo += (hi - t) + prod;
hi = t;
}
sums[ulong(g.y) * a.n + g.x] = hi + lo;
}

// Four SIMDgroups share decoded weights while each retains its original eight-row compensated dots.
Expand Down