Gemma-4-31B-it

Gemma4ForConditionalGeneration is a dense multimodal model. This validation covers its text-generation serving path: the text backbone has 60 layers, hidden size 5,376, 32 attention heads / 16 KV heads, a 262,144-token vocabulary, and a native 262,144-token context window. The validated deployment is P4+D4: one 4-card Prefill engine and one 4-card Decode engine, coordinated by KServe LLMInferenceService and the InferNex Bridge. It is an 8 × Ascend 910B3 64 GB composite service, not a 4-card replica.

Model identity

FieldValue
Publisher / modelGoogle / google/gemma-4-31B-it
Architecturegemma4 / Gemma4ForConditionalGeneration; dense multimodal model, validated here for text generation
Text backbone60 layers; hidden size 5,376; 32 attention heads / 16 KV heads
Context / vocabulary262,144 / 262,144
PrecisionBF16

Validated hardware × stack

PlatformEngineVersion / configurationStatus
Ascend 910B3 64 GB × 8 across 2 nodesvLLM-Ascendquay.io/ascend/vllm-ascend:nightly-main-openeuler-0721 (vLLM 0.25.1, CANN 9.0.1)P4+D4 closed-loop AIPerf validation
NOTE

This is a dated nightly-main snapshot, retained because it is the exact image used by the validated deployment. It is not a claim that the tag is the newest vLLM-Ascend build.

Model configuration

ComponentSetting
PrefillTP=4 on one 910B3 node; max-num-batched-tokens=8192; eager execution
DecodeTP=4 on the second node; max-num-batched-tokens=128; FULL_DECODE_ONLY graph capture
P/D handoffMooncakeConnectorV1, Ascend Direct KV transfer, TP4/TP4 contract
Capacity guardrailmax-num-seqs=96 on both engines; gpu-memory-utilization=0.9
Prefix cachedisabled in the engine; the workload uses explicit P/D KV transfer
Schedulerone fixed P/D pair; metrics-based P/D scoring without a tokenizer sidecar
Tool calls--enable-auto-tool-choice --tool-call-parser gemma4

Why P4+D4

The earlier aggregated TP4 deployment and P4+D4 are different resource envelopes. The aggregate service uses four NPUs and mixes long Prefill work with Decode; P4+D4 uses eight NPUs and removes Prefill dynamic steps from the Decode process. In the earlier capacity study, aggregate TP4 reached only 2.554 completed RPS on the 512/256 chatbot workload at target rate 3 over 900 seconds, with Running=104 and Waiting=294 at the end. P4+D4 is therefore the production candidate, but its throughput must never be presented as a four-card aggregate result.

Deploy

The deployment spec is a self-contained KServe LLMInferenceService template with a TP4 Decode template, a TP4 Prefill template, InferNex router/scheduler, InferencePool, and the external route.

SpecFile
P4+D4, KServe + InferNex Bridgegemma4-31b-it-pd-p4d4-llmisvc.yaml

Before applying it, set the namespace, the two node names, the model PVCs, and registry references for your cluster. The manifest assumes the P/D pair has equal TP size and that the two engines can use Ascend Direct transport.

base=https://raw.githubusercontent.com/alauda/aml-docs/master/docs/en/plan/validated_models/assets/gemma4-31b-it
kubectl apply -f $base/gemma4-31b-it-pd-p4d4-llmisvc.yaml

# Internal KServe ingress (no MaaS API key):
curl -s http://<gateway>/<namespace>/gemma4-31b-it-pd/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"google/gemma-4-31B-it","messages":[{"role":"user","content":"hello"}]}'

Benchmark results

Closed-loop aiperf 0.7.0, driven directly through the P/D proxy. Both scenarios run 480 requests per concurrency tier at concurrency 8 / 16 / 32, with warmup equal to the tier's concurrency. TTFT / E2E are seconds, ITL is ms, Decode is output-only token throughput, and TPS is input-plus-output token throughput.

Scenario ① — fixed-length system-prompt reuse (ISL 8,013 / OSL 128)

ConcurrencyTTFT avg (s)ITL avg (ms)E2E avg (s)Decode (tok/s)Requests/sTPS (in+out)
84.02329.117.720131.661.038,373.74
1611.64229.1015.338131.521.038,365.16
3226.45829.0930.153131.641.038,372.31

Scenario ② — multi-turn dialogue (average ISL 17,933 / OSL 128)

ConcurrencyTTFT avg (s)ITL avg (ms)E2E avg (s)Decode (tok/s)Requests/sTPS (in+out)
814.37728.5518.00356.440.447,963.44
1632.02628.5635.65456.480.447,970.08
3266.37228.5469.99656.490.447,970.40

Every tier completed 480 requests with zero errors. Throughput and ITL are flat from concurrency 8 onward in both scenarios, while TTFT grows with concurrency. The service is Prefill-capacity-bound at roughly 8k input-dominated tokens/s: increasing average ISL from 8,013 to 17,933 lowers request throughput from 1.03 to 0.44 requests/s, while total token throughput changes by only about 5%. Decode ITL remains stable near 29 ms.

NOTE

The benchmark is intentionally sent to the P/D proxy instead of MaaS: at measurement time the cluster's MaaS backend still selected the old aggregated TP4 service. This preserves a single, unambiguous P4+D4 topology for the published figures. Server metrics and GPU telemetry were disabled because AIPerf 0.7.0 cannot parse this vLLM metrics histogram; the published values come from the completed request records and CSV export.

The delivered scheduler intentionally omits the tokenizer plugin. This topology has only one fixed Prefill/Decode pair and no prefix-cache producer, so tokenization adds no routing choice. The tested Hermes Router 26.6.0-rc.3 imposes a 5-second tokenizer initialization deadline, while this Gemma tokenizer took 17.59 seconds to cold-load. A future multi-pair, prefix-aware deployment should first use a router build with a configurable initialization deadline of at least 30 seconds, then restore the tokenizer plugin.