CoolFace
Modelpublic

Sociopacific/Qwen3.6-35B-A3B-Claude-4.7-Opus-Reasoning-Distilled-GPTQ-Int4

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
2likes436downloads
Model Card

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

MetricValue
GPTQ success rate97.29%
RTN fallback rate2.71%
Loss mean8.90e-05
Loss max2.00e-03
Total quantized modules30,720
Quantized size22.0 GB (safetensors)

Per-module quantization log: `quant_log.csv` (every layer, every module, GPTQ loss / RTN marker, sample count, wall time). Fully auditable.

Model specs

PropertyValue
Source modellordx64/Qwen3.6-35B-A3B-Claude-4.7-Opus-Reasoning-Distilled
Base modelQwen3.6-35B-A3B (MoE, 35B total / 3B active per token)
ArchitectureQwen3_5MoeForConditionalGeneration (vision + text, multimodal-capable)
Experts256 (top-8 routing per token, 1 shared)
Hidden layers39
Native context64K tokens (matches source distill)
QuantizationGPTQ v2, 4-bit, groupsize=128, symmetric, descact=False
KV cache supportbf16 / fp16 / fp8_e4m3 (storage-only on Ada/Blackwell consumer cards)

What is quantized vs kept BF16

Quantized (int4) — all routed MoE expert FFN weights across layers 0–38:

  • —mlp.experts.{0..255}.gate_proj
  • —mlp.experts.{0..255}.up_proj
  • —mlp.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) and lm_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:

SourceSamplesPurpose
allenai/c4102General English text
allenai/tulu-3-sft-mixture77Instruction-following
codeparrot/codeparrot-clean51Code generation
HuggingFaceH4/MATH-50026Mathematical reasoning
Total256 (seq_len=1024)

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

ComponentVersion
GPTQModel6.0.3
PyTorch2.11.0 + CUDA 13.0
Transformers5.7.0
Datasets4.8.5
Accelerate1.13.0
Python3.12 (standard, GIL on)
CUDA driver targetsm_120 (Blackwell)
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

bash
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-code
Important: Do not pass --quantization moe_wna16 to vLLM. Let vLLM auto-detect from config.json. Forcing the flag triggers a KeyError in the Qwen3.5-MoE loader.

SGLang

bash
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 30000

Transformers (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


Quantized by @Sociopacific. Issues / quality reports welcome in the discussions tab.