CMF build of Spark-X2.6-4B for cortiq (Metal / Vulkan / CPU, single file)

#1
by infosave - opened

Hi XHToken team, thanks for Spark-X2.6!

I've added Spark-X2.6-4B support to cortiq, a Rust inference engine with no Python and no ML framework, and published the converted weights of Spark-X2.6-4B (the post-trained model built on this base) as single CMF files: https://huggingface.co/infosave/Spark-X2.6-4B-cmf

The whole architecture runs natively: 9 full-attention + 27 sliding-window (512) layers, exact-GELU FFN, tied head, 1M-token context, thinking mode and tool calling through the embedded chat template. GPUs: NVIDIA / AMD / Intel through Vulkan or DX12, Apple silicon through Metal; the CPU as well.

Files (quantized from the bf16 checkpoint)

file size wikitext-2 ppl
spark-x2.6-4b-q8_2f.cmf (8-bit, default) 4.14 GB 10.71
spark-x2.6-4b-q4tp.cmf (4-bit) 2.16 GB 11.88

ppl: first 4096 tokens of wikitext-2 test, BOS in front, cortiq ppl --tokens 4096.

Decode speed, one stream, tok/s

hardware backend q8_2f q4tp
RTX 2000 Ada 16 GB Vulkan 41.5 67.2
Mac mini M4 24 GB Metal 20.1 34.8
Xeon E5-2699 v4, 6 cores CPU 4.5 4.8

Prompt processing at 1,000 tokens: 370 / 351 tok/s on the RTX 2000 Ada, 286 / 244 tok/s on the M4 (q8_2f / q4tp).

Long context: the sliding layers keep only their window, so the KV state is ~72 KB per token (1.24 GiB at 16k tokens). cortiq serve exposes an OpenAI-compatible API, and each chat turn prefills only what changed: with a 2,300-token history the next turn starts in ~0.6 s on the M4.

Try it

cargo install cortiq-cli
hf download infosave/Spark-X2.6-4B-cmf spark-x2.6-4b-q8_2f.cmf --local-dir .
cortiq run spark-x2.6-4b-q8_2f.cmf --prompt "Explain quicksort in three sentences." --no-think

Prebuilt binaries for Linux, macOS and Windows: https://github.com/infosave2007/cmf/releases (cortiq 0.8.43 or later). The weights stay under your Apache-2.0 terms.

Feedback welcome!

Sign up or log in to comment