license: apache-2.0
license_link: https://huggingface.co/Qwen/Qwen4-35B-A3B/blob/main/LICENSE
base_model: OS-Software/Qwen4-35B-A3B-Uncensored-Heretic-v2
base_model_relation: quantized
pipeline_tag: image-text-to-text
library_name: vllm
language:
- en
- ja
tags: - uncensored
- heretic
- qwen4
- moe
- mxfp4
- fp8
- w4a8
- compressed-tensors
- amd
- r9700
- radeon
- rdna4
- gfx1201
- rocm
Qwen4-35B-A3B-Uncensored-Heretic-v2, MXFP4 W4A8 (compressed-tensors) for AMD Radeon AI PRO R9700
Built for AMD Radeon AI PRO R9700 (RDNA4, gfx1201, 32 GB) with mainline vLLM on ROCm plus the
vllm_r9700_mod plugin, which supplies the RDNA4 MXFP4 kernels.
Every number on this card was measured on R9700s (capped at 210 W).
A conversion of OS-Software/Qwen4-35B-A3B-Uncensored-Heretic-v2
(the BF16 weights behind their GGUFs;
Qwen/Qwen4-35B-A3B with refusals reduced by Heretic). 106 GiB BF16 →
59.9 GiB. MXFP4 weights with FP8 activations for every quantized linear layer. The FP8-dense build scores higher on MMLU for 0.6 GiB more; prefer it if you have two cards. Made for, and tested on, AMD Radeon AI PRO R9700 (RDNA4, gfx1201) with mainline vLLM plus
vllm_r9700_mod.
The two builds
| MXFP4-W4A8-R9700 | MXFP4-W4A8-FP8dense-R9700 (recommended) | |
|---|---|---|
| Routed experts (32.2B params) | MXFP4 weights, FP8 activations | MXFP4 weights, FP8 activations |
Attention q/k/v/o_proj, Gated DeltaNet in_proj_qkv/z, out_proj, shared expert (1.4B params) |
MXFP4 weights, FP8 activations | FP8 E4M3 weights (per output channel), FP8 activations |
Everything else (n-gram table, embeddings, lm_head, vision, MTP, routers, indexer, mixers) |
BF16 | BF16 |
| Size | 59.9 GiB | 60.5 GiB |
| MMLU (14,042, our harness) | 74.1% | 76.0% |
| HumanEval pass@1 | 93.9% (154/164) | 92.1% (151/164) |
| Refusals, 208 harmful prompts (104 EN + 104 JA) | 2 | 2 |
The FP8-dense build follows where unsloth's UD GGUFs (which the base model's GGUFs keep) spend their bits: down to
UD-Q3_K_XL they keep attention, DeltaNet projections and the shared expert at Q8_0 and only take the routed experts to
~4 bits. Those are also the tensors the Heretic edit changed. Keeping them at 8 bits costs 0.6 GiB and gave a paired
MMLU gain of +1.9 points (1,062 questions fixed, 798 broken; z = 6.1). The HumanEval difference (3 fixed, 6 broken) is
within noise for 164 problems.
Evaluation
Measured with vLLM (ROCm) on AMD Radeon AI PRO R9700s, thinking off, greedy decoding, no system prompt:
- MMLU: all 14,042 test questions, zero-shot, chat template, answer read from the first token's log-probabilities
(A–D). Replies that started with markdown instead of a letter count as wrong (80 for W4A8, 27 for FP8-dense). - HumanEval: 164 problems, the function asked for in a code block, run against the tests.
- Refusals: mlabonne/harmful_behaviors and
OS-Software/harmful_behaviors_ja test splits,
512 output tokens, judged REFUSAL/COMPLIANCE by the model itself with a constrained choice; a sample was checked by hand.
The base model's own numbers (MMLU 80.54%, HumanEval 93.90%, 17/208 refusals on UD-Q4_K_XL) come from a different
harness (llama.cpp, its WebUI with tools, recommended sampling, Gemma 4 judge), so compare these two builds with each
other, not with those. The W4A8 build was evaluated on one R9700, the FP8-dense build with tensor parallelism over two.
Format
compressed-tensors. Weights: OCP MXFP4 (E2M1, one E8M0 scale per 32 values), round-to-nearest with no calibration data;
per block the shared exponent is the OCP rule or one step above it, whichever gives the lower squared error. FP8
weights (FP8-dense build): E4M3, one scale per output channel (amax / 448). Activations: FP8 E4M3, dynamic per-token
scales. Fused expert tensors are split per expert. The n-gram embedding table (20.5B params) is not quantized.
Made with tools/quantize_mxfp4.py
(--fp8-dense for the FP8-dense build) from the BF16 weights.
Serving on AMD Radeon AI PRO R9700 (RDNA4)
Upstream vLLM has no RDNA4 kernels for MXFP4 (it emulates, and drops the FP8 activations in the MoE). The
vllm_r9700_mod plugin adds them; the FP8 linears of the FP8-dense
build use vLLM's own FP8 kernel. Build the plugin's Docker image, then:
docker run --rm -it --device /dev/kfd --device /dev/dri --group-add video \
--security-opt seccomp=unconfined --ipc host --shm-size 32g -p 8000:8000 \
-v /path/to/models:/models:ro vllm-r9700-mod \
/models/MODEL_DIR --trust-remote-code \
--max-model-len 1048576 --max-num-seqs 16 --gpu-memory-utilization 0.92 --reasoning-parser qwen4
With two GPUs visible the image adds --tensor-parallel-size 2. Tested setups: W4A8 on one 32 GB R9700 with--max-model-len 65536; FP8-dense on two R9700s (TP2) at 1M context (1.36M-token KV pool). The FP8-dense build did
not start on one 32 GB card at --gpu-memory-utilization 0.92 (no memory left for the KV cache after warm-up); use two
cards. Set DEBUG_CLR_DEVICE_ORDERING_EDGE=0 and HSA_ENABLE_IPC_MODE_LEGACY=0 on any ROCm vLLM image (the plugin does
this automatically). Throughput of these builds was not benchmarked separately; for the same architecture and W4A8
format see the plugin README.
Credits and license
- Qwen: the original model.
- OS-Software: the Heretic-v2 edit
(low-rank edits to attention/DeltaNet output projections, the shared expert's and half the routed experts' down
projections in layers 18–39). See their card for how it was made and its caveats. - This repo only changes the numeric format. Apache 2.0, as the originals; see
LICENSEandNOTICE.txt.
This model has substantially reduced safety alignment and will follow requests the original refuses. Treat its outputs
as untrusted. You are responsible for how you use it.
On GPUs other than the AMD R9700, whether this loads fast depends on vLLM's MXFP4 W4A8 support for that hardware
(on other AMD RDNA4 cards the plugin should apply; elsewhere expect vLLM's emulation path).