memory + #61: Olala spike report (go with conditions), #63 done by bob
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aa4a11e parent: a517971 modified
.memory/handoffs/2026-11-27-v0-3-tui-foundation.md +2 -0 | @@ -40,3 +40,5 @@ | ||
| 40 | 40 | - User confirmed after the bump: "ok all good", `scripts/compat.sh` on the Mac 79 passed (93.6 s). |
| 41 | 41 | - The Models screen download works (user, 2026-11-27): not a bug. |
| 42 | 42 | - #28 closed (GPU shows on the Mac). Machine line now two lines; status bar address last. v0.3 left: #63 (reasoning colour), then the 0.3.0 release. |
| 43 | +- bob did #63 (a517971): v0.3 tickets all closed; next is the 0.3.0 release. | |
| 44 | +- riker: Olala spike report in #61 comment 1 (go with conditions); 9 tickets proposed, not created; task 2 needs reference outputs from the fork on the Mac. | |
| @@ -40,3 +40,5 @@ | |||
| 40 | - User confirmed after the bump: "ok all good", `scripts/compat.sh` on the Mac 79 passed (93.6 s). | 40 | - User confirmed after the bump: "ok all good", `scripts/compat.sh` on the Mac 79 passed (93.6 s). |
| 41 | - The Models screen download works (user, 2026-11-27): not a bug. | 41 | - The Models screen download works (user, 2026-11-27): not a bug. |
| 42 | - #28 closed (GPU shows on the Mac). Machine line now two lines; status bar address last. v0.3 left: #63 (reasoning colour), then the 0.3.0 release. | 42 | - #28 closed (GPU shows on the Mac). Machine line now two lines; status bar address last. v0.3 left: #63 (reasoning colour), then the 0.3.0 release. |
| 43 | +- bob did #63 (a517971): v0.3 tickets all closed; next is the 0.3.0 release. | ||
| 44 | +- riker: Olala spike report in #61 comment 1 (go with conditions); 9 tickets proposed, not created; task 2 needs reference outputs from the fork on the Mac. | ||
modified
.memory/history.md +6 -0 | @@ -548,3 +548,9 @@ open, a comment on each. main fast-forwarded. | ||
| 548 | 548 | - 2026-11-27, later: the user confirmed the 3.33.0 bump on the Mac ("ok all good"); `scripts/compat.sh` with real models: 79 passed in 93.6 s. |
| 549 | 549 | - 2026-11-27, later: the TUI Models screen download works (user: "je me suis trompé"); nothing to fix there. |
| 550 | 550 | - 2026-11-27, later: GPU load confirmed shown on the Mac (#28 closed); the Machine line was too full → split in two, status bar reordered (version, gpu, pressure, memory, model, address last). Linux 336, Mac green. |
| 551 | + | |
| 552 | +## 2026-11-27 — two sub-agents: #63 done (bob), Olala spike #61 (riker) | |
| 553 | + | |
| 554 | +- **Goal**: user "agent bob: fait le #63 / agent riker: vérifie si tu sais faire tourner le modèle olala". | |
| 555 | +- **bob (#63)**: reasoning in cyan (`Style.reasoning`, ANSI 36) for shown, folded and streaming reasoning; `⋯` prefix kept without colours; no `reasoning_color` preference (decision); the "waiting for the model" line stays dim. `ChatRendererTests` moved to their own file (file_length). Commit a517971; Linux 339, Mac 365, gate PASS run #44; docs EN+FR; #63 closed. All v0.3 tickets are now closed. | |
| 556 | +- **riker (#61, research only)**: go with conditions — port the fork's plain-MLX reference path to Swift (~1,100–1,500 lines, 4–6 days + Mac iterations), Metal kernels optional later. No support anywhere upstream (mlx-swift-lm has Mamba-2 only; Python mlx-lm Mamba-3 PR open). Full report in comment 1 of #61, with 9 proposed tickets (not created, waiting for the user) and the Mac commands for reference outputs (task 2). | |
| @@ -548,3 +548,9 @@ open, a comment on each. main fast-forwarded. | |||
| 548 | - 2026-11-27, later: the user confirmed the 3.33.0 bump on the Mac ("ok all good"); `scripts/compat.sh` with real models: 79 passed in 93.6 s. | 548 | - 2026-11-27, later: the user confirmed the 3.33.0 bump on the Mac ("ok all good"); `scripts/compat.sh` with real models: 79 passed in 93.6 s. |
| 549 | - 2026-11-27, later: the TUI Models screen download works (user: "je me suis trompé"); nothing to fix there. | 549 | - 2026-11-27, later: the TUI Models screen download works (user: "je me suis trompé"); nothing to fix there. |
| 550 | - 2026-11-27, later: GPU load confirmed shown on the Mac (#28 closed); the Machine line was too full → split in two, status bar reordered (version, gpu, pressure, memory, model, address last). Linux 336, Mac green. | 550 | - 2026-11-27, later: GPU load confirmed shown on the Mac (#28 closed); the Machine line was too full → split in two, status bar reordered (version, gpu, pressure, memory, model, address last). Linux 336, Mac green. |
| 551 | + | ||
| 552 | +## 2026-11-27 — two sub-agents: #63 done (bob), Olala spike #61 (riker) | ||
| 553 | + | ||
| 554 | +- **Goal**: user "agent bob: fait le #63 / agent riker: vérifie si tu sais faire tourner le modèle olala". | ||
| 555 | +- **bob (#63)**: reasoning in cyan (`Style.reasoning`, ANSI 36) for shown, folded and streaming reasoning; `⋯` prefix kept without colours; no `reasoning_color` preference (decision); the "waiting for the model" line stays dim. `ChatRendererTests` moved to their own file (file_length). Commit a517971; Linux 339, Mac 365, gate PASS run #44; docs EN+FR; #63 closed. All v0.3 tickets are now closed. | ||
| 556 | +- **riker (#61, research only)**: go with conditions — port the fork's plain-MLX reference path to Swift (~1,100–1,500 lines, 4–6 days + Mac iterations), Metal kernels optional later. No support anywhere upstream (mlx-swift-lm has Mamba-2 only; Python mlx-lm Mamba-3 PR open). Full report in comment 1 of #61, with 9 proposed tickets (not created, waiting for the user) and the Mac commands for reference outputs (task 2). | ||
modified
.tickets/issues/0061-spike-olala-architecture-mlx-engine-fork.yaml +22 -3 | @@ -6,7 +6,7 @@ author: | ||
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-11-27T05:00:00.000Z |
| 9 | -updatedAt: 2026-11-27T05:00:00.000Z | |
| 9 | +updatedAt: 2026-11-27T11:00:00.000Z | |
| 10 | 10 | labels: |
| 11 | 11 | - "spike" |
| 12 | 12 | - "area::engine" |
| @@ -45,12 +45,14 @@ body: | | ||
| 45 | 45 | tasks: |
| 46 | 46 | - id: 1 |
| 47 | 47 | title: "Read the fork's olala model code and kernels; list what a Swift port needs" |
| 48 | - state: open | |
| 48 | + state: closed | |
| 49 | 49 | priority: medium |
| 50 | 50 | author: |
| 51 | 51 | name: k33g |
| 52 | 52 | email: ph.charriere@gmail.com |
| 53 | 53 | createdAt: 2026-11-27T05:00:00.000Z |
| 54 | + updatedAt: 2026-11-27T11:00:00.000Z | |
| 55 | + closedAt: 2026-11-27T11:00:00.000Z | |
| 54 | 56 | - id: 2 |
| 55 | 57 | title: "Run the fork's reference on the Mac (q5e6), record reference outputs and speed" |
| 56 | 58 | state: open |
| @@ -67,4 +69,21 @@ tasks: | ||
| 67 | 69 | name: k33g |
| 68 | 70 | email: ph.charriere@gmail.com |
| 69 | 71 | createdAt: 2026-11-27T05:00:00.000Z |
| 70 | -comments: [] | |
| 72 | +comments: | |
| 73 | + - id: 1 | |
| 74 | + author: | |
| 75 | + name: k33g | |
| 76 | + email: ph.charriere@gmail.com | |
| 77 | + createdAt: 2026-11-27T11:00:00.000Z | |
| 78 | + body: | | |
| 79 | + Spike report (paper analysis by a sub-agent, 2026-11-27; nothing run yet). Verdict: GO WITH CONDITIONS — a Swift port of the fork's plain-MLX reference path (OLALA_MLX_REF=1). | |
| 80 | + - Existing support: none in mlx-swift-lm 3.33.0 / main (Mamba-2 only) nor in Python mlx-lm (Mamba-3 PR ml-explore/mlx-lm#1021 open since 2026-03). The fork (OVHai-LLM/mlx-engine @58083ca, mlx_engine/models/olala/) pins upstream mlx 0.32.3 and an upstream mlx-lm commit; register() only adds the module, no fork-only mlx-lm API. | |
| 81 | + - Fork code: model.py 1267 lines (~500 are batch caches), kernels.py 346 (reference path), metal.py 3455 (19 mx.fast.metal_kernel sites, speed only), parser.py 210 (channels). ~900 lines of Python matter. | |
| 82 | + - Architecture (q5e6 config): 36 layers, 29 Mamba-3 (MIMO rank 4, 48 heads, P=64, N=128, no conv, data-dependent rotary, trapezoid discretisation, f32 packed state ~1.7 MB/layer) + 7 attention (indices 4, 9, … 34: differential attention 48 q / 36 signal / 12 kv heads, rank-4 tensor-product K/V with token shift, q/k RMS norm, scalable softmax, scale 1/head_dim, tanh soft-cap 150 → no MLXFast SDPA, no RoPE, window 32768, output gate silu(g+1.15)); MoE on every layer (sigmoid router over 256, top-6 with selection bias, renormalised ×2.45, squared ReLU experts on a 384-wide projection, shared expert 1536); nGPT-style unit-norm embedding, no pre/final norms, f32 geodesic update after each block. Exotic config flags (DSA/NSA/KDA/GDN…) unused and refused by the fork. | |
| 83 | + - Quantisation: standard mlx affine per layer (q5e6: 6-bit g64, experts 5-bit; q4e8: 8-bit, experts 4-bit g32); router and in_proj_small unquantised — mlx-swift-lm's per-layer loading handles it. | |
| 84 | + - Template: special channel tokens (<|channel_start|> 151646, <|content|> 151654, <|channel_end|> 151647, <|im_end|> 151645); the prompt ends inside the analysis channel; tool calls in a `tools` channel as <toolcalls><call id><name><arguments>{json}… ; uses {% generation %} and dict(), supported by swift-jinja. | |
| 85 | + - Reusable in mlx-swift-lm: public LLMTypeRegistry.registerModelType (razorbill can register "olala" before loading), SwitchLinear/QuantizedSwitchLinear, gatherSort/scatterUnsort, ArraysCache/CacheList, MLXFast.metalKernel, ChatConventionsRegistry + ReasoningChannel (Gemma 4 style; `tools` channel would be taken as reasoning unless razorbill catches it); ToolCallFormat is closed. Patterns to copy: NemotronH.swift (MoE + squared ReLU), SSM.swift (Mamba-2 kernel), Qwen3Next/Qwen3.5 hybrid caches. | |
| 86 | + - razorbill gaps: sub-folder repos (ModelConfiguration(modelSubdirectory:) exists in 3.33, but razorbill's ModelReference/download would fetch all four variants, ~37 GB); reasoning_effort is reduced to enable_thinking (must pass chat_template_kwargs.reasoning_effort, none → disabled); history sends no past tool_calls / reasoning. | |
| 87 | + - Effort: phase 1 (correct, no kernels) ~1,100–1,500 lines of Swift, 4–6 days + Mac iterations; phase 2 (Metal kernels) 1,500–2,500 lines, 5–10 days, optional. Risks: decode speed without kernels (~60 small ops per layer × 36), numerical parity (f32 casts), tool channel, prompt cache (Mamba state not trimmable). | |
| 88 | + - Proposed tickets: (1) reference outputs on the Mac (task 2), (2) sub-folder variants, (3) Swift olala model (reference path) registered at start-up, (4) parity test on the Mac, (5) channel format + reasoning_effort pass-through, (6) olala tool calls + history, (7) speed (compile, then Metal kernels; M1 384-thread limit), (8) prompt cache snapshots for hybrids, (9) docs EN+FR. Not created yet: waiting for the user. | |
| 89 | + - Task 2 needs the user's Mac: commands in the model card (clone the fork, venv, hf download --include "q5e6/*"; greedy temp 0, max_tokens 64, with and without OLALA_MLX_REF=1; save prompt ids, output ids, last-position logits). | |
| @@ -6,7 +6,7 @@ author: | |||
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-11-27T05:00:00.000Z | 8 | createdAt: 2026-11-27T05:00:00.000Z |
| 9 | -updatedAt: 2026-11-27T05:00:00.000Z | 9 | +updatedAt: 2026-11-27T11:00:00.000Z |
| 10 | labels: | 10 | labels: |
| 11 | - "spike" | 11 | - "spike" |
| 12 | - "area::engine" | 12 | - "area::engine" |
| @@ -45,12 +45,14 @@ body: | | |||
| 45 | tasks: | 45 | tasks: |
| 46 | - id: 1 | 46 | - id: 1 |
| 47 | title: "Read the fork's olala model code and kernels; list what a Swift port needs" | 47 | title: "Read the fork's olala model code and kernels; list what a Swift port needs" |
| 48 | - state: open | 48 | + state: closed |
| 49 | priority: medium | 49 | priority: medium |
| 50 | author: | 50 | author: |
| 51 | name: k33g | 51 | name: k33g |
| 52 | email: ph.charriere@gmail.com | 52 | email: ph.charriere@gmail.com |
| 53 | createdAt: 2026-11-27T05:00:00.000Z | 53 | createdAt: 2026-11-27T05:00:00.000Z |
| 54 | + updatedAt: 2026-11-27T11:00:00.000Z | ||
| 55 | + closedAt: 2026-11-27T11:00:00.000Z | ||
| 54 | - id: 2 | 56 | - id: 2 |
| 55 | title: "Run the fork's reference on the Mac (q5e6), record reference outputs and speed" | 57 | title: "Run the fork's reference on the Mac (q5e6), record reference outputs and speed" |
| 56 | state: open | 58 | state: open |
| @@ -67,4 +69,21 @@ tasks: | |||
| 67 | name: k33g | 69 | name: k33g |
| 68 | email: ph.charriere@gmail.com | 70 | email: ph.charriere@gmail.com |
| 69 | createdAt: 2026-11-27T05:00:00.000Z | 71 | createdAt: 2026-11-27T05:00:00.000Z |
| 70 | -comments: [] | 72 | +comments: |
| 73 | + - id: 1 | ||
| 74 | + author: | ||
| 75 | + name: k33g | ||
| 76 | + email: ph.charriere@gmail.com | ||
| 77 | + createdAt: 2026-11-27T11:00:00.000Z | ||
| 78 | + body: | | ||
| 79 | + Spike report (paper analysis by a sub-agent, 2026-11-27; nothing run yet). Verdict: GO WITH CONDITIONS — a Swift port of the fork's plain-MLX reference path (OLALA_MLX_REF=1). | ||
| 80 | + - Existing support: none in mlx-swift-lm 3.33.0 / main (Mamba-2 only) nor in Python mlx-lm (Mamba-3 PR ml-explore/mlx-lm#1021 open since 2026-03). The fork (OVHai-LLM/mlx-engine @58083ca, mlx_engine/models/olala/) pins upstream mlx 0.32.3 and an upstream mlx-lm commit; register() only adds the module, no fork-only mlx-lm API. | ||
| 81 | + - Fork code: model.py 1267 lines (~500 are batch caches), kernels.py 346 (reference path), metal.py 3455 (19 mx.fast.metal_kernel sites, speed only), parser.py 210 (channels). ~900 lines of Python matter. | ||
| 82 | + - Architecture (q5e6 config): 36 layers, 29 Mamba-3 (MIMO rank 4, 48 heads, P=64, N=128, no conv, data-dependent rotary, trapezoid discretisation, f32 packed state ~1.7 MB/layer) + 7 attention (indices 4, 9, … 34: differential attention 48 q / 36 signal / 12 kv heads, rank-4 tensor-product K/V with token shift, q/k RMS norm, scalable softmax, scale 1/head_dim, tanh soft-cap 150 → no MLXFast SDPA, no RoPE, window 32768, output gate silu(g+1.15)); MoE on every layer (sigmoid router over 256, top-6 with selection bias, renormalised ×2.45, squared ReLU experts on a 384-wide projection, shared expert 1536); nGPT-style unit-norm embedding, no pre/final norms, f32 geodesic update after each block. Exotic config flags (DSA/NSA/KDA/GDN…) unused and refused by the fork. | ||
| 83 | + - Quantisation: standard mlx affine per layer (q5e6: 6-bit g64, experts 5-bit; q4e8: 8-bit, experts 4-bit g32); router and in_proj_small unquantised — mlx-swift-lm's per-layer loading handles it. | ||
| 84 | + - Template: special channel tokens (<|channel_start|> 151646, <|content|> 151654, <|channel_end|> 151647, <|im_end|> 151645); the prompt ends inside the analysis channel; tool calls in a `tools` channel as <toolcalls><call id><name><arguments>{json}… ; uses {% generation %} and dict(), supported by swift-jinja. | ||
| 85 | + - Reusable in mlx-swift-lm: public LLMTypeRegistry.registerModelType (razorbill can register "olala" before loading), SwitchLinear/QuantizedSwitchLinear, gatherSort/scatterUnsort, ArraysCache/CacheList, MLXFast.metalKernel, ChatConventionsRegistry + ReasoningChannel (Gemma 4 style; `tools` channel would be taken as reasoning unless razorbill catches it); ToolCallFormat is closed. Patterns to copy: NemotronH.swift (MoE + squared ReLU), SSM.swift (Mamba-2 kernel), Qwen3Next/Qwen3.5 hybrid caches. | ||
| 86 | + - razorbill gaps: sub-folder repos (ModelConfiguration(modelSubdirectory:) exists in 3.33, but razorbill's ModelReference/download would fetch all four variants, ~37 GB); reasoning_effort is reduced to enable_thinking (must pass chat_template_kwargs.reasoning_effort, none → disabled); history sends no past tool_calls / reasoning. | ||
| 87 | + - Effort: phase 1 (correct, no kernels) ~1,100–1,500 lines of Swift, 4–6 days + Mac iterations; phase 2 (Metal kernels) 1,500–2,500 lines, 5–10 days, optional. Risks: decode speed without kernels (~60 small ops per layer × 36), numerical parity (f32 casts), tool channel, prompt cache (Mamba state not trimmable). | ||
| 88 | + - Proposed tickets: (1) reference outputs on the Mac (task 2), (2) sub-folder variants, (3) Swift olala model (reference path) registered at start-up, (4) parity test on the Mac, (5) channel format + reasoning_effort pass-through, (6) olala tool calls + history, (7) speed (compile, then Metal kernels; M1 384-thread limit), (8) prompt cache snapshots for hybrids, (9) docs EN+FR. Not created yet: waiting for the user. | ||
| 89 | + - Task 2 needs the user's Mac: commands in the model card (clone the fork, venv, hf download --include "q5e6/*"; greedy temp 0, max_tokens 64, with and without OLALA_MLX_REF=1; save prompt ids, output ids, last-position logits). | ||