Repository navigation
Description
Summary
Add Paradigma Limite (model_type: limite, architectures: ["LimiteForCausalLM"]), released as paradigma-inc/limite-1b-violetto. It is a 48-layer dense decoder with a MUDD dense-connection mixer (two layers read a learned mix of earlier layer outputs), sliding/global attention (globals every 4th layer, NoPE), value embeddings, XSA value-direction removal, a per-head attention gate, learned residual lambdas, and a sigmoid-softcapped tied head. Nothing in mlxcel resembles the mixer or the head. Today mlxcel exits with Unsupported model type: limite.
Upstream reference
- limite-1b-violetto support Neywa-Labs/mlx-vlm#2331.
- Module: https://github.com/Blaizzy/mlx-vlm/tree/main/mlx_vlm/models/limite (
config.py,language.py). - Checkpoint:
paradigma-inc/limite-1b-violetto(bf16, 2.1 GB,auto_mapremote code). No MLX conversion; the bf16 safetensors load directly. The config documents most conventions in string fields (rope_style,sliding_window_convention,mudd_hist_convention,rms_norm_eps_mode); treat them as assertions and refuse at load if a value differs from the one implemented.
Current mlxcel state
No limite arm in src/models/detection.rs. Reusable pieces: mlxcel_core::fast_rms_norm_no_weight for weightless norms, mlxcel_core::layers::{KVCache, RotatingKVCache}, the ModelOwnedSequenceState heterogeneous-cache pattern used by src/models/afmoe.rs (sliding plus global layers, sequence_state at :1330), and mlxcel_core::utils::create_sliding_window_prefill_mask (src/lib/mlxcel-core/src/utils.rs:1282).
Numerics the port must reproduce (each is a parity trap)
- Every norm is weightless
rms_normwith a dtype-dependent epsilon (finfo(dtype).eps: bf16 0.0078125, f16 0.0009765625, f32 1.1920929e-07). Keep the checkpoint's bf16 activations: the bf16 to f16 load conversion changes this eps, so skip it for this family or apply the f16 value consciously and prove parity. fold(scale, W) = scale.astype(W.dtype) * W: the f32 scalar (qkv_scale,o_scale) is rounded to the weight dtype before the multiply.- Partial RoPE:
rope_n_pairs = 32of 64 pairs,freq = (1/1024) ** linspace(0, 1, 32)repeated per pair and zero-padded to head_dim 128; cos/sin are computed in f32 then rounded to bf16; rotation is interleaved pairs with the odd-lane sine negated,(a, b) -> (a cos + b sin, b cos - a sin). Applied after Q/K norm, skipped on global layers (global_nope). - Sliding window keeps
sliding_window + 1 = 1025keys (k >= q - 1024, inclusive); aRotatingKVCachemust therefore hold 1025 entries. Globals (global_layers,global_window = -1) are full causal. - Attention softmax scale is
attention_softmax_scale = 0.1, nothead_dim ** -0.5. - Value embeddings on
ve_layers:value_embedslookup[vocab, 2*128], gateve_gate_scale * sigmoid(attn_in[..., :12] @ ve_gate.T), sliced to the firstnum_key_value_headsheads, added to V before Q/K norm; the cache stores the adjusted V. - XSA on
xsa_layers: subtracttanh(xsa_alpha) * <y, v_hat> * v_hatper head in f32,v_hatnormalized with floor1e-4. - Attention gate
attn_gate_scale * sigmoid(attn_in[..., :128] @ attn_gate.T)per head beforeo_proj. - Layer:
x = resid_lambda_attn * residual_base + post_lambda_attn * attn_out;out = resid_lambda_mlp * x + post_lambda_mlp * mlp(rms_norm(x)). - MUDD on
mudd_layers(24, 47) withmudd_tap_idx({24: [0, 12, 24], 47: [0, 23, 47]}), historyhist[0] = rms_norm(embedding),hist[j]= output of layerj-1:w = gelu(rms_norm(x) @ dense1.T) @ dense2[layer, :n].T + bias[layer, :n], accumulated strictly left to right in the activation dtype (a stacked contraction differs numerically);attn_in = rms_norm(mix),residual_baseuses the_mlpweights whenmudd_mlp. Only tapped outputs need retaining. - Head:
logits = a * sigmoid((h @ embed_tokens.T + b) / c)in f32 withsoftcap_logits = {a: 23, b: 5, c: 7.5}. These bounded values are what upstream hands to the sampler, so mlxcel must return them as the logits (greedy is unaffected, temperature sampling is not).
Scope
In scope: src/models/limite.rs (new) and limite_tests.rs, ModelType::Limite, "limite" arm in detection.rs, loader wiring per docs/adding-models.md, docs/supported-models.md.
Out of scope: rope_per_layer: true and mlp_type: relu2 (refuse at load, as upstream does), batching beyond what the model-owned cache path already provides.
Acceptance criteria
-
mlxcel generate -m models/limite-1b-violetto -p "Hello" -n 50generates coherent text through the CLI, andmlxcel-serverserves it, including a prompt longer than 1025 tokens. - Unit tests on synthetic tensors for: the dtype-dependent eps, the bf16
foldrounding, the partial interleaved RoPE (fails if applied to all 64 pairs), and the MUDD left-to-right accumulation over three taps. - Unit test that the sliding cache keeps 1025 keys (fails at 1024).
- Teacher-forced logit trace against mlx-vlm per
docs/benchmarks.mdat a context above 1025 tokens, gated on disagreement at decided positions, with the arm that drops the MUDD mix (plainrms_norm(x)input on layers 24 and 47) shown to fail. -
mlxcel archlistslimite;docs/supported-models.mdupdated.
Verification
cargo test --workspace --profile test-fast --features metal,accelerate
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --check
./target/release/mlxcel download paradigma-inc/limite-1b-violetto
./target/release/mlxcel generate -m models/limite-1b-violetto -p "Hello" -n 50Refresh log
- 2026-11-23, Refreshed against
mainat 80467eb (commits since 2026-10-16).- Checked off: 0 items (no
limitearm insrc/models/detection.rs, nosrc/models/limite.rs, no linked PR). - Marked obsolete: 0 items.
- Renamed: 0. Added 2 location anchors (
afmoe.rs:1330,utils.rs:1282); every reusable piece named above still exists under the same name. - Verified against the published
paradigma-inc/limite-1b-violettoconfig (2.08 GB, bf16, not gated): 48 layers,rope_style: interleaved_pairs_odd_lane_sign_flip,rope_n_pairs32,sliding_window1024 with the inclusivespan = sliding_window + 1convention,rms_norm_eps_mode: torch_finfo_default,attention_softmax_scale0.1,global_layersevery 4th from 3 withglobal_nope,mudd_layers[24, 47] with the taps above,mudd_mlp: true, sigmoidsoftcap_logits{23, 5, 7.5},rope_per_layer: false,mlp_type: swiglu, tied embeddings. Checkpoint commits after filing (2026-11-02, 2026-11-20) touch only the README. Upstreammlx_vlm/models/limitehas no commits since 2026-10-15. - Surfaced (not added): since perf(models): project only the sampled prefill row in every model #3090,
last_row_logits_coverage_testsfails for any newimpl LanguageModelthat neither implementslast_row_logitsnor is listed; the sigmoid softcap head must then apply to the sampled row only (docs/adding-models.mdchecklist). Since update: batch decode for mixed-cache model families #2672 and update(models): batch model-owned attention decode #2673 the model-owned cache path batches decode, and fix(models): honor KV mode, KV bound and release for model-owned caches #2776 / fix(models): close the KV mode reporting gaps left by #2776 #2788 require model-owned families to honour and report KV mode, KV bound and release, so the "batching beyond what the model-owned cache path already provides" boundary now includes batched decode.
- Checked off: 0 items (no
All acceptance criteria are implemented in #3251 (trace numbers and commands in the PR body).
Activity
test(models): cover Limite config helpers and position tables
feat(models): add Paradigma Limite (limite) text model
test(models): cover Limite config helpers and position tables
feat(models): add Paradigma Limite (limite) text model (lablup#3251)
fix(security): check Talkie checkpoint shapes against the config at load
fix(security): check Talkie checkpoint shapes against the config at load