Skip to content

feat(models): add Limite (limite) support #2360

Closed

Description

@inureyes

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

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)

  1. Every norm is weightless rms_norm with 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.
  2. fold(scale, W) = scale.astype(W.dtype) * W: the f32 scalar (qkv_scale, o_scale) is rounded to the weight dtype before the multiply.
  3. Partial RoPE: rope_n_pairs = 32 of 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).
  4. Sliding window keeps sliding_window + 1 = 1025 keys (k >= q - 1024, inclusive); a RotatingKVCache must therefore hold 1025 entries. Globals (global_layers, global_window = -1) are full causal.
  5. Attention softmax scale is attention_softmax_scale = 0.1, not head_dim ** -0.5.
  6. Value embeddings on ve_layers: value_embeds lookup [vocab, 2*128], gate ve_gate_scale * sigmoid(attn_in[..., :12] @ ve_gate.T), sliced to the first num_key_value_heads heads, added to V before Q/K norm; the cache stores the adjusted V.
  7. XSA on xsa_layers: subtract tanh(xsa_alpha) * <y, v_hat> * v_hat per head in f32, v_hat normalized with floor 1e-4.
  8. Attention gate attn_gate_scale * sigmoid(attn_in[..., :128] @ attn_gate.T) per head before o_proj.
  9. Layer: x = resid_lambda_attn * residual_base + post_lambda_attn * attn_out; out = resid_lambda_mlp * x + post_lambda_mlp * mlp(rms_norm(x)).
  10. MUDD on mudd_layers (24, 47) with mudd_tap_idx ({24: [0, 12, 24], 47: [0, 23, 47]}), history hist[0] = rms_norm(embedding), hist[j] = output of layer j-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_base uses the _mlp weights when mudd_mlp. Only tapped outputs need retaining.
  11. Head: logits = a * sigmoid((h @ embed_tokens.T + b) / c) in f32 with softcap_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 50 generates coherent text through the CLI, and mlxcel-server serves it, including a prompt longer than 1025 tokens.
  • Unit tests on synthetic tensors for: the dtype-dependent eps, the bf16 fold rounding, 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.md at a context above 1025 tokens, gated on disagreement at decided positions, with the arm that drops the MUDD mix (plain rms_norm(x) input on layers 24 and 47) shown to fail.
  • mlxcel arch lists limite; docs/supported-models.md updated.

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 50

Refresh log

  • 2026-11-23, Refreshed against main at 80467eb (commits since 2026-10-16).
    • Checked off: 0 items (no limite arm in src/models/detection.rs, no src/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-violetto config (2.08 GB, bf16, not gated): 48 layers, rope_style: interleaved_pairs_odd_lane_sign_flip, rope_n_pairs 32, sliding_window 1024 with the inclusive span = sliding_window + 1 convention, rms_norm_eps_mode: torch_finfo_default, attention_softmax_scale 0.1, global_layers every 4th from 3 with global_nope, mudd_layers [24, 47] with the taps above, mudd_mlp: true, sigmoid softcap_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. Upstream mlx_vlm/models/limite has 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_tests fails for any new impl LanguageModel that neither implements last_row_logits nor is listed; the sigmoid softcap head must then apply to the sampled row only (docs/adding-models.md checklist). 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.

All acceptance criteria are implemented in #3251 (trace numbers and commands in the PR body).

Activity

  1. added
    type:enhancement
    area:models
    modeltype:text
    status:ready
    priority:low
    arch:hybrid
    modelsize:small
    on Oct 16, 2026
  2. added
    status:in-progress
    status:review
    and removed
    status:ready
    status:in-progress
    on Nov 22, 2026
  3. added
    status:done
    and removed
    status:review
    on Nov 22, 2026
  4. added 2 commits that reference this issue on Nov 22, 2026
    d47ec39
    6bade1d
  5. added a commit that references this issue on Nov 25, 2026
    d8f4618
  6. added this to the 0.9 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch:hybridarea:modelsmodelsize:smallmodeltype:textpriority:lowstatus:donetype:enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions