Skip to content

feat(gemma4): the dense 31B layout and oQ per-layer mixed widths on the Mac decode kernels - #360

Closed
gilby wants to merge 2 commits into
ashhart:mainfrom
gilby:gemma4-dense
Closed

gilby wants to merge 2 commits into
ashhart:mainfrom
gilby:gemma4-dense

Conversation

@gilby

@gilby gilby commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

RowDecode serves Gemma 4 checkpoints without a MoE block (the 31B dense) with attn_tail, the GeGLU MLP and a new
dense_tail kernel, and decode projections read every MLX affine width the row kernels read (2-8 bits, groups of
32/64/128): the 4-bit row matvec, affine_rows for other widths, and the lane matmul where it reads the width. A stack
of mixed widths (oQ overrides on q/k/v or gate/up) runs one matmul per run of equal widths; every kernel is
row-invariant, so windows, concurrent rounds and one-row steps keep the same bits. The router reads any width; experts
stay 4-bit, and check() names any width, group or mode no kernel reads. A uniform 4-bit checkpoint keeps its kernels
and its bits. Packs that bundle an MTP assistant load with those tensors dropped (the family drafts with --drafter). Part of #322.

Second commit: per-shape matrix kernels before M5. On M1–M4, Gemma 4's decode projections ran every row of a DFlash
verify window, and every stream of a --parallel round, through the 4-bit row matvec or affine_rows, so each row
re-read the weights. Following the #154 rule, each projection now picks its kernel once at load, from its width,
group and shape (bits, group, N, K), never from the row count
:

  • the simdgroup matrix kernels the Qwen dense family already uses: simd_qmm for 4-bit groups of 32/64, and
    simd_qmm_bits for 4/5/6/8-bit groups of 64/128. simd_qmm_bits now reads 4-bit codes too, so 4-bit groups of
    128 load their scales as stored;
  • or the row kernels as before, where matrix does not win.

Every 5/6/8-bit and 4-bit g128 linear takes the matrix kernels; 4-bit g32/g64 takes them from 2²² weights. In
practice every attention, MLP and head linear of the 26B-A4B and 31B qualifies, and only a 4-bit 128-wide router stays
on the row matvec. The experts and the 8-bit router kernel are unchanged. The matrix kernels' one-row scalar twins are
checked bit-equal to the MMA kernel per weight at load, as simd_qmm_backend already does, and a weight whose twin
differs runs the MMA kernel at every count, so windows, concurrent rounds and one-row steps keep one set of bits for
each linear. M5 is unchanged: it keeps rows, or lane with --lane-kernels on. TF_GEMMA_DENSE=rows|matrix|auto
overrides the choice, for A/B measurement only. The only shared file touched is simd_qmm_bits.py (a 4-bit case in
LW and a new reads()); fits(), which simd_qmm_backend routes on, is unchanged, so Qwen's routing and bits do
not change.

The bits change on M1–M4 for the projections that move: the matrix kernels sum in a different order than the row
kernels. The new bits are closer to the fp32 product (below).

Receipt

  • Environment, with the TensorFold commit, MLX or PyTorch version, machine and GPU, checkpoint and revision: this
    branch (0.6.4 + this change) against 0.6.4 (6ea5ade), MLX 0.32.3, M5 Ultra 256 GB. Checkpoints:
    mlx-community/gemma-4-26b-a4b-it-4bit @ 0d77464 with z-lab/gemma-4-26B-A4B-it-DFlash @ 77d4202 (--drafter-bits 8); unigilby/gemma-4-31B-it-qat-oQ8e (uniform 8-bit, groups of 64; local copy of the upload) with a 31B DFlash
    drafter (target_layer_ids 1, 12, 23, 35, 46, 57) at --drafter-bits 8 --lane-kernels on;
    unigilby/gemma-4-26B-A4B-it-qat-oQ4e (4-bit base, q/k/v and gate/up promoted to one width a layer, experts 4-bit);
    and the public mixed-stack packs bambocher/gemma-4-26B-A4B-it-qat-oQ4e-mtp @ b1b7261 (4-bit g64, 56 per-layer
    overrides) and bambocher/gemma-4-31B-it-qat-oQ4e-mtp @ 23d3b9d (4-bit g64, 63 overrides). Servers: --parallel 4 --no-thinking --context 70000 --snapshot-dir none (8192 for the
    exactness-only runs).

  • Exactness, from tools/bench_concurrent.py --alone --serial or token_sha against "draft": false:

    • 26B-A4B 4-bit (the checkpoint 0.6.4 serves): --levels 1,2,4 --alone --serial, T=1.0 and T=0, 3 reps: 0 failed,
      every stream equal to its solo run (3/3, 6/6, 12/12) and to "draft": false. Every bench_openai reply (24 a
      run, greedy and sampled) has the same token_sha on 0.6.4 and on this branch in all four runs: the bits are
      unchanged for this checkpoint.
    • 31B dense oQ8e: --levels 1,2,4 --alone --serial, T=1.0 and T=0: 0 failed, every cell 3/3, 6/6, 12/12 alone and
      4/4 (T=1.0), 1/1 (T=0) against "draft": false. Startup: windows of up to 16 rows reproduce one-row steps.
    • 26B-A4B oQ4e: --levels 2 --alone --serial: 6/6 alone, 2/2 (T=1.0) and 1/1 (T=0) against "draft": false, in
      both prompts.
    • The two bambocher packs (0.6.4 refuses both: "Gemma 4's kernels read 4-bit projections with an 8-bit router"):
      both load, windows of up to 16 rows reproduce one-row steps (rows backend for the 26B, lane for the 31B), and
      --levels 2 --alone --serial gives 0 failed, 6/6 alone in every cell, 2/2 (T=1.0) and 1/1 (T=0) against
      "draft": false, code and chat.
  • Decode speed before and after, from tools/bench_openai.py (26B-A4B 4-bit with DFlash, medians of 5, before / after
    / after / before):

    prompt T 0.6.4 this branch this branch 0.6.4
    fibonacci-raw 1.0 273.1 275.6 267.5 273.1
    gpu-chat-no-think 1.0 248.0 219.0 226.8 244.5
    fibonacci-raw 0 379.9 417.8 388.9 380.3
    gpu-chat-no-think 0 248.8 249.9 245.0 250.9

    The replies are token-identical across all four runs (above), so the T=1.0 chat gap is timing spread on the same work
    (its five samples range 199-264 tok/s in every run). 31B dense oQ8e (before: refused, "this one lacks a MoE block in
    every layer"): fibonacci-raw 40.3 tok/s at T=1.0, 65.2 at T=0; gpu-chat-no-think 31.8 and 33.5; bench_concurrent
    aggregates at N=1/2/4, T=0: code 137.4 / 166.9 / 168.7, chat 33.1 / 55.1 / 90.0.

  • Prompt speed before and after, from tools/prefill_cold.py (26B-A4B 4-bit, medians of 3, tok/s, same order):

    length 0.6.4 this branch this branch 0.6.4
    2K 8,387 8,411 8,140 8,418
    8K 8,271 8,286 8,236 8,272
    16K 7,749 7,728 7,549 7,732
    32K 6,731 6,777 6,531 6,725
    64K 5,105 5,165 5,274 5,183

    31B dense oQ8e (before: refused): 2K 1,302, 8K 1,287, 16K 1,232, 32K 1,129, 64K 917 tok/s.

  • On v0.6.5: this branch rebased onto v0.6.5 (609ca41) as 76c83c3. Mac host suite (M5 Ultra): 5065 passed, 1 failed, 596 skipped; the one failure, test_glm5_prompt_kernels::test_fused_index_scores_are_the_three_ops, fails on v0.6.5 too.

  • Tests run, with pass, fail and skip counts: Mac host suite on this branch: 4757 passed, 1 failed, 595 skipped (the failure, test_glm5_prompt_kernels::test_fused_index_scores_are_the_three_ops, fails on 0.6.4 too).
    tests/test_gemma4_family.py and tests/test_gemma4_kernels.py (changed) on 0.6.4's source: 65 failed, 39 passed
    (the dense and oQ-mixed cases); on this branch they pass; without MLX: 2 skipped.

  • M3 Ultra (no tensor units, so the rows backend), v0.6.5 vs this branch, MLX 0.32.3, mlx-lm 0.32.0, unigilby/gemma-4-31B-it-qat-oQ8e with the 31B DFlash drafter at --drafter-bits 8: v0.6.5 refuses at load ("TensorFold's Gemma 4 kernels cover the MoE checkpoints (mlx-community/gemma-4-26b-a4b-it-4bit); this one lacks a MoE block in every layer"). This branch serves it:
    token_sha drafted == "draft": false == d5a9c199f3c0; resumed == fresh: the same 7,343-token prompt twice on one
    server (greedy), the second served 7,340 tokens from the prompt cache, token_sha b12aba8cd79a both times; at
    --parallel 4, --levels 2,4 --alone --serial 0 failed and 0 unequal in all 8 cells. tools/bench_openai.py --tokens 256 --reps 5, medians, tok/s: fibonacci-raw greedy 59.9, sampled 41.9; gpu-chat greedy 27.0, sampled 28.3. N=2 / N=4 greedy aggregate: code 64.5 / 65.5, chat 38.7 / 41.3.

  • Checked on v0.6.5 (2026-10-04), M5 Ultra: tools/prefill_cold.py (2k / 8k / 16k, 3 reps, median tok/s, alternated with v0.6.5, two runs each) on mlx-community/gemma-4-26b-a4b-it-4bit, which v0.6.5 serves: v0.6.5 8,366 / 8,493 / 8,082 and 8,400 / 8,525 / 8,107; this branch 8,349 / 8,489 / 8,077 and 8,359 / 8,511 / 8,097.

  • Not run, and why: M1, M2 and M4 (no hardware). CUDA: not touched.

Receipt for the second commit (per-shape matrix kernels before M5)

  • Environment: MLX 0.32.3, Mac Studio M3 Ultra (no tensor units). Checkpoints: a TensorFold-shaped oQ4e of
    google/gemma-4-31B-it-qat-q4_0-unquantized (4-bit g64 base with 5/6-bit promotions, not on the Hub) with the 31B
    DFlash drafter, and unigilby/gemma-4-26B-A4B-it-qat-oQ4e with z-lab/gemma-4-26B-A4B-it-DFlash, --drafter-bits 8.
    The served A/B ran the same commit on another 0.6.5-based tree; the diff applies to this branch unchanged, and the
    test counts below are on this branch.

  • Served decode, from tools/bench_openai.py (256 tokens, 3 reps) and tools/bench_concurrent.py --levels 4, rows
    (before) vs auto (after). Arms ran before / after / after / before, each on a fresh server with --parallel 4 --context 65536; the two runs of each arm agree within about 2%. tok/s:

    31B oQ4e before 31B oQ4e after 26B-A4B oQ4e before 26B-A4B oQ4e after
    chat, 1 stream, DFlash, T=1 / T=0 36.7 / 37.9 40.5 / 40.5 127 / 130 139 / 132
    chat, 4 streams aggregate, DFlash, T=1 / T=0 45.8 / 45.5 77.5 / 82.6 172 / 174 214 / 201
    chat, 1 stream, --no-drafts, T=1 / T=0 28.6 / 28.8 28.0 / 28.1 121 / 123 119 / 121
    chat, 4 streams aggregate, --no-drafts 57.3 / 58.2 70.2 / 70.0 209 / 215 210 / 221
  • Window costs at load, 31B oQ4e, from the server's own exactness check (ms by rows): before 1 → 33.7, 4 → 54.2,
    8 → 94.4, 16 → 172.1, shared 32 → 355, 64 → 673; after 1 → 34.5, 4 → 42.7, 8 → 42.8, 16 → 65.2, shared 32 → 139,
    64 → 239.

  • ⚠️ Drafter acceptance on the tools' raw-completion "code" prompt: it is a completion with no chat template into an
    instruct model, and both arms emit degenerate text. On the 26B the changed bits turn "- - - …", which the drafter
    predicts (227/236 accepted), into "-----…", which it doesn't (0–3/571), so single-stream "code" drops from 300 to
    72 tok/s at T=0 although each round is cheaper (15 vs 18–26 ms). On the 31B "code" goes up (1 stream 57.8 → 59.7,
    4 streams 69.5 → 121.1). The chat rows above are the meaningful ones.

  • fp32-referenced quality: relative RMS error of each projection against x·Wᵀ in fp32 with the dequantized weights,
    on the activations a real 16-row window feeds it, mean / max over all projections:

    checkpoint rows matrix
    31B oQ4e (4-bit g64 + 5/6-bit) 0.39% / 1.43% 0.18% / 0.29%
    31B uniform 8-bit g64 (oQ8e layout) 0.19% / 0.32% 0.19% / 0.32%
    unigilby/gemma-4-26B-A4B-it-qat-oQ4e 0.43% / 1.25% 0.19% / 0.29%

    No projection is less accurate on matrix. 31B teacher-forced logits against mlx_lm's forward: top-1 identical, KL
    ≤ 0.007 on both backends.

  • Exactness after: bench_concurrent --levels 1,2,4 --alone --serial, code and chat at T=1 and T=0 on both models:
    0 failed, every stream equal to its run alone (2/2, 4/4, 8/8) and to "draft": false.

  • Tests on the M3 Ultra: tests/test_gemma4_matrix.py (new: every width and group, each row count 1..16 gives the
    one-row bits, stable run to run, within 1% of fp32 and no worse than rows, auto fixes one kernel a linear, mixed
    stacks) does not import on the first commit; test_gemma4_family.py and test_gemma4_kernels.py now run every case
    on rows, matrix and auto, and their new cases fail on the first commit (76 failed). On this branch the gemma4
    and simd_qmm suites give 284 passed and 47 skipped (the lane cases, which need M5). Host suite: 4777 passed, 958
    skipped, 6 failed; the 6 are tests/control/test_cli.py / test_pty.py, which need a terminal and fail the same way
    on the first commit.

  • M5 Ultra sanity (default stays rows): on the M5 Ultra the family's default resolves to rows (and lane with --lane-kernels on) before and after this commit. Tiny Gemma 4 models (MoE and dense, uniform and oQ-mixed) on both backends: logits of windows of 1..16 rows after 20- and 150-token prompts, drafted replies (greedy and sampled) and a four-stream concurrent decode hash identically on the first commit and this one (280 of 280). Host suite on the M5: 5041 passed, 620 skipped, 1 failed on the first commit; 5145 passed, 620 skipped, 1 failed on this one: the 104 new cases pass, nothing else moves, and the one failure is test_glm5_prompt_kernels::test_fused_index_scores_are_the_three_ops, which fails on v0.6.5 too. The changed test_gemma4_family.py / test_gemma4_kernels.py on the first commit's source: 76 failed there as on the M3 Ultra; the lane cases run on the M5 and pass on both.

  • Not run: M1, M2 and M4 (no hardware). CUDA: not touched.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. If the bits change, the description says which sums change and why (second commit: M1–M4 only, closer to fp32; M5 bits unchanged).
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

gilby added 2 commits October 4, 2026 01:36
…he Mac decode kernels

RowDecode serves Gemma 4 checkpoints without a MoE block (the 31B): attn_tail, the GeGLU MLP and a new dense_tail
kernel. Decode projections read every MLX affine width the row kernels read (2-8 bits, groups of 32/64/128): the
4-bit row matvec, affine_rows for other widths, and the lane matmul where it reads the width. A stack of mixed widths
(oQ overrides on q/k/v or gate/up) runs one matmul per run of equal widths; every kernel is row-invariant, so windows,
concurrent rounds and one-row steps keep the same bits. The router reads any width; experts stay 4-bit.

Rows-backend stacks are shared with mlx_lm modules as views, so the stack costs no second copy. check() accepts the
dense layout and oQ overrides and names any width, group or mode no kernel reads. The tiny-model tests run every
family test on MoE and dense layouts, uniform and oQ-mixed.

oQ packs that bundle an MTP assistant (language_model.mtp.*) load with those tensors dropped; the family drafts
with --drafter.
…or the row kernels by its shape

Gemma 4's decode projections ran every row of a verify window or a concurrent round through the row matvec
(4-bit) or affine_rows (other widths), so each row re-read the weights. Each linear now picks, once at load and
from its width, group and shape alone, between those and the simdgroup matrix kernels: simd_qmm for 4-bit groups
of 32/64, simd_qmm_bits for 4/5/6/8-bit groups of 64/128 (it now reads 4-bit codes, so 4-bit groups of 128 load
their scales as stored). Every 5/6/8-bit and 4-bit group-128 linear takes the matrix kernels; 4-bit groups of
32/64 take them from a few million weights, so a 128-wide router stays on the row matvec. A linear's kernel never
depends on the row count, and the one-row scalar twins are checked bit-equal to the matrix kernels per weight at
load, so windows, concurrent rounds and one-row steps keep one set of bits. The M5 keeps its rows/lane choice.
TF_GEMMA_DENSE=rows|matrix|auto overrides the choice for measurements.
@gilby

gilby commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Added a second commit (a6ff795): before M5, each Gemma 4 decode linear takes the simdgroup matrix kernels or the row kernels, chosen once at load from its bits, group and shape and never from the row count, per the rule in #154. 4-bit groups of 128 now load their scales as stored. On an M3 Ultra, chat decode with DFlash at 4 streams goes from 45.8 to 77.5 tok/s on a 31B oQ4e and from 172 to 214 on unigilby/gemma-4-26B-A4B-it-qat-oQ4e, and every projection is as close to the fp32 product as before or closer. The receipt and a drafter-acceptance caveat about the raw "code" prompt are in the description.

The M5 is unchanged: its default stays rows (or lane). On an M5 Ultra, tiny Gemma 4 models hash identically before and after (windows of 1–16 rows, drafted and concurrent decode, 280/280), and the host suite goes from 5041 to 5145 passed, which is the new cases. The one failure, test_glm5_prompt_kernels, also fails on v0.6.5.

@ashhart

ashhart commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Thank you, @gilby. The 31B dense layout and oQ's per-layer mixed widths on the row kernels, with the 26B's bits unchanged and both bambocher packs serving exactly, is a careful extension.

The Python engine is frozen (#286) and new work goes into the Zig engine, so this won't merge. The Zig engine has no Gemma 4 family yet, though its server already parses Gemma 4's tool calls and thought channel. When Gemma 4 comes to it, your rules carry over with your credit: one matmul per run of equal widths, a check that names any width, group or mode no kernel reads, and the dense tail. The Zig engine runs Metal kernels directly, so your row kernels are a natural place to start.

@ashhart ashhart closed this Oct 6, 2026
BobClawblaw added a commit to BobClawblaw/TensorFold that referenced this pull request Oct 16, 2026
…, MLX's and mlx-lm's ops, transformers' tower, z-lab's DFlash

glue.metal ports gilby's gemma4-dense reference (a6ff795: RowDecode, _EMIT, qkv_prep, the tails and attention) and,
where it calls MLX or mlx-lm, their kernels' arithmetic: gemma_rms_looped is MLX's rms_looped (rms_norm.metal, the
kernel mx.fast.rms_norm runs past 4,096), gemma_embed MLX's dequantize, gemma_geglu and gemma_softcap mlx-lm's
gemma4_text ops, gemma_rope_freqs its ProportionalRoPE frequencies (MIT, Apple). The image tower and image.zig follow
transformers' modeling_gemma4 and Gemma4ImageProcessorPil (Apache 2.0, the HuggingFace Team); the drafter z-lab's MLX
DFlash model (MIT, Z Lab).
ashhart pushed a commit that referenced this pull request Oct 18, 2026
…de kernels and the MLX ops around them

Ports gilby's qkv_prep, attend (partials and merge), attn_tail and dense_tail (#360) with their rounding points,
plus MLX's looped RMS norm, the scaled 4-bit embedding, mlx_lm's geglu and logit soft-cap as bf16 ops, and the
global layers' proportional RoPE table from MLX's precise pow. tf-gemma4-glue checks every output against the
Python engine's at 1, 2 and 16 rows, sliding and global layers: all bits equal.
ashhart pushed a commit that referenced this pull request Oct 18, 2026
…eedy replies equal to the Python reference

native/gemma4.zig serves the dense 31B on the lane host (context 32,768 by default); metal.zig registers gemma4 in
mlx-q4g64 and refuses --speed-up and --learn for it by name; the tests that took gemma4 as an unserved type use
gemma4_unified, which still is. gemma4_gate.py served: on an M5 Ultra the four prompts' greedy token SHAs equal the
oracle's alone, with drafts and four at once; thinking stays in reasoning_content and a tool call parses.
docs/recipes/gemma-4-native.md is the recipe; docs/credits.md credits gilby's #360 and cshintov's #10.
ashhart pushed a commit that referenced this pull request Oct 18, 2026
…'s and mlx-lm's ops, transformers' tower, z-lab's DFlash

glue.metal ports gilby's gemma4-dense reference (a6ff795: RowDecode, _EMIT, qkv_prep, the tails and attention) and,
where it calls MLX or mlx-lm, their kernels' arithmetic: gemma_rms_looped is MLX's rms_looped (rms_norm.metal, the
kernel mx.fast.rms_norm runs past 4,096), gemma_embed MLX's dequantize, gemma_geglu and gemma_softcap mlx-lm's
gemma4_text ops, gemma_rope_freqs its ProportionalRoPE frequencies (MIT, Apple). The image tower and image.zig follow
transformers' modeling_gemma4 and Gemma4ImageProcessorPil (Apache 2.0, the HuggingFace Team); the drafter z-lab's MLX
DFlash model (MIT, Z Lab).
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…de kernels and the MLX ops around them

Ports gilby's qkv_prep, attend (partials and merge), attn_tail and dense_tail (ashhart#360) with their rounding points,
plus MLX's looped RMS norm, the scaled 4-bit embedding, mlx_lm's geglu and logit soft-cap as bf16 ops, and the
global layers' proportional RoPE table from MLX's precise pow. tf-gemma4-glue checks every output against the
Python engine's at 1, 2 and 16 rows, sliding and global layers: all bits equal.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…eedy replies equal to the Python reference

native/gemma4.zig serves the dense 31B on the lane host (context 32,768 by default); metal.zig registers gemma4 in
mlx-q4g64 and refuses --speed-up and --learn for it by name; the tests that took gemma4 as an unserved type use
gemma4_unified, which still is. gemma4_gate.py served: on an M5 Ultra the four prompts' greedy token SHAs equal the
oracle's alone, with drafts and four at once; thinking stays in reasoning_content and a tool call parses.
docs/recipes/gemma-4-native.md is the recipe; docs/credits.md credits gilby's ashhart#360 and cshintov's #10.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…, MLX's and mlx-lm's ops, transformers' tower, z-lab's DFlash

glue.metal ports gilby's gemma4-dense reference (a6ff795: RowDecode, _EMIT, qkv_prep, the tails and attention) and,
where it calls MLX or mlx-lm, their kernels' arithmetic: gemma_rms_looped is MLX's rms_looped (rms_norm.metal, the
kernel mx.fast.rms_norm runs past 4,096), gemma_embed MLX's dequantize, gemma_geglu and gemma_softcap mlx-lm's
gemma4_text ops, gemma_rope_freqs its ProportionalRoPE frequencies (MIT, Apple). The image tower and image.zig follow
transformers' modeling_gemma4 and Gemma4ImageProcessorPil (Apache 2.0, the HuggingFace Team); the drafter z-lab's MLX
DFlash model (MIT, Z Lab).
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…, MLX's and mlx-lm's ops, transformers' tower, z-lab's DFlash

glue.metal ports gilby's gemma4-dense reference (a6ff795: RowDecode, _EMIT, qkv_prep, the tails and attention) and,
where it calls MLX or mlx-lm, their kernels' arithmetic: gemma_rms_looped is MLX's rms_looped (rms_norm.metal, the
kernel mx.fast.rms_norm runs past 4,096), gemma_embed MLX's dequantize, gemma_geglu and gemma_softcap mlx-lm's
gemma4_text ops, gemma_rope_freqs its ProportionalRoPE frequencies (MIT, Apple). The image tower and image.zig follow
transformers' modeling_gemma4 and Gemma4ImageProcessorPil (Apache 2.0, the HuggingFace Team); the drafter z-lab's MLX
DFlash model (MIT, Z Lab).
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.

2 participants