Sociopacific/Qwen3.6-35B-A3B-Claude-4.7-Opus-Reasoning-Distilled-GPTQ-Int4
Qwen3.6-35B-A3B-Claude-4.7-Opus-Reasoning-Distilled-GPTQ-Int4
GPTQ Int4 quantization of lordx64/Qwen3.6-35B-A3B-Claude-4.7-Opus-Reasoning-Distilled — a Claude Opus 4.7 reasoning distill on top of Qwen3.6-35B-A3B (256-expert MoE, ~3B active).
Recipe follows palmfuture/Qwen3.6-35B-A3B-GPTQ-Int4: same skip-list (attention / routers / shared experts / vision / lmhead kept BF16), same calibration mix, same 4-bit / groupsize=128 / symmetric / desc_act=False settings. Fits in ~22 GB; runs on a single 24 GB consumer GPU with vLLM/SGLang, or on 32 GB cards (RTX 5090) with comfortable headroom for long context.
Quality
Per-module quantization log: `quant_log.csv` (every layer, every module, GPTQ loss / RTN marker, sample count, wall time). Fully auditable.
Model specs
What is quantized vs kept BF16
Quantized (int4) — all routed MoE expert FFN weights across layers 0–38:
mlp.experts.{0..255}.gate_projmlp.experts.{0..255}.up_projmlp.experts.{0..255}.down_proj
Kept BF16 (per Qwen3.6 GPTQ conventions):
- All attention layers (
*.self_attn.*) - MoE routers (
*.mlp.gate) - Shared experts (
*.shared_expert.*) - Multi-token prediction heads (
*.mtp.*) — present if source ships them - Vision encoder (
*.visual.*) - Embeddings (
embed_tokens) andlm_head
Calibration recipe
Same domain-mixed calibration set as palmfuture — chosen to give all 256 experts non-trivial activation signal across reasoning, language, code, and math domains:
Hardware used for quantization
- GPU: 1× NVIDIA RTX 5090 (Blackwell, 32 GB VRAM, ~1.79 TB/s)
- RAM: 96 GB DDR5 + 256 GB swap on NVMe (used during cpu-pack finalize bursts)
- Storage: 2 TB NVMe SSD (offload + output)
- OS: Ubuntu (homelab box, native — not WSL)
- Wall-clock: ~3 h 17 m end-to-end (incl. ~17 min single-thread CPU pack)
Single GPU is enough — gptqmodel quantizes layer-by-layer with disk offload, and peak VRAM during quantization stayed around 12–13 GB. Most of the wall clock is layer GPTQ work plus a ~17 min CPU-bound packing/finalize phase at the end.
Toolchain
Why no Python 3.13t free-threading? Multi-core packing is gated on PYTHON_GIL=0 in gptqmodel. With Python 3.12 + GIL, the final pack phase runs single-threaded and adds ~15–25 min for a 35B model. Quality is identical — only wall-clock differs.Usage
vLLM
vllm serve Sociopacific/Qwen3.6-35B-A3B-Claude-4.7-Opus-Reasoning-Distilled-GPTQ-Int4 \
--max-model-len 65536 \
--gpu-memory-utilization 0.85 \
--kv-cache-dtype fp8 \
--dtype bfloat16 \
--reasoning-parser qwen3 \
--trust-remote-codeImportant: Do not pass--quantization moe_wna16to vLLM. Let vLLM auto-detect fromconfig.json. Forcing the flag triggers aKeyErrorin the Qwen3.5-MoE loader.
SGLang
python -m sglang.launch_server \
--model-path Sociopacific/Qwen3.6-35B-A3B-Claude-4.7-Opus-Reasoning-Distilled-GPTQ-Int4 \
--quantization moe_wna16 \
--mem-fraction-static 0.85 \
--kv-cache-dtype fp8_e4m3 \
--context-length 65536 \
--reasoning-parser qwen3 \
--port 30000Transformers (single-GPU, for testing)
Requires trust_remote_code=True for the Qwen3.5-MoE architecture.
Recommended sampling
Same guidance as the source distill — use long max_new_tokens (16k–32k) for hard reasoning. The distill model emits explicit <think>...</think> blocks in Claude's cadence; budget context accordingly.
Quality vs source
GPTQ-Int4 with group_size=128 typically retains >97% of BF16 perplexity on Qwen3.6-class models (see palmfuture's wikitext-2 retention measurement of ~97.9% on the raw base). This release uses identical hyperparameters, so quality should sit in the same band — but no formal eval has been run on this specific distill yet. If you do run lm-evaluation-harness on this checkpoint, please share the numbers in the discussions tab.
Reproducibility
- Per-module loss / time / sample / RTN-fallback log: `quant_log.csv`
- Quantization config: `quantize_config.json`
- Source model commit: lordx64's repo
Credits
- @lordx64 — source Claude 4.7 distill
- Qwen Team — Qwen3.6-35B-A3B base model
- Anthropic — Claude Opus 4.7 (teacher used to produce the distill)
- @palmfuture — recipe and skip-list reference, palmfuture/Qwen3.6-35B-A3B-GPTQ-Int4
- ModelCloud / GPTQModel — quantization framework
Quantized by @Sociopacific. Issues / quality reports welcome in the discussions tab.
