Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Jackrong/Qwopus3.6-35B-A3B-Coder
|
| 4 |
+
tags:
|
| 5 |
+
- nvfp4
|
| 6 |
+
- quantized
|
| 7 |
+
- vllm
|
| 8 |
+
- moe
|
| 9 |
+
- coding
|
| 10 |
+
- tool-use
|
| 11 |
+
- qwen3
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Qwopus3.6-35B-A3B-Coder β NVFP4
|
| 17 |
+
|
| 18 |
+
NVFP4 quantization of [Jackrong/Qwopus3.6-35B-A3B-Coder](https://huggingface.co/Jackrong/Qwopus3.6-35B-A3B-Coder), a practical coding-agent fine-tune of Qwen3.6-35B-A3B built for fast agent loops and tool-calling workflows.
|
| 19 |
+
|
| 20 |
+
Quantized with [llmcompressor](https://github.com/vllm-project/llm-compressor) using the NVFP4 scheme. Fits in ~22 GB unified memory vs ~70 GB for BF16, enabling it to run alongside an embedding model on a single 128 GB DGX Spark (GB10).
|
| 21 |
+
|
| 22 |
+
## Model Details
|
| 23 |
+
|
| 24 |
+
| Property | Value |
|
| 25 |
+
|---|---|
|
| 26 |
+
| Base fine-tune | [Jackrong/Qwopus3.6-35B-A3B-Coder](https://huggingface.co/Jackrong/Qwopus3.6-35B-A3B-Coder) |
|
| 27 |
+
| Base architecture | Qwen3.6-35B-A3B (GDN hybrid MoE) |
|
| 28 |
+
| Total parameters | 35B |
|
| 29 |
+
| Active parameters | ~3B per token |
|
| 30 |
+
| Quantization | NVFP4 (compressed-tensors) |
|
| 31 |
+
| Disk size | ~22 GB |
|
| 32 |
+
| Context | 262 144 tokens (tested) |
|
| 33 |
+
|
| 34 |
+
## Performance (from original model card)
|
| 35 |
+
|
| 36 |
+
- **SWE-bench**: 62.4% on 300-case submitted-patch evaluation (Q5_K_M, thinking off)
|
| 37 |
+
|
| 38 |
+
## vLLM Usage
|
| 39 |
+
|
| 40 |
+
Requires vLLM with Marlin NVFP4 backend. Tested on vLLM β₯ v0.22.1rc1 on NVIDIA GB10 (SM121, arm64).
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
vllm serve <repo-id> \
|
| 44 |
+
--served-model-name qwopus \
|
| 45 |
+
--trust-remote-code \
|
| 46 |
+
--moe-backend marlin \
|
| 47 |
+
--linear-backend marlin \
|
| 48 |
+
--attention-backend TRITON_ATTN \
|
| 49 |
+
--tool-call-parser qwen3_coder \
|
| 50 |
+
--reasoning-parser qwen3 \
|
| 51 |
+
--enable-auto-tool-choice \
|
| 52 |
+
--load-format instanttensor \
|
| 53 |
+
--gpu-memory-utilization 0.30 \
|
| 54 |
+
--max-model-len 262144 \
|
| 55 |
+
--max-num-seqs 2
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
**Required environment variable:**
|
| 59 |
+
```bash
|
| 60 |
+
VLLM_NVFP4_GEMM_BACKEND=marlin # or use --linear-backend marlin (preferred in v0.22+)
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
**Notes:**
|
| 64 |
+
- `--attention-backend TRITON_ATTN` is required β this model uses GDN (GatedDeltaNet) hybrid linear-attention layers that are incompatible with FlashInfer
|
| 65 |
+
- `--load-format instanttensor` is strongly recommended for correct weight loading
|
| 66 |
+
- MTP speculative decoding works: `--speculative-config '{"method":"mtp","num_speculative_tokens":1,"moe_backend":"triton"}'` (note `moe_backend:triton` for the unquantized MTP draft head)
|
| 67 |
+
- Do NOT set `CUTE_DSL_ARCH=sm_121a` on GB10 β causes hangs
|
| 68 |
+
|
| 69 |
+
## Fixes Applied During Quantization
|
| 70 |
+
|
| 71 |
+
Three model-level fixes were required to make this checkpoint load correctly in vLLM. They are already applied in this repo β you do not need to do anything extra.
|
| 72 |
+
|
| 73 |
+
### 1. VL wrapper config format
|
| 74 |
+
|
| 75 |
+
The original Jackrong BF16 model uses `Qwen3_5MoeForCausalLM` architecture. vLLM's Marlin NVFP4 MoE path requires the VL wrapper (`Qwen3_5MoeForConditionalGeneration`) with nested `text_config`/`vision_config`. `config.json` and `processor_config.json` were updated accordingly.
|
| 76 |
+
|
| 77 |
+
### 2. GDN quantisation ignore list
|
| 78 |
+
|
| 79 |
+
This model's 30 GDN (GatedDeltaNet) linear-attention layers have split HF weight tensors (`in_proj_qkv`, `in_proj_z`, `in_proj_b`, `in_proj_a`) that vLLM fuses at load time into `in_proj_qkvz` and `in_proj_ba`. The llmcompressor recipe only ignored the split names; the fused names must also be in the `quantization_config.ignore` list or vLLM creates quantized modules for them and fails to load. Added to `config.json`:
|
| 80 |
+
|
| 81 |
+
```
|
| 82 |
+
"re:.*in_proj_qkvz.*"
|
| 83 |
+
"re:.*in_proj_ba.*"
|
| 84 |
+
"re:.*linear_attn.*out_proj.*"
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
### 3. BF16 shared_expert_gate injection
|
| 88 |
+
|
| 89 |
+
vLLM hardcodes `shared_expert_gate` as BF16 (`quant_config=None`) regardless of the checkpoint's quantization config. llmcompressor quantized it to NVFP4, so the checkpoint contained `weight_packed`/`weight_scale` tensors but no `weight` tensor β leaving the gate uninitialized (random). This produces NaN logits β `!!!!` output on every prompt.
|
| 90 |
+
|
| 91 |
+
Fix: BF16 gate weights were extracted from the original BF16 model and saved as `shared_expert_gates.safetensors` (41 tensors: 40 layers + 1 MTP). The NVFP4 artefacts (`weight_packed`, `weight_scale`, `input_global_scale`, `weight_global_scale`) for `shared_expert_gate` were stripped from `model.safetensors`. `model.safetensors.index.json` now points both shards so vLLM loads them together.
|
| 92 |
+
|
| 93 |
+
## Attribution
|
| 94 |
+
|
| 95 |
+
- Fine-tune by **Jackrong** ([Qwopus3.6-35B-A3B-Coder](https://huggingface.co/Jackrong/Qwopus3.6-35B-A3B-Coder)) β Apache 2.0
|
| 96 |
+
- Base architecture by **Alibaba Cloud Qwen Team** ([Qwen3](https://huggingface.co/Qwen)) β Apache 2.0
|
| 97 |
+
- Fine-tuning acceleration by **Unsloth**
|
| 98 |
+
- NVFP4 quantization using [llmcompressor](https://github.com/vllm-project/llm-compressor)
|
| 99 |
+
|
| 100 |
+
## License
|
| 101 |
+
|
| 102 |
+
Apache 2.0 β same as the base fine-tune and Qwen3 base model.
|