Inkling-2-Mini-ONNX-WebGPU
The text model of Thinking Machines Lab's Inkling 2 Mini (26.4B parameters, 3.4B active) converted to ONNX for running in a web browser with ONNX Runtime Web's WebGPU backend, as used by Quick Inference.
Changes from the original
- Made from the official checkpoint (thinkingmachines/Inkling-2-Mini at
ed40e7da). The experts are copied bit for bit: NVFP4 in layers 0-19 (E2M1 codes; each float8 block scale times its expert'samax / outer_scale_denominatoris stored as one float16 scale) and MXFP8 in layers 20-23 (float8 values; the power-of-two block scales as float16). The MoE's routing scale (8) is folded into the down projections' scales. - They run in
com.microsoft.QMoEwithweight_format="e2m1"/"e4m3"and the softcapped SwiGLU (swiglu_gate_softcap=4,swiglu_up_softcap=25), which only Quick Inference's build of ONNX Runtime Web has (v1.30.0-qi.6 or later, onnxruntime-web-kernels). - The other weights (attention, embeddings, output layer), bfloat16 in the original, are quantised to 8 bits (round to nearest, symmetric, block size 32): at 4 bits the model's outputs drifted far from the original's.
- Text only: the vision tower and the multi-token-prediction head are left out.
- Converted to an ONNX decoder by Quick Inference's own exporter (
tools/export/export_inkling.pyin Quick Inference), following transformers' Inkling 2 code (modeling_inkling2_loop.py) and checked against it (check_inkling.py). Layers 6-17 run three times, so the graph has 48 layer applications, each with its own cache: inputsinput_ids,attention_mask,position_ids,past_key_values.{i}.{key,value}[1, 8, past, 128] (float16) andpast_conv.{i}[1, 3, 6656] (float32: the last 3 inputs of the key, value, post-attention and post-MoE convolutions); outputslogits,present.{i}.*,present_conv.{i}. logitsare before the final soft cap: apply30 * tanh(logits / 30)before sampling, as Quick Inference does.- Activations and the KV cache are float16; the residual stream, norms, convolutions, residual attentions, message gates and the router run in float32.
These are modified files: their outputs are close to, but not identical to, the original model's.
Licence
Apache 2.0, as the original. Thinking Machines' acceptable use policy applies to the model.
- Downloads last month
- 19
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for danyalmalik/Inkling-2-Mini-ONNX-WebGPU
Base model
thinkingmachines/Inkling-2-Mini