Repository navigation
qwen27 Metal (M1-M4): projections no longer barrier internally, and XS sums compile out before tensor units (#2900) - #2913
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/q27-pre-m5-barriers
branch
from
November 12, 2026 14:28
de936aa to
4081fa5
Compare
8 tasks done
ashhart
force-pushed
the
lead/q27-pre-m5-barriers
branch
from
November 14, 2026 03:25
4081fa5 to
18fa85f
Compare
ashhart
force-pushed
the
lead/q27-pre-m5-barriers
branch
from
November 15, 2026 11:12
18fa85f to
57a9a5d
Compare
ashhart
added a commit
that referenced
this pull request
Nov 17, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 17, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 17, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 18, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 18, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 19, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 19, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 19, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 20, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 20, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 20, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 21, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 23, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 23, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 23, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 23, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 23, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
ashhart
added a commit
that referenced
this pull request
Nov 23, 2026
…and argmax Four glue kernels for Qwen27 rounds, each bit-identical to the kernel it replaces, with TensorFold's own kept wherever a round does not fit them. - tf_delta_gdn_columns_1/2/4 replace tf_delta_gdn_tree_slots_* for lone trees of up to 4 live states, reading the slot schedule as flow words (tree_slots.flows, a new frame field). - tf_delta_gdn_pre_vectors replaces tf_delta_gdn_pre for four taps over 128-wide heads with bf16 conv, A_log and dt. - q27_mlp_rows replaces custom_kernel_q27_mlp_xs where 256 threads run. - tf_round_pick_chunks/rows replace tf_round_bf16_argmax for Qwen27's two callers through Ops.argmaxChunks; other families keep Ops.argmax. - TF_Q27_FLAT_GLUE=0 at load, or decode_round.setFlatGlue, keeps every round on TensorFold's kernels. - tf-qwen27-glue-ab: the general glue against the flat kernels. Checked on an M5 Max, alone on 1.2.2: glue-ab equal over 1,204 rounds; golden, streams, marks, reuse, lanes and served replies equal; a 16-row verify 3.2% to 4.2% faster. Rebased here with one conflict (main's routed block fields in gpu_frame.zig) and checked stacked on qk: golden 1024 of 1024. On main d2b3722 (#2913: XS sums compile out before tensor units), q27_mlp_rows writes XS only under Q27_XS and its key carries main's .xs, so M1-M4 keep the flat activation without sums; main's norm and MLP test now runs with the flat glue off and on.
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.
Fixes #2900.
On Apple GPUs without tensor units (M1-M4), each 4-bit projection in
zig/src/families/qwen27/quant_gpu.zigended with its own barrier, although every caller already barriers after its projections. So pairs written to overlap (qwithkv,qkvwithzba) ran one after the other. Before tensor units, the norm and MLP kernels also wrote group sums (XS) that nothing reads.quantno longer barriers internally; the caller orders the output (doc comment says so). The callers' existing barriers stay.device.tensorUnits(). WithQ27_XS=0(before tensor units) the sum tails and the padded-row zero-fill compile out, and the grids hold only live rows. M5 builds are unchanged.Exact by construction: the paired projections write disjoint buffers from a shared input, and the omitted sums have no reader before tensor units.
Tests: recording-encoder tests check the real encoder's bindings and barriers for raw 4/8-bit, group 32/64, both projection pairs, rows 1/8/128/129 and mixed strided members. They also check the norm/MLP defines, grid heights and cache keys for both chip kinds. Three runtime comparisons fail against unchanged main and pass here. qwen27 host: 597/598 (1 skipped). The emitted Metal libraries compile.
Not yet checked on a device: served greedy and seeded replies byte-equal on an M3 Ultra, and the M3 Ultra A/B (expected +0.5-1.2% decode). It lands after those.