MiniCPM-V-4.7-35B-A3B · NVFP4 (W4A4, FP4)
4-bit quantization of openbmb/MiniCPM-V-4.7-35B-A3B for vLLM serving. Quantized by axteam.
Revision 2026-11-01 (rebuilt): The MoE router (
mlp.gate) and the shared-expert gate are now compensated during AWQ smoothing (checked on every layer against the original: the router rescale matches the norm rescale, median per-channel difference below 2%). Channels whose original norm gain is zero are now left out of AWQ's scale normalization, so the smoothed norms keep their BF16 precision (checked: in every smoothed norm, half a BF16 step relative to the gain is below 1%, median over channels). Earlier uploads of this repo: the first upload left the router and the shared-expert gate uncompensated, so tokens were routed to different experts than in the original; the first and second uploads lost norm precision in layers 2–5 because of a zero-gain channel (the stored gains there could only be represented to about ±7–10%: half a BF16 step relative to the gain, median over channels). If you downloaded this repo before 2026-11-01 10:56:00 UTC (revision939c788), download it again. The benchmark and fidelity figures on this card were measured on the rebuilt files.
| Base model | openbmb/MiniCPM-V-4.7-35B-A3B |
| Method | NVFP4 (W4A4, FP4) |
| Format | compressed-tensors nvfp4-pack-quantized |
| Weights / activations | W4A4 — FP4 (E2M1) weights group 16 + FP8 scale, FP4 activations |
| Architecture | MoE (Qwen3.5-MoE backbone) · vision · multimodal |
| Size on disk | ~23.6 GB |
| Calibration | 256 samples |
| License | Apache-2.0 |
Quantization details
- Scheme — W4A4 — FP4 (E2M1) weights group 16 + FP8 scale, FP4 activations, stored as compressed-tensors
nvfp4-pack-quantized. - Kept in BF16 — the vision tower & vision-text merger, token embeddings, the LM head, all RMSNorms, the MoE routers (
mlp.gate,shared_expert_gate), and every Gated-DeltaNet linear-attention projection (linear_attn.*, FP4 is too coarse for them) — about 7% of all parameters in this build. Quantized: the full-attention and MoE/MLP projections. - Post-training quantization (no retraining). Tokenizer /
chat_templateidentical to the original.
Benchmarks (measured)
Every column was measured with the same harness and settings — lm-evaluation-harness on vLLM, greedy, completion-style prompts without a chat template (0- or 5-shot, as listed in each row). MMLU here is lm-eval's generative variant (mmlu_generative: the model writes the answer letter and only an exact match on the first line counts), so it is not directly comparable with MMLU scores measured another way (e.g. log-likelihood scoring). Percentages are recovery vs. the BF16 original.
| Benchmark | BF16 (original) | FP8-dynamic | AWQ-8bit | NVFP4A16 | NVFP4 (this repo) | AWQ-4bit |
|---|---|---|---|---|---|---|
| MMLU (5-shot, generative) | 85.65 | 85.61 (100.0%) | 85.71 (100.1%) | 85.76 (100.1%) | 85.41 (99.7%) | 85.31 (99.6%) |
| GSM8K (5-shot, strict) | 90.14 | 89.69 (99.5%) | 89.23 (99.0%) | 90.75 (100.7%) | 90.22 (100.1%) | 90.52 (100.4%) |
| ARC-Challenge (0-shot) | 60.92 | 61.01 (100.1%) | 61.18 (100.4%) | 60.84 (99.9%) | 61.09 (100.3%) | 62.03 (101.8%) |
| Winogrande (5-shot) | 80.11 | 79.87 (99.7%) | 78.93 (98.5%) | 79.32 (99.0%) | 77.11 (96.3%) | 79.56 (99.3%) |
| KMMLU (5-shot, direct) | 64.95 | 64.77 (99.7%) | 64.78 (99.7%) | 64.65 (99.5%) | 64.38 (99.1%) | 64.67 (99.6%) |
| HAE-RAE (0-shot) | 73.14 | 73.69 (100.8%) | 73.42 (100.4%) | 73.51 (100.5%) | 74.06 (101.3%) | 72.69 (99.4%) |
| Average | 75.82 | 75.77 (99.9%) | 75.54 (99.6%) | 75.80 (100.0%) | 75.38 (99.4%) | 75.80 (100.0%) |
Evaluation (measured)
Fidelity to the BF16 original on an internal mixed English/Korean set (100 prompts: the BF16 original's greedy answers, scored under each build with the same prompts and scoring code). This build was measured on the rebuilt files with vLLM 0.32 on 2026-11-01; the BF16 reference column was measured on 2026-11-01.
| Metric | This model | BF16 original |
|---|---|---|
| Perplexity (lower = closer) | 1.3206 | 1.2063 (+9.5%) |
| Top-1 next-token agreement | 92.1% | 98.1% |
These measure fidelity to the base model, not absolute task scores.
Requirements
| Runtime | vLLM — the architecture is in vLLM ≥ 0.32.0; tested here with vLLM 0.32.0. vLLM 0.32 needs transformers 5.18.x or 5.19.x for this model (5.17 does not know minicpmv4_7); our runs used transformers 5.21.0 installed with --no-deps; the benchmarks and fidelity figures above are text-only — image input fails in that setup (vLLM's MiniCPM-V image processor vs transformers 5.21). Only one image check ran images on this build (2026-11-02, vLLM 0.32.0, with the processor's missing downsample_mode argument filled in with its default for the test only): a synthetic test image (red circle, blue square, the caption "QWEN TEST 2026") was described correctly. |
| vLLM install | vLLM 0.32 itself needs Python 3.11–3.14, torch 2.13 (CUDA 13.0 build, so an NVIDIA driver with CUDA 13 support), transformers ≥5.16.1,<5.20 and compressed-tensors 0.17.0 (both pinned by vLLM; 0.17.0 reads this checkpoint, which was saved with 0.19.0 — do not upgrade it separately). |
| GPU | Full FP4 (W4A4) speed on Blackwell — B200/GB200 (sm100), B300 (sm103), RTX 50xx / RTX PRO 6000 (sm120). Turing–Hopper (sm75–90) fall back to weight-only FP4 (slower, vLLM warns). V100 (sm70) is not supported. (Kernel choice per GPU from vLLM 0.32's selection code; only B200 was run here.) |
| Memory | Weights: 23.6 GB. Add KV cache (grows with context length × concurrent requests) and a few GB for activations / CUDA graphs; use --tensor-parallel-size N when the weights do not fit one GPU. |
| Transformers (without vLLM) | Not loadable correctly by Transformers for this format (AWQ-4bit fails up to 5.22.1; FP4 MoE experts are unsupported) — use vLLM. |
| trust_remote_code | not needed |
Usage (vLLM)
Compatibility (checked 2026-10-31): with vLLM 0.32.0 and Transformers 5.17.0 the server did not start — Transformers does not recognise model type
minicpmv4_7and this repo ships no custom modeling code. Use a Transformers / vLLM release that supports MiniCPM-V 4.7.
Start an OpenAI-compatible server:
vllm serve axteam/MiniCPM-V-4.7-35B-A3B-NVFP4 --max-model-len 32768
Query it:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "axteam/MiniCPM-V-4.7-35B-A3B-NVFP4",
"messages": [{"role": "user", "content": "대한민국의 수도는 어디인가요?"}],
"temperature": 1.0, "top_p": 0.95, "top_k": 20, "max_tokens": 512
}'
Offline inference in Python:
from vllm import LLM, SamplingParams
llm = LLM(model="axteam/MiniCPM-V-4.7-35B-A3B-NVFP4", max_model_len=32768)
params = SamplingParams(temperature=1.0, top_p=0.95, top_k=20, max_tokens=1024)
out = llm.chat([{"role": "user", "content": "Explain model quantization in two sentences."}], params)
print(out[0].outputs[0].text)
# image input (URL or data: URI)
messages = [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://example.com/your-image.png"}},
{"type": "text", "text": "Describe this image."},
]}]
out = llm.chat(messages, params)
print(out[0].outputs[0].text)
Recommended sampling (from the original
generation_config.json):temperature=1.0,top_p=0.95,top_k=20. Thinking mode is off by default in this model's chat template; to turn it on passchat_template_kwargs={"enable_thinking": True}(Pythonllm.chat(..., chat_template_kwargs=...), or"chat_template_kwargs": {"enable_thinking": true}in the request body). Text-only serving: add--limit-mm-per-prompt '{"image": 0, "video": 0}'to skip loading the vision encoder's memory budget.
Reducing KV-cache memory (optional, serve-time)
The KV cache is kept in BF16 by default. KV-cache precision is a runtime choice, independent of the weight quantization above. This is a hybrid model: only its 10 full-attention layers keep a KV cache, while its 30 linear-attention (Gated DeltaNet) layers keep a fixed-size state per request, which --kv-cache-dtype does not change. FP8 halves the full-attention KV cache, so the saving grows with context length and is small for many short requests:
vllm serve axteam/MiniCPM-V-4.7-35B-A3B-NVFP4 --kv-cache-dtype fp8
License
Quantized derivative of openbmb/MiniCPM-V-4.7-35B-A3B (Apache-2.0). Original weights & tokenizer belong to OpenBMB.
한국어 요약
openbmb/MiniCPM-V-4.7-35B-A3B의 NVFP4 (W4A4) 양자화 빌드 · 제작 axteam
개요
| 항목 | 내용 |
|---|---|
| 원본 모델 | openbmb/MiniCPM-V-4.7-35B-A3B |
| 양자화 방식 | NVFP4 (W4A4, 가중치·활성화 FP4) |
| 저장 형식 | compressed-tensors nvfp4-pack-quantized |
| 모델 구조 | MoE (Qwen3.5-MoE 백본) · 멀티모달(비전) |
| 용량 | 약 23.6 GB |
| 보정 데이터 | 샘플 256개 |
양자화 상세
- 가중치: FP4(E2M1), 그룹 크기 16 + 그룹별 FP8 스케일
- 활성화: 실행 시 FP4 (Blackwell FP4 텐서코어에서 가속)
- 양자화 절차: PTQ(학습 후 양자화, 재학습 없음), AWQ 방식 — 보정 데이터로 활성화가 큰 가중치 채널을 찾아 채널별 스케일로 보호한 뒤 FP4로 반올림
- BF16 유지: 비전 타워, 비전-텍스트 투영층(merger), 토큰 임베딩, LM 헤드, 모든 RMSNorm, MoE 라우터(
mlp.gate)와 공유 전문가 게이트(shared_expert_gate), 선형 어텐션(Gated-DeltaNet)의 선형층 전체(linear_attn.*, FP4로는 정밀도 부족) — 전체 파라미터의 약 7% - 양자화 대상: 풀 어텐션 층과 MoE/MLP의 선형층(projection)
- 원본 파일: 토크나이저·chat template은 원본과 동일
품질 (실측)
- 원본 대비 충실도: PPL 1.3206 (원본 1.2063, +9.5%, 낮을수록 원본에 가까움), 다음 토큰 top-1 일치율 92.1% (원본 자체 기준값 98.1%) — 내부 영어·한국어 혼합 프롬프트 100개, 원본(BF16)의 greedy 답변을 기준 텍스트로 측정
- 벤치마크 평균: 75.38 (원본 75.82, 99.4%) — MMLU(생성형)·GSM8K·ARC-Challenge·Winogrande·KMMLU·HAE-RAE 6종 평균, lm-evaluation-harness + vLLM, chat template 없는 완성형 프롬프트(과제별 0·5-shot, 표 참고)·greedy, 모든 빌드를 같은 설정으로 측정
- 한국어 벤치마크: KMMLU 64.38 (원본 64.95, 99.1%) · HAE-RAE 74.06 (원본 73.14, 101.3%)
- MMLU 방식: lm-eval 생성형 변형(
mmlu_generative) — 모델이 답 글자를 생성하고 첫 줄이 정확히 일치해야 정답으로 채점하므로, 다른 방식(예: log-likelihood 채점)으로 잰 MMLU 점수와 직접 비교 불가
요구사항
- 실행 엔진: vLLM 0.32.0 이상(이 구조를 지원하는 첫 버전), 이 빌드는 vLLM 0.32.0에서 실행 확인
- Transformers 버전: vLLM 0.32와 함께 쓰려면 transformers 5.18.x 또는 5.19.x 필요 (5.17은
minicpmv4_7미지원), 실행 확인은 transformers 5.21.0을--no-deps로 설치해 진행, 위 벤치마크·충실도는 텍스트 입력으로 측정 — 이 조합에서는 이미지 입력 실패 (vLLM의 MiniCPM-V 이미지 프로세서와 transformers 5.21 비호환), 이미지는 2026-11-02 점검 1회만 처리기에 빠진downsample_mode인자를 기본값으로 채워 실행(vLLM 0.32.0), 시험 그림(빨간 원·파란 사각형·글자 "QWEN TEST 2026")을 바르게 설명 - vLLM 0.32 설치 조건: Python 3.11~3.14, torch 2.13(CUDA 13.0 빌드, CUDA 13 지원 드라이버 필요), transformers 5.16.1 이상 5.20 미만, compressed-tensors 0.17.0 — transformers·compressed-tensors는 vLLM이 버전을 고정하므로 compressed-tensors를 따로 업그레이드하지 말 것 (이 체크포인트는 0.19.0으로 저장됐지만 0.17.0에서도 로드됨)
- GPU: Blackwell(B200·GB200 sm100, B300 sm103, RTX 50xx·RTX PRO 6000 sm120)에서 FP4(W4A4) 연산 가속, V100(sm70) 미지원 — Turing
Hopper(sm7590)는 가중치 전용 FP4로 자동 전환되어 속도 저하, vLLM 경고 출력 (GPU별 지원 여부는 vLLM 0.32 커널 선택 코드 기준, 실제 실행은 B200에서만 확인) - 메모리: 가중치 23.6 GB + KV 캐시(컨텍스트 길이 × 동시 요청 수에 비례) + 활성화·CUDA graph용 수 GB — GPU 한 장에 다 들어가지 않으면
--tensor-parallel-size N으로 분산 - Transformers로 직접 사용: 불가 — 이 형식은 Transformers로 올바르게 로드되지 않음 (AWQ-4bit는 5.22.1까지 실패, FP4 MoE 전문가 미지원), vLLM 사용
- trust_remote_code: 불필요
사용법
- 서버 실행:
vllm serve axteam/MiniCPM-V-4.7-35B-A3B-NVFP4 --max-model-len 32768— OpenAI 호환 API - Python:
LLM(model="axteam/MiniCPM-V-4.7-35B-A3B-NVFP4", max_model_len=32768).chat(...)— 전체 예시는 위 영어 본문 'Usage (vLLM)' 절 참고 - 권장 샘플링:
temperature=1.0,top_p=0.95,top_k=20(원본generation_config.json기준) - thinking 모드: 기본 꺼짐 — 켜려면
chat_template_kwargs={"enable_thinking": True}전달(Python은llm.chat()인자, HTTP는 요청 본문의"chat_template_kwargs": {"enable_thinking": true}) - 이미지 입력: 메시지에
image_url항목 사용 - 텍스트만 사용할 때:
--limit-mm-per-prompt '{"image": 0, "video": 0}'— 비전 타워용 메모리 예약을 생략해 메모리 절약 - KV 캐시 절감(선택):
vllm serve에--kv-cache-dtype fp8추가 — 하이브리드 구조라 KV 캐시는 풀 어텐션 10개 층에만 있고, 선형 어텐션(Gated DeltaNet) 30개 층의 요청별 고정 크기 상태는 이 옵션으로 바뀌지 않음 → 풀 어텐션 KV 캐시만 절반으로 줄어 긴 컨텍스트에서 효과가 크고 짧은 요청이 많을 때는 작음 (가중치 양자화와 별개인 실행 옵션)
참고
- 호환성 (2026-10-31 확인): vLLM 0.32.0 + transformers 5.17.0은
minicpmv4_7을 인식하지 못해 서버 실행 실패 — transformers 5.18.x·5.19.x 필요 (위 요구사항 참고) - 수정 이력 (2026-11-01, 재양자화): MoE 라우터(
mlp.gate)·공유 전문가 게이트에 AWQ 상쇄 스케일 적용 (모든 층에서 원본 대비 라우터 배율이 norm 배율과 일치함을 확인, 채널별 차이 중앙값 2% 미만); 원본 norm 이득이 0인 채널을 AWQ 스케일 정규화에서 빼 스무딩된 norm의 BF16 정밀도 유지 (스무딩된 모든 norm에서 이득 대비 BF16 반 칸이 1% 미만임을 확인, 채널 중앙값) — 이전 업로드의 결함: 첫 번째 업로드는 라우터·공유 전문가 게이트 상쇄 누락으로 원본과 다른 전문가 선택, 첫·두 번째 업로드는 2~5번 층의 이득 0 채널 탓에 norm 정밀도 손실(그 층 이득을 BF16으로 약 ±7–10%까지만 나타낼 수 있었음: 이득 대비 BF16 반 칸, 채널 중앙값) — 2026-11-01 10:56:00 UTC(리비전939c788) 이전에 받았다면 다시 받을 것, 품질 항목의 벤치마크·충실도는 재양자화 빌드로 잰 값
라이선스
- 라이선스: Apache-2.0 — 원본 모델의 라이선스를 그대로 따름
- 권리: 원본 가중치·토크나이저는 OpenBMB 소유, 이 리포는 양자화 파생물