Downloads · 30 days
0
nicolasembleton/Spark-X2.5-4B-onnx
Spark-X2.5-4B-onnx is a text generation model from nicolasembleton. Use it when you need the model to write or continue text. It is set up for onnx. The card lists the license as apache-2.0.
ONNX export of XHToken/Spark-X2.5-4B for onnxruntime-web / WebGPU.
Downloads · 30 days
0
Access
Public
Updated Sep 1, 2026
Repo size
21 GB
Likes
0
Public
Click a slice to open those files.
Other16.4 GB · 70%
From the Hugging Face model README
ONNX export of XHToken/Spark-X2.5-4B for onnxruntime-web / WebGPU.
Two graphs per precision under onnx/:
fp16/prefill/model.onnx — prompt tokens -> logits + present KVfp16/decode/model.onnx — token + past KV -> logits + updated KVWeights are ONNX external-data shards (onnx__MatMul_*) sitting next to each
model.onnx (the graphs exceed the 2 GB protobuf limit). Keep each graph's
directory together when serving.
spark2_5 hybrid: 3 sliding-attention layers (window 512, RoPE theta 10k) per 1 full-attention layer (partial rotary 0.25, RoPE theta 5M). Headwise sigmoid attention output gate. GQA 16/4, head_dim 256, tied embeddings, vocab 131072.
input_ids [B, T] int64position_ids [B, T] int64 (absolute positions; prefill: 0..T-1; decode: past_len)attn_mask [B, T, total] additive float (0 keep / -inf mask). Host builds causal mask;
sliding layers additionally mask keys outside the 512-token window.past_k_35 / past_v_35 [B, 4, past_len, 256] — zero-length for prefill.logits [B, T, 131072]present_k_35 / present_v_35 [B, 4, total_len, 256]Loop: prefill once, then feed present_* back as past_* each decode step, slicing
position_ids and attn_mask accordingly. Greedy sampling host-side from logits.
WebGPU: onnxruntime-web webgpu EP. fp16 graphs ~9 GB each; int4 weight-only graphs ~2.9 GB each — use int4 for consumer GPUs.