--- library_name: optimum-rbln license: gemma pipeline_tag: image-text-to-text base_model: - google/gemma-4-31B-it tags: - gemma4 - multimodal - rbln - ca25 - bf16 --- # Gemma4-31B-RBLN-0.12.0 `google/gemma-4-31B-it` (multimodal, image-text-to-text), original bf16 weights, pre-compiled for Rebellions RBLN-CA25 NPUs with `optimum-rbln` 0.12.0 and ready to serve with `vllm-rbln`. This repository contains the compiled artifact only. RBLN NPUs and the RBLN SDK are required to run it. ## Hardware and software | Component | Configuration | |---|---| | NPU | 16× RBLN-CA25 (language model: 16 devices; vision tower and multimodal projector: device 0, shared) | | Compiler | `rebel-compiler==0.12.0` | | Runtime | `optimum-rbln==0.12.0`, `vllm-rbln` 0.12.0 (image `rbln-serve:0.12.0-ubuntu24.04-py3.12`, vLLM 0.30.0) | | Precision | bf16 weights and activations (no quantization) | ## Compile configuration | Option | Value | |---|---| | `max_seq_len` | 262,144 | | `batch_size` | 8 | | `decoder_batch_sizes` | `[1, 2, 4, 8]` | | `attn_impl` / `kvcache_partition_len` | `flash_attn` / 16,384 | | `cache_impl` / `sliding_window` | `hybrid` / 1,024 | | `prefill_chunk_size` | 128 | | `kvcache_num_blocks` | 28 (458,752 shared KV tokens) | | Vision | 1 device, `image_prefill_384` | The SDK estimator (`memory_budget=0.9`) proposed 35 blocks, which did not fit at runtime on 16× RBLN-CA25 (15.7 GiB each): Gemma 4 global-attention layers have 4 KV heads, so each 16,384-token block costs about 0.31 GiB per device regardless of the device count. 28 blocks leave about 1 GiB of headroom on device 0 (which also hosts the vision tower). Shorter requests can use the compiled dynamic batches up to batch 8. ## Serving ```bash vllm serve \ --max-num-seqs 8 \ --max-num-batched-tokens 128 \ --enable-chunked-prefill \ --no-enable-prefix-caching \ --enable-auto-tool-choice \ --tool-call-parser gemma4 \ --reasoning-parser gemma4 ``` Notes: - Do not pass `--tensor-parallel-size`; the 16-device split is baked into the compiled language model and `vllm-rbln` runs it with TP=1. - Keep `--max-num-seqs 8` and `--max-num-batched-tokens 128` aligned with the compiled decoder and prefill graphs. - Prefix caching must remain disabled (Gemma4 multi-group hybrid KV caches). - Thinking is controlled per request with `reasoning_effort` (any value enables it; Gemma 4 thinking is on/off) or `chat_template_kwargs={"enable_thinking": true}`. Parsed reasoning is returned separately from the final response content. - The artifact accepts one image per prompt with the compiled vision profile. ## Measured on 16× RBLN-CA25 (2026-12-01) Served with `vllm-rbln` 0.12.0 (same image as the compiler) through an OpenAI-compatible gateway, streaming, `max_tokens` 400, temperature 0, the same prompt for every request: | Concurrency | Wall time | Output tokens | Throughput | |---|---:|---:|---:| | 1 | 8.4 s | 400 | 47.4 tok/s | | 8 | 17.6 s | 3,200 | 181.3 tok/s | The same recipe on 8 devices (`max_seq_len` 131,072, 16 KV blocks) measured 26.4 tok/s at concurrency 1 and 121.8 tok/s at concurrency 8. ## Provenance Compiled 2026-12-01 on a Kubernetes node with the `rbln-serve:0.12.0` image from the unmodified `google/gemma-4-31B-it` checkpoint. This 16-device build loads and serves on 16× RBLN-CA25 with `vllm-rbln` 0.12.0 (device 0 hosts the vision tower). An earlier 35-block build from the SDK estimator failed engine initialization with `SYS_EBUSY: Lack of device memory`; 28 blocks is the validated setting. ## License Derived from `google/gemma-4-31B-it`. Use is subject to the Gemma Terms of Use.