2026-08-18 14:23:55 -07:00
|
|
|
apiVersion: serving.kserve.io/v1beta1
|
|
|
|
|
kind: InferenceService
|
|
|
|
|
metadata:
|
|
|
|
|
annotations:
|
|
|
|
|
serving.kserve.io/deploymentMode: RawDeployment
|
|
|
|
|
labels:
|
|
|
|
|
app.kubernetes.io/name: llm-reasoning
|
|
|
|
|
app.kubernetes.io/part-of: llm-serving
|
|
|
|
|
name: reasoning
|
|
|
|
|
namespace: llm-serving
|
|
|
|
|
spec:
|
|
|
|
|
predictor:
|
|
|
|
|
containers:
|
|
|
|
|
- args:
|
2026-08-21 16:39:33 -07:00
|
|
|
# bnb-4bit retired: no int4 tensor cores on sm70/V100, dequant-then-
|
|
|
|
|
# matmul is two slow kernel launches instead of one fused int4 GEMM,
|
|
|
|
|
# decode crawled at 2.5-10 tok/s regardless of TP/PP. Switched to
|
|
|
|
|
# JunHowie/Qwen3-32B-GPTQ-Int4 -- same dense Qwen3-32B weights, same
|
|
|
|
|
# hermes/qwen3 parser stack (no narration-bug risk, same as before),
|
|
|
|
|
# only the quant format changes. Plain (non-Marlin) GPTQ kernel is
|
|
|
|
|
# confirmed Volta-compatible; Marlin needs sm80+ and vLLM would try
|
|
|
|
|
# to auto-upgrade to it, so --quantization is pinned explicitly to
|
|
|
|
|
# `gptq` to force the plain kernel. Verified checkpoint size: 19.34GB
|
|
|
|
|
# (summed from the real safetensors index, not bits-per-param math).
|
|
|
|
|
# max-model-len=131072 is Qwen3-32B's real ceiling (config.json YaRN:
|
|
|
|
|
# factor=4.0, original_max_position_embeddings=32768) -- 200k was
|
|
|
|
|
# asked for but exceeds this architecturally regardless of VRAM.
|
|
|
|
|
# KV cache math: 256KB/token total (64 layers, 8 KV heads, 128
|
|
|
|
|
# head_dim, fp16), PP=2 splits both weights and KV load ~evenly, so
|
|
|
|
|
# each GPU carries ~9.67GB weights + ~128KB/token KV. At
|
|
|
|
|
# gpu-memory-utilization=0.90 (28.8GB/GPU usable), that leaves
|
|
|
|
|
# ~19.1GB/GPU for KV cache -> ~156k tokens/GPU capacity, comfortably
|
|
|
|
|
# above the 131072 target with room to spare -- the old
|
|
|
|
|
# OffloadingConnector CPU-DRAM spillover (tuned for the previous
|
|
|
|
|
# model's much smaller 16384 context) is no longer needed and is
|
|
|
|
|
# dropped. Staying on PP=2 and vLLM 0.11.0 (no version bump needed,
|
|
|
|
|
# this checkpoint only requires vllm>=0.9.2) -- plain GPTQ has no
|
|
|
|
|
# TP>1 restriction unlike bnb, so tensor-parallel-size=2 is worth
|
|
|
|
|
# trying later, but not risking a parallelism-strategy change in the
|
|
|
|
|
# same rollout as the quant+context-length change.
|
2026-08-21 16:42:39 -07:00
|
|
|
# This GPTQ requant's own config.json ships max_position_embeddings=
|
|
|
|
|
# 40960 and rope_scaling=None -- confirmed directly (curl'd the raw
|
|
|
|
|
# config.json), the base Qwen3-32B repo's YaRN block did NOT carry
|
|
|
|
|
# over during quantization. Re-applying it explicitly here restores
|
|
|
|
|
# the same math the base model documents (32768 * 4.0 = 131072);
|
|
|
|
|
# without this, --max-model-len=131072 fails ModelConfig validation
|
|
|
|
|
# against the checkpoint's own (unscaled) 40960 ceiling.
|
2026-08-21 16:39:33 -07:00
|
|
|
- --model=JunHowie/Qwen3-32B-GPTQ-Int4
|
2026-08-18 14:23:55 -07:00
|
|
|
- --served-model-name=reasoning
|
2026-08-21 16:39:33 -07:00
|
|
|
- --quantization=gptq
|
2026-08-19 18:34:15 -07:00
|
|
|
- --dtype=float16
|
2026-08-18 14:23:55 -07:00
|
|
|
- --kv-cache-dtype=auto
|
2026-08-21 16:42:39 -07:00
|
|
|
- --rope-scaling={"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":32768}
|
2026-08-18 14:23:55 -07:00
|
|
|
- --tensor-parallel-size=1
|
2026-08-21 16:23:07 -07:00
|
|
|
- --pipeline-parallel-size=2
|
2026-08-21 16:39:33 -07:00
|
|
|
- --max-model-len=131072
|
2026-08-18 14:23:55 -07:00
|
|
|
- --gpu-memory-utilization=0.90
|
2026-08-19 18:20:34 -07:00
|
|
|
- --max-num-seqs=4
|
2026-08-18 14:23:55 -07:00
|
|
|
- --enable-chunked-prefill
|
|
|
|
|
- --enable-prefix-caching
|
2026-08-19 18:40:15 -07:00
|
|
|
# qwen3 is vLLM's dedicated reasoning parser for this family's <think>
|
|
|
|
|
# blocks.
|
|
|
|
|
- --reasoning-parser=qwen3
|
|
|
|
|
# hermes is the documented tool-call parser for general (non-Coder)
|
|
|
|
|
# Qwen3 models -- native chat template support, not narrated text.
|
2026-08-18 20:50:21 -07:00
|
|
|
- --enable-auto-tool-choice
|
2026-08-18 20:56:40 -07:00
|
|
|
- --tool-call-parser=hermes
|
2026-08-18 14:23:55 -07:00
|
|
|
- --host=0.0.0.0
|
|
|
|
|
- --port=8080
|
|
|
|
|
env:
|
|
|
|
|
- name: VLLM_USE_FLASHINFER_SAMPLER
|
|
|
|
|
value: '0'
|
|
|
|
|
- name: VLLM_ATTENTION_BACKEND
|
|
|
|
|
value: TRITON_ATTN
|
|
|
|
|
- name: HF_HOME
|
|
|
|
|
value: /mnt/models
|
|
|
|
|
image: vllm/vllm-openai:v0.11.0@sha256:014a95f21c9edf6abe0aea6b07353f96baa4ec291c427bb1176dc7c93a85845c
|
|
|
|
|
name: kserve-container
|
|
|
|
|
ports:
|
|
|
|
|
- containerPort: 8080
|
|
|
|
|
protocol: TCP
|
|
|
|
|
readinessProbe:
|
|
|
|
|
httpGet:
|
|
|
|
|
path: /health
|
|
|
|
|
port: 8080
|
|
|
|
|
periodSeconds: 10
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpu: '16'
|
2026-08-19 18:34:15 -07:00
|
|
|
memory: 36Gi
|
2026-08-21 16:23:07 -07:00
|
|
|
nvidia.com/gpu: '2'
|
2026-08-18 14:23:55 -07:00
|
|
|
requests:
|
|
|
|
|
cpu: '8'
|
2026-08-19 15:02:28 -07:00
|
|
|
memory: 12Gi
|
2026-08-21 16:23:07 -07:00
|
|
|
nvidia.com/gpu: '2'
|
2026-08-18 14:23:55 -07:00
|
|
|
startupProbe:
|
|
|
|
|
failureThreshold: 80
|
|
|
|
|
httpGet:
|
|
|
|
|
path: /health
|
|
|
|
|
port: 8080
|
|
|
|
|
periodSeconds: 15
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- mountPath: /mnt/models
|
|
|
|
|
name: models
|
|
|
|
|
- mountPath: /dev/shm
|
|
|
|
|
name: shm
|
|
|
|
|
deploymentStrategy:
|
|
|
|
|
type: Recreate
|
2026-08-21 16:23:07 -07:00
|
|
|
maxReplicas: 1
|
|
|
|
|
minReplicas: 1
|
2026-08-18 14:23:55 -07:00
|
|
|
nodeSelector:
|
|
|
|
|
kubernetes.io/hostname: worker-1
|
|
|
|
|
runtimeClassName: nvidia
|
|
|
|
|
volumes:
|
|
|
|
|
- name: models
|
|
|
|
|
persistentVolumeClaim:
|
|
|
|
|
claimName: llm-models
|
|
|
|
|
- emptyDir:
|
|
|
|
|
medium: Memory
|
|
|
|
|
sizeLimit: 2Gi
|
|
|
|
|
name: shm
|
|
|
|
|
|