Skip to content

SmaLLM 0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 25 Nov 09:59
  • Faster on ARM chips with the dot product extension (Cortex-A55, A76
    and later, such as the Raspberry Pi 5 and the RK3588, Apple's M chips and
    AWS Graviton). Prompts: the tile kernel multiplies four vectors at once
    with sdot by lane, tiles keep their weights signed so zero points cost
    nothing, formats with a scale per 32 weights sum 32 columns before they
    scale, tile fills store with st4, and a few tiles share each group of
    vectors. Attention, the softmax, the SiLU and GELU gates and activation
    quantizing have NEON kernels of their own, and 16-bit keys and values are
    widened four at a time. Generation: the row kernels of the 32-weight
    formats (Q4_0, Q8_0, Q5_0, IQ4_NL, MXFP4 and others) take four blocks at a
    time, and Q6_K's merges its bits with shifts that insert. On an Allwinner
    A733's two Cortex-A76 cores, LFM3 1.7B (Q4_0) reads a 128-token prompt at
    40.6 tokens per second (12.8 before, llama.cpp 44.6) and generates at 8.8
    (7.5 before, llama.cpp 8.7, both at the board's memory limit). On all 8
    cores it reads that prompt at 50.3. Nemotron 3.5 Bolt E4B (Q4_K_M) reads
    prompts at 15.0 (8.9 before, llama.cpp 8.5) and generates at 2.9 (2.8
    before, llama.cpp 2.7).
  • A prompt batch of 64 on ARM, as on x86. It was 32. With the faster
    kernels, 64 reads prompts 7 percent faster on the A733, for about 5 MB
    more scratch memory.
  • Prompts read ahead of the multiply. While a tile of rows meets the
    batch, the next tile's rows are already being fetched from memory. On x86
    Llama 3.2 1B (Q4_K_M) reads a 256-token prompt about 6 percent faster (876
    against 828 tokens per second on 8 cores), and Gemma 4 E2B (Q4_0) is
    unchanged.
  • Thread counts on ARM boards. Physical cores are now told apart by the
    CPUs that share them. Boards whose clusters number their cores from zero
    (the Allwinner A733) were counted 6 cores short of 8, and read prompts
    about 15 percent slower. Thread counts also follow the CPU affinity mask
    now, so taskset limits them.
  • smallm rm asks first, as uninstall does. --yes skips the
    question. smallm list --help and smallm rm --help work.
  • Sampling defaults from the model file. The settings a model file
    recommends (general.sampling.*: temperature, top-k, top-p, min-p, the
    repetition penalty and its window, XTC and Mirostat) are the defaults,
    as llama.cpp reads them. smallm.conf and the command line still win,
    and the file's sampling settings default to auto. A settings file
    written by 0.3.0 or earlier spells out the old defaults (temp = 0.8,
    batch = 32 and the rest). Those values now read as auto, so they do
    not hide the model's settings. Values that were changed are kept.
  • Six more samplers, in llama.cpp's order and with its option names:
    typical (--typical), top-n-sigma (--top-nsigma), XTC
    (--xtc-probability, --xtc-threshold), dynamic temperature
    (--dynatemp-range, --dynatemp-exp), Mirostat 1 and 2 (--mirostat,
    --mirostat-ent, --mirostat-lr) and logit bias
    (--logit-bias TOKEN+BIAS, repeatable). The server reads them from
    requests: typical_p, top_n_sigma, xtc_probability,
    xtc_threshold, dynatemp_range, dynatemp_exponent, mirostat,
    mirostat_tau, mirostat_eta, and logit_bias as OpenAI's object or
    llama.cpp's list of pairs.
  • smallm serve takes the sampling options as defaults for requests
    that do not give their own.
  • A switch for thinking. --think off makes Qwen3, LFM3, SmolLM3 and
    RWKV-7 G1 answer without reasoning, written the way each model's own
    template writes it. --think on turns it on for Gemma 4, whose reasoning
    is now kept apart from its answer. gpt-oss always reasons and takes
    --think low, medium or high. The server takes
    chat_template_kwargs.enable_thinking and reasoning_effort per
    request, and serve --think sets its default.
  • Larger prompt batches on x86 and for models with experts. Prompts
    are read 64 tokens at a time on x86 (32 before), and 128 for models with
    experts on every machine, whose batch is split among the experts. On an
    Intel Core i7-14700K, dense models read prompts up to 11 percent faster
    for 2 to 6 MB more scratch memory. The expert models read them about 44
    percent faster: DeepSeek-Coder-V2-Lite at 189 tokens per second against
    llama.cpp's 162 (0.83 times llama.cpp before), for 44 MB.
  • --cpus runs on chosen CPUs, such as one cluster of a board, and the
    thread counts follow them. Linux and Android. The cpus setting does the
    same.
  • --mlock reads the whole model into memory at load and keeps it
    there, for boards whose storage is too slow to read pages back. It needs
    a locked-memory limit (ulimit -l) as large as the file.
  • --max-tokens says in its help that it counts reasoning tokens.
  • Inkling 2 and Inkling 2 Mini (Thinking Machines), the inkling2 and
    inkling2_loop architectures. Their blocks attend over the outputs of
    earlier blocks instead of reading one residual stream. Attention has a
    learned bias on distances instead of rotation, and short convolutions run
    over the keys, the values and both block outputs. Inkling 2 Mini runs
    layers 6 to 17 three times, each pass with its own cache. Its tokenizer
    rule, its chat format (inkling, with the thinking effort set by
    --think), and its reasoning markers come with it. Greedy output
    matches llama.cpp b12711, and logits agree at a cosine similarity of
    0.9997 (0.99994 on a K-quant copy). With the 9.1 GB UD-Q2_K_XL file,
    SmaLLM reads prompts 15 percent faster and generates 13 percent faster
    than llama.cpp, and holds 154 MB of anonymous memory after 256 tokens
    where llama.cpp holds 1.45 GB.
  • NVFP4, Q1_0 and Q2_0 weights, which Inkling 2 Mini's experts use,
    each expanding to exactly ggml's numbers. NVFP4 and Q2_0 have AVX2 and
    NEON kernels and run at Q4_0's speed on x86. Q1_0 runs portable code.
    Expert tensors may also carry one scale per expert (.scale), which
    conversions from NVFP4 keep apart from the weights.
  • Saved convolution states stay under 16 MB together, the oldest
    dropped first. They grew with the context before, by 3.8 MB every 256
    positions for Inkling 2 Mini. A cut before the oldest saved state reads
    the context again from its start.
  • Word splitting for the four families llama.cpp added since 0.3.0's
    reference: inkling2, tekken-num3, soprano and zonos3 (71 in all).
  • Sizes. The program is 0.89 to 1.40 MB depending on the platform
    (0.82 to 1.26 in 0.3.0), and the shared library 0.70 to 0.96 MB, with
    Inkling 2, three weight formats, six samplers and the NEON kernels above.