Inkling-2-Mini-AWQ-W4A16-ASYM-INT4

English | Русский

4-bit AWQ quant of thinkingmachines/Inkling-2-Mini (26.4B total / 3.4B active, looped MoE, text + image in → text out), made with llm-compressor in the compressed-tensors pack-quantized format.

The original checkpoint ships its experts in NVFP4 / MXFP8, which only run natively on Hopper/Blackwell. This quant stores them as plain INT4 (W4A16, asymmetric, group 128) — the format Ampere/Ada GPUs (RTX 30xx / 40xx, A100, L40) have fast kernels for.

Runtime status — read this first (November 2026).

  • vLLM: not loadable in released vLLM yet. vLLM's Inkling 2 implementation (vllm/models/inkling2) only accepts its own NVFP4/MXFP8 expert format and requires SM90+. Two open PRs fix this:

    With both applied, this checkpoint runs on 2× RTX 3090 (TP2): wikitext-2 PPL 7.499, gsm8k 5-shot strict-match 0.816.

  • transformers: works, through the open PR huggingface/transformers#51050 plus the small inkling_w4a16.py loader in this repo (see below). transformers decompresses INT4 back to BF16 on load, so it gives correct outputs but no VRAM savings.

In short: the weights are verified correct; the fast-kernel path in vLLM works but is not merged yet.

Inkling 2 Mini benchmarks

Benchmarks above are the authors' numbers for the original checkpoint, not this quant. Quant quality measurements are below.

What's inside

Scheme W4A16_ASYM (asymmetric, zero point), weight-only
Group size 128
Format compressed-tensors / pack-quantized, int4 packed into int32
Quantized all routed experts: 24 layers × 128 experts × gate/up/down_proj = 9 216 Linear (24.4B params)
Kept in BF16 attention, loop message gates, router, embeddings, lm_head, vision tower, MTP/DSpark head
Calibration 64 samples × ≤1024 tokens: HuggingFaceH4/ultrachat_200k (48) + ise-uiuc/Magicoder-Evol-Instruct-110K (16), via the chat template
Size 17.2 GB incl. the 0.6 GB MTP head (original NVFP4/MXFP8: 20.2 GB, BF16-equivalent: ~53 GB)

The quantized set is the same one the authors chose for NVFP4/MXFP8: only the experts are low-precision, everything else stays BF16. mtp.safetensors (the DSpark speculator, BF16) is copied unchanged from the original repo.

Source weights

There is no BF16 release of Inkling 2 Mini. The experts were dequantized from the official NVFP4/MXFP8 checkpoint to BF16 (exactly, by transformers' loader) and then re-quantized to INT4. INT4 g128 is therefore applied on top of the precision already lost to NVFP4; compare the measured numbers below to the original checkpoint, not to a hypothetical BF16 model.

How the AWQ recipe was adapted to this architecture

Inkling 2 Mini is not a standard decoder, and stock llm-compressor AWQ does not work on it out of the box. What was changed (full script: quantize_inkling.py):

  1. Experts linearized. transformers stores the 128 experts as fused 3D tensors; they are split into per-expert gate_proj / up_proj / down_proj Linear layers so llm-compressor can quantize them. The generic llm-compressor linearizer would call SiLU — Inkling uses a softcapped SwiGLU (tanh softcaps on gate and up), so the original activation module is kept. Linearized and fused forwards were checked to be bit-identical.
  2. Only one valid smoothing pair. AWQ moves scale between a layer and the layers that consume its output, which is exact only if nothing non-linear sits in between:
    • post_attention_layernorm → experts.*.{gate,up}_proj + the router (mlp.gate): used. The router reads the same normalized input, so it is rescaled together with the experts and routing stays exactly unchanged.
    • up_proj → down_proj: not used — up goes through a tanh softcap, so smoothing across it would change the function. down_proj is quantized with plain min-max g128.
  3. Looped layers smoothed once, over all three passes. Layers 6–17 run three times per token with shared weights. llm-compressor's sequential pipeline sees each of them three times and would smooth (and compute quantization parameters) after the first pass, then crash or re-apply on the next. Here smoothing and qparams are deferred to the third pass, so the activation statistics and the AWQ loss cover all three passes and every weight is scaled exactly once.
  4. Logit softcap made traceable during calibration (llm-compressor puts lm_head on meta).

Quality check

Measured on gpubox (2× RTX 3090), both models run in transformers with identical code.

Original (NVFP4/MXFP8 → BF16) This quant (INT4)
wikitext-2 perplexity (32 736 tokens, 1024-token windows) 7.441 7.496 (+0.75%)
Top-1 next-token agreement with the original — 94.3%

Sample generations (greedy, default chat template) are in eval/. Both checkpoints answer an English explanation prompt and a Russian coding prompt correctly, with near-identical wording and the same code.

Usage (transformers)

Needs transformers with Inkling 2 Mini support (until it is released: pip install "git+https://github.com/huggingface/transformers@refs/pull/51050/head") and compressed-tensors, plus torchvision for the image processor (AutoProcessor).

import torch
from huggingface_hub import hf_hub_download
from transformers import AutoProcessor

repo = "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4"
import importlib.util, sys
spec = importlib.util.spec_from_file_location("inkling_w4a16", hf_hub_download(repo, "inkling_w4a16.py"))
inkling_w4a16 = importlib.util.module_from_spec(spec); spec.loader.exec_module(inkling_w4a16)

model = inkling_w4a16.load(repo, dtype=torch.bfloat16, device_map="cpu")
processor = AutoProcessor.from_pretrained(repo)

messages = [{"role": "user", "content": [{"type": "text", "text": "Why is the sky blue?"}]}]
inputs = processor.apply_chat_template(messages, tokenize=True, add_generation_prompt=True,
                                       return_dict=True, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(out[0][inputs["input_ids"].shape[-1]:]))

inkling_w4a16.load() does three things around from_pretrained: swaps the fused experts for a per-expert module so the packed weights load as-is, and works around two loader bugs (compressed-tensors 0.19 sizes the asymmetric zero point unpacked on the meta device; the compressed-tensors quantizer in transformers breaks Inkling's lm_head unpad converter).

Load with device_map="cpu" and move/dispatch afterwards: with device_map="auto", accelerate plans placement by the packed INT4 sizes and then runs out of memory when the weights are decompressed.

Prompting, reasoning effort and tool calling are the same as for the base model — see its model card.

Reproducibility

quantize_inkling.py (the full script), recipe.yaml (written by llm-compressor) and eval_inkling.py are included. Versions: llm-compressor 0.14.0.1, compressed-tensors 0.19.0, torch 2.14.0+cu130, transformers PR #51050 at a10ebc3c1c44.

Caveats

  • Not validated on the authors' agentic / coding / vision benchmarks — only perplexity, next-token agreement and generation coherence were measured.
  • The vision tower is untouched (BF16); image quality should track the base model, the expected degradation is in the text experts.
  • License: Apache 2.0, same as the base model. Use is subject to the base model's acceptable use policy.
Downloads last month
218
Safetensors
Model size
26B params
Tensor type
F32
·
I32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4

Quantized
(215)
this model

Collection including Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4