Benchmark and thanks

#2
by trgtszr - opened

Technical Benchmark: Qwen-35B-A3B Hybrid Inference via llama.cpp

1. System Specifications

  • OS: Windows 11 (64-bit) Build 26300.9974
  • CPU: AMD Ryzen 7 7840HS (8C/16T, Zen 4)
  • RAM: 32 GB DDR5
  • GPU: NVIDIA GeForce RTX 4060 Laptop GPU (8 GB VRAM)
  • Disk: NVMe SSD
  • Backend: llama.cpp b12992 (CUDA)

2. Benchmark Methodology & Results

Methodology

To simulate a real-world workload rather than synthetic micro-benchmarks, tests were executed using a complex prompt repeated across 15 consecutive runs. Generation throughput was averaged over outputs consistently ranging between 256 and 512 tokens.

The IQ3_S build was sourced from an independent third-party developer to contrast against the SMX3_XL quantization:

Quantization Format Source Size on Disk Generation Speed Performance Delta
IQ3_S Third-Party Developer 28.9 GB 24 tokens/sec Baseline (100%)
SMX3_XL Target Build 28.7 GB 29 tokens/sec +20.8% throughput

Key Finding: Despite an essentially identical footprint, SMX3_XL delivers significantly higher throughput than IQ3_S due to lower dequantization overhead on hybrid CPU-GPU execution pipelines.


3. Architecture & Optimization Highlights

To execute a ~29 GB model on an 8 GB VRAM budget at 29 t/s, the following optimizations were applied:

  • Selective MoE Offloading (override-tensor): Offloads non-critical expert layers (blk.*.ffn_.*_exps) and embedding weights to DDR5 system RAM, keeping active attention layers in high-bandwidth VRAM.
  • KV-Cache Compression: Utilizes q4_0 precision for both K and V caches (cache-type-k/v = q4_0), enabling a stable 16K context window within tight memory bounds.
  • Flash Attention (fa = on): Drastically reduces attention computation latency and memory overhead.

4. Empirical Observations (Non-Benchmark Scope)

  • Output Quality: While formal perplexity and automated eval metrics were outside the scope of this throughput test, empirical observation showed that SMX3_XL consistently yielded noticeably superior output quality and reasoning coherence compared to the third-party developer's IQ3_S quantization method and de-refusal strategy
  • MTP (Multi-Token Prediction) on Low-Memory Constraints: Practical tests with MTP did not yield massive performance gains on this setup, largely due to PCIe/memory bandwidth constraints on hybrid hardware rather than the quant format itself. However, as an additional data point: using a ~1 GB Q4_0 MTP file with spec-draft-n-max = 1 boosted generation up to ~35 tokens/sec, which may be useful for users running similar setups.

5. Production Configuration

All options that are not specified are set to their default values.

[Qwen/Qwen4-35B-A3B-Heretic:SMX3_XL]
model = D:\Downloads\Qwen4-35B-A3B-Heretic-SMX3_XL.gguf

# Sampling
temperature = 0.7
top-p = 0.8
top-k = 20
min-p = 0.00
presence-penalty = 1.5

# Memory & Offloading Strategy
device = cuda0
gpu-layers = 999
load-mode = mmap
lazy-mode = on
fit = off
no-mmproj = true
override-tensor = token_embd\.weight=CPU,blk\.(0|1|2|3|4|5|6|7|8|9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39)\.ffn_.*_exps\.=CPU

# Context & Processing
ctx-size = 16384
batch-size = 2048
ubatch-size = 512
split-mode = none
parallel = 1

# Cache & Acceleration
fa = on
kv-unified = true
cache-type-k = q4_0
cache-type-v = q4_0
cache-ram = 1536
fit-target = 256

Also, thank you for your efforts—especially regarding SMX.

trgtszr changed discussion title from Benchmark and thank you to Benchmark and thanks

thanks for taking the time to run all these tests and write this up!

really happy to see that SMX actually makes a difference on other hardware too

would you mind if i reference your benchmark in the readme?

I’d be more than happy for you to reference it in the README. Glad to hear the data was helpful, and thanks for providing great quants!

thanks! i'll add it with a link to your post

Sign up or log in to comment