BerryLM-OS-FP8

BerryLM-OS with block-wise FP8 weights for vLLM and SGLang: 17.8 GiB of weights instead of 34 GiB. Weights are float8 e4m3 with one scale per 128 × 128 block; activations are quantized on the fly. The quantization is calibration-free: each block is scaled by its absolute maximum.

FP8: the routed and shared experts and the projections of the attention and linear-attention layers, 95.8 % of the parameters. Kept in bf16: embeddings and the LM head, the norms, the MoE router and the shared-expert gate, the decay gate and the beta projection of the linear-attention layers, their short convolutions, and the depth-mixing (AttnRes) parameters.

Serving

vLLM (until vllm-project/vllm#57384 is merged):

git clone https://github.com/vllm-project/vllm.git && cd vllm
git fetch origin pull/57384/head
git checkout -b berrylm 7060026c613db283d70efc250f05ab6bbced9317
VLLM_USE_PRECOMPILED=1 VLLM_PRECOMPILED_WHEEL_COMMIT=cb6458c5ce61632524c0447d49790725c1e1d9a2 pip install -e .
vllm serve rwb-ai/BerryLM-OS-FP8 --reasoning-parser berrylm --tool-call-parser berrylm --enable-auto-tool-choice

SGLang (until sgl-project/sglang#55435 is merged):

git clone https://github.com/sgl-project/sglang.git && cd sglang
git fetch origin pull/55435/head
git checkout -b berrylm ebedc568181c5290660b3295666382556976ff05
pip install -e "python"
python -m sglang.launch_server --model-path rwb-ai/BerryLM-OS-FP8 --port 8000 \
  --reasoning-parser berrylm --tool-call-parser berrylm

Installing SGLang from source builds its Rust extensions: have a Rust toolchain installed, or set SGLANG_BUILD_RUST_EXTS=none for the install.

Both servers read the sampling defaults from generation_config.json (thinking: temperature 0.8, top_p 0.95, top_k 20; for direct answers pass "chat_template_kwargs": {"enable_thinking": false} and use temperature 0.7, top_p 0.8, top_k 20) and split the reasoning from the answer. Both commands above serve on port 8000:

curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "rwb-ai/BerryLM-OS-FP8",
  "messages": [{"role": "user", "content": "Сколько будет 17 * 23?"}],
  "max_tokens": 4096,
  "chat_template_kwargs": {"enable_thinking": false}
}'

transformers: use BerryLM-OS. This repository stores the routed experts one by one, the layout the FP8 loaders of vLLM and SGLang read; the transformers code of the model keeps them fused and cannot load it, so the repository ships no modeling code and a transformers load stops with an error.

Hardware

The weights take 17.8 GiB; the KV cache of the full-attention layers costs about 20 KB per token and the linear-attention state 60 MiB per running sequence. vLLM reserves one state block per --max-num-seqs slot (1024 by default). On an 80 GB card the commands above work as written; on a smaller one pass a lower --max-num-seqs and, if the context does not fit, a lower --max-model-len (vLLM) / --context-length (SGLang). Measured: under a 22 GiB memory cap (a 24 GB card) vllm serve ... --max-model-len 16384 --max-num-seqs 16 starts and serves. FP8 matrix multiplications need a GPU with compute capability 8.9 or newer.

FP8 vs bf16

Thinking mode with the shipped sampling, the same evaluation harness and serving stack as the bf16 card.

Benchmark Mode BerryLM-OS
bf16
BerryLM-OS
FP8
General knowledge and reasoning
MMLU-ProX en+ru
pass@1
think80.780.8
GPQA
pass@1
think79.077.3
Math
AIME 2026
pass@1
think90.089.4
HMMT Feb 2025
pass@1
think80.881.7
Instruction following
IFEval
prompt-level strict
think93.693.5
Multi-IF en+ru
mean of 3 turns
think85.685.9
IFBench
strict / loose mean
think73.373.4
Russian
WMT24++ en→ru1
COMET
think85.385.1

1 WMT24++: scored by the XCOMET-XXL metric model, not an LLM judge.

Every difference is within two points. The other rows of the bf16 card were not re-measured in FP8.

Next-token log-probabilities stay close to the bf16 model: on 6–8k-token documents the mean absolute difference to the bf16 reference is 0.13 nats per token (0.08 for the bf16 weights served by the same engines).

Serving throughput against bf16 on the same GPU, with each engine's default settings (tensor parallel 1, vllm bench serve with random prompts, output tokens per second at 16 and 64 concurrent requests):

workload vLLM SGLang
1k-token prompt → 512 tokens +20 … +23 % +26 … +27 %
1k-token prompt → 2k tokens +28 % +22 … +26 %
8k-token prompt → 512 tokens +11 … +13 % +28 … +33 %

A single request decodes 4–14 % faster on vLLM and 14–16 % faster on SGLang. Under load the first token comes up to 13 % later than with bf16 on vLLM (its default Triton kernel for the FP8 experts is slower on large prefill batches) and earlier on SGLang. For long prompts with short answers, --moe-backend deep_gemm makes vLLM's first token on 8k-token prompts about 30 % faster than the default FP8 setting, at the cost of a fifth to a third of the throughput on short prompts. Besides the speed, the weights take half the memory: room for a longer context and more concurrent requests, or a smaller GPU.

License

Released under the Apache License 2.0.

Downloads last month
6
Safetensors
Model size
18B params
Tensor type
BF16
·
F8_E4M3
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for rwb-ai/BerryLM-OS-FP8

Quantized
(2)
this model