Clef, int8 W8A8 (SmoothQuant)

This is a community quantization and is not an official Cloudflare release.

An 8-bit integer quantization of Cloudflare/clef for accelerators whose fast low-precision matrix path is int8. The 256 large projections of the language model (attention q/k/v/o, linear-attention in/out projections, MLP gate/up/down) are stored as int8; everything else (embeddings, norms, LM head, vision tower, joint head) is the released bf16, unchanged.

29 GB instead of 51 GB.

Two things on this page come from the Hub, not from this card:

  • Standard loaders (Transformers, vLLM, SGLang) cannot load this repository as it is; see Files for what an engine has to implement.
  • The sidebar's parameter count (about 3B, BF16) covers only the tensors that were left unquantized. The model has the same 27B parameters as the base; the other 24B are the int8 tensors in int8-*.safetensors, which the Hub does not count.

Scheme

  • Weights: symmetric int8, one scale per output channel, round to nearest.
  • Activations: symmetric int8, one scale per token, computed at run time (dynamic; nothing to calibrate at inference).
  • SmoothQuant scale migration, alpha = 0.6: a per-input-channel factor s divides the activations and multiplies the weights (X/s . Ws == X.W), moving dynamic range off the activations. The factors come from per-channel activation maxima recorded on a small synthetic prompt set.

Files

File Content
int8-0000N.safetensors per layer <name>.w8 int8 [in, out], <name>.scale fp32 [out], <name>.recip fp32 [in] (= 1/s)
int8_manifest.json layer list, shapes, shard of each layer
model-*.safetensors, model.safetensors.index.json the released bf16 tensors that were not quantized
dequantize.py reference: rebuild an approximate bf16 weight for any layer
other files unchanged from the base repository

Layer names are <index>_<in>x<out>, in model-definition order: index 56 is the first language-model block, four projections per block in the order attention/linear-attention input, attention/linear-attention output, MLP gate+up (stacked), MLP down. dequantize.py maps them to the base model's tensor names.

A layer computes y = ((round(x * recip / a) ) @ w8) * a * scale, with a = max|x * recip| / 127 per token. The bf16 weight it approximates is W[out, in] = w8[in, out] * scale[out] * recip[in].

This layout is not a standard transformers quantization format: loading it for int8 inference needs an engine that implements the layer above. dequantize.py gives a bf16 model that reproduces the weight rounding (not the activation rounding) for use anywhere else.

Fidelity against the bf16 model

Measured on the 12 public tasks of Level5Tech/clef-quant-bench (31,275 questions), built with that repository's dataset script. A flip is a question whose top answer differs from the bf16 model's. The FP8 and NVFP4 rows are that benchmark's published results (CC BY 4.0), rescored on the same questions; all rows are compared against its published bf16 reference outputs.

all 12 tasks six easier tasks (21,174) six harder tasks (10,101)
flipped accuracy flipped accuracy flipped accuracy
a second bf16 engine (noise floor) 0.50% -0.01 pp 0.29% -0.02 pp 0.93% +0.02 pp
FP8 (published) 1.66% -0.11 pp 0.94% -0.04 pp 3.17% -0.24 pp
this checkpoint 2.08% -0.08 pp 1.22% -0.13 pp 3.88% +0.02 pp
NVFP4, plain (published) 4.80% -0.65 pp 2.83% -0.52 pp 8.94% -0.90 pp

Easier tasks: ARC-Challenge, BANKING77, BoolQ, CLINC150, MMLU, When2Call. Harder tasks: ANLI R1-R3, ContractNLI, RAGTruth, SST-5. The accuracy changes of this checkpoint are within noise of zero on every group; it changes more answers than FP8 and fewer than half as many as plain NVFP4.

License

Apache-2.0, following the base model. See LICENSE and NOTICE.

Downloads last month
-
Safetensors
Model size
3B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ptrus/clef-int8-w8a8

Base model

Qwen/Qwen3.8-27B
Finetuned
Cloudflare/clef
Quantized
(47)
this model