Nandai AI
Sign In
GGF-16 · QWEN 4 35B-A3B Q4_K_M (21.40 GIB) FOR 48–64 GB MACS & RTX 5090 32 GB

Qwen 4 35B-A3B Q4_K_M: 4.85 bpw K-Quant Superblocks, Fast Prefill ALU & 568.9 tok/s RTX 5090 Roofline

Q4_K_M (21.40 GiB, 3.15 GB/token active read) uses hardware-friendly 4-bit/6-bit K-quant linear scaling rather than vector codebook lookups, accelerating long-context prompt prefill on Metal and CUDA.

Roofline Math Disclosure: 568.9 tok/s (RTX 5090) and 173.3 tok/s (M4 Max) represent theoretical memory-bandwidth ceilings (Bus GB/s / 3.15 GB/tok) excluding dispatch latency and MTP verification.

GGF-16 · Qwen 4 35B-A3B MoE · Standard K-Quant⌘9 Model Manager

OS-Aware Studios & Tools

Verify memory fit before downloading weights, or launch zero-upload browser studios on macOS, Windows, and Linux:

02 · Hardware Memory-Bandwidth Roofline & KV Matrix

Exact Weight GiB, Active GB/Token, KV Scaling & Bandwidth Ceilings

Calculated from Qwen 4 35B-A3B Q4_K_M (4.85 bpw, 21.40 GiB weights, 3.15 GB/token active read, 40 MiB/1K FP16 QSA KV + 0.25 GiB GDN state, Host-RAM Engram).

Hardware TierQuant / ModeWeight GiBActive GB/tokKV @ 32KKV @ 128KKV @ 1MRoofline tok/sResidency Fit
MacBook Air / mini M4 (24 GB)Qwen4 35B-A3B Q4_K_M21.40 GiB3.15 GB/tok1.50 GiB5.25 GiB40.25 GiB38.1 peak; PCIe/swap limitedExceeds pool (needs >24 GiB wired)
Mac mini / MBP M4 Pro (48 GB)Qwen4 35B-A3B Q4_K_M21.40 GiB3.15 GB/tok1.50 GiB5.25 GiB40.25 GiB86.7 tok/s (273 GB/s)Fits 128K+ residency · Engram 0 MB VRAM
MacBook Pro M4 Max (128 GB)Qwen4 35B-A3B Q4_K_M21.40 GiB3.15 GB/tok1.50 GiB5.25 GiB40.25 GiB173.3 tok/s (546 GB/s)Fits 1M full residency · Engram 0 MB VRAM
Mac Studio Ultra (192 GB)Qwen4 35B-A3B Q4_K_M21.40 GiB3.15 GB/tok1.50 GiB5.25 GiB40.25 GiB260.0 tok/s (819 GB/s)Fits 1M full residency · Engram 0 MB VRAM
NVIDIA RTX 3090 (24 GB)Qwen4 35B-A3B Q4_K_M21.40 GiB3.15 GB/tok1.50 GiB5.25 GiB40.25 GiB297.1 peak; PCIe/swap limitedSpills VRAM (+1.1 GiB PCIe offload)
NVIDIA RTX 4090 (24 GB)Qwen4 35B-A3B Q4_K_M21.40 GiB3.15 GB/tok1.50 GiB5.25 GiB40.25 GiB320.0 peak; PCIe/swap limitedSpills VRAM (+1.1 GiB PCIe offload)
NVIDIA RTX 5090 (32 GB)Qwen4 35B-A3B Q4_K_M21.40 GiB3.15 GB/tok1.50 GiB5.25 GiB40.25 GiB568.9 tok/s (1792 GB/s)Fits 128K+ residency · Engram 0 MB VRAM
Variant / ModeMemory / ThroughputRecommended Hardware Configuration
Q4_K_M Backbone (4.85 bpw)21.40 GiB GPU + 0 MB VRAM Engram48–64 GB M4 Pro/Max or RTX 5090 32 GB
128K FP16 QSA KV + GDN5.25 GiB KV + 0.75 GiB scratch27.40 GiB total — clean fit on RTX 5090 32 GB
1M Q4_0 QSA KV + GDN11.50 GiB KV + 0.75 GiB scratch33.65 GiB total — fits 48 GB–64 GB Macs cleanly

Section 01 · GGF-16

Why Linear K-Quant Q4_K_M Prefills Faster Than Codebook IQ4_XS on Large Prompts

Bit-shifting 4-bit nibbles with affine scales avoids vector table gathers during compute-bound 128K prefill.

During single-token decode, DRAM bandwidth dominates so thoroughly that both IQ4_XS (2.95 GB/tok) and Q4_K_M (3.15 GB/tok) stay close on memory rooflines. However, during massive 64K–256K repository prompt ingestion (prefill), matrix multiplications become compute-bound and ALU dequantization overhead matters.

IQ4_XS relies on non-linear 256-entry lookup tables during unpacking, whereas Q4_K_M uses pure bitwise nibble masking plus affine FP16 scale/min multiply-adds that map directly onto NVIDIA DP4A/Tensor intrinsics and Apple Metal SIMD vector instructions. On 48–64 GB Apple Silicon Macs and RTX 5090 32 GB rigs where the extra 1.00 GiB (21.40 GiB vs 20.40 GiB) is trivial, Q4_K_M gives snappier Time-To-First-Token on multi-file ingestions.

Breaking down Q4_K_M’s 21.40 GiB footprint confirms why it hits slightly higher active byte reads than UD-IQ4_XS (3.15 vs 2.95 GB/tok): standard Q4_K blocks pack 144 bytes per 256 weights (4.50 bpw) plus Q6_K promotions on attn_v and half of ffn_down tensors, bringing model-wide density near 4.85 bpw while maximizing hardware SIMD decoding throughput.

Roofline / Allocation EquationRTX_5090_Q4_K_M_128K = 21.40 GiB + 5.00 GiB (128K FP16 KV) + 0.25 GiB (GDN) + 0.75 GiB = 27.40 GiB <= 30.2 GiB Usable

Section 02 · GGF-16

RTX 5090 32 GB vs 48 GB–64 GB M4 Pro/Max Comparison for Q4_K_M

RTX 5090 dominates burst speed up to 128K–262K; 48–64 GB Unified Memory extends cleanly to 1M context.

Comparing RTX 5090 (32 GB GDDR7, 1,792 GB/s) against 48 GB M4 Pro (273 GB/s) and 64 GB M4 Max (546 GB/s) on Qwen 4 35B-A3B Q4_K_M highlights a sharp capacity/bandwidth cross. At 128K tokens with native FP16 KV cache (27.40 GiB total), RTX 5090 keeps everything on-die with a 568.9 tok/s theoretical decode ceiling and blazing Tensor prefill.

Push context past 262K toward 1,048,576 tokens, however, and Q4_0 KV requires 11.50 GiB (total 33.65 GiB)—exceeding RTX 5090’s 32 GB physical ceiling while fitting cleanly inside 48 GB M4 Pro (38.0 GiB pool) and 64 GB M4 Max (51.5 GiB pool) at 86.7–173.3 tok/s theoretical rooflines.

When targeting 262K tokens on RTX 5090 32 GB with Q4_K_M, switch KV from FP16 (10.25 GiB) to Q8_0 (5.56 GiB w/ GDN): 21.40 + 5.56 + 0.75 = 27.71 GiB fits completely inside 30.2 GiB usable GDDR7 while reserving FP16 precision for short <=128K prompts.

Verification & Runtime Flagsllama-server -m Qwen4-35B-A3B-Q4_K_M.gguf -c 262144 -ctk q8_0 -ctv q8_0 -fa on -ot "engram=CPU" -ngl 99

Section 03 · GGF-16

Why 24 GB RTX 3090/4090 and 24 GB M4 Pro Owners Skip Q4_K_M

21.40 GiB weights cross the 18.0 GiB Mac pool and leave too little room on 24 GB RTX cards.

On a 24 GB MacBook Pro (~18.0 GiB practical Metal pool), 21.40 GiB of Q4_K_M weights immediately triggers macOS memory compression and SSD swap before even generating the first token. Similarly, on a 24 GB RTX 3090 or 4090 (~22.5 GiB usable VRAM), 21.40 GiB leaves barely 1.10 GiB for runtime scratch and KV cache—forcing context caps under 8K–12K.

For 24 GB systems, step directly to UD-IQ3_S (12.90 GiB) or, on Linux RTX 3090/4090 with 32K Q4_0 KV, UD-IQ4_XS (20.40 GiB).

Section 04 · GGF-16

Host-RAM Engram Footprint Paired With Q4_K_M Backbone

Keep 12–24 GB of host DDR5 or unified/mmap headroom ready when pairing Engram at Q4_K_M or Q8_0 precision.

If the GGUF build packages the 20.5B Engram table at Q4_K_M (~11.6 GiB) or Q8_0 (~20.3 GiB), verify your workstation carries >=32–64 GB of total system RAM alongside your GPU so Host-RAM pinning (-ot "engram=CPU") never causes OS swap.

Validate combined GPU + Host allocations at /tools/gguf-vram-calculator and explore SEO/content automation pipelines in /seo-engine and /writing-engine.

Interactive Sizing & Browser Studios

Verify Exact Memory Margins Before Downloading Multi-Gigabyte GGUFs

Plug your exact hardware SKU, KV quantization (--cache-type-k / -v), and context length into our zero-upload GGUF VRAM & Roofline Calculator. Explore full model cards at /models and Apple Silicon tier breakdowns at /apple-silicon, or draft and audit content inside /writing-engine and /seo-engine.

05 · Technical FAQ (1:1 JSON-LD Parity)

Qwen 4 35B-A3B Q4_K_M — Frequently Asked Questions

Can an RTX 5090 32 GB run Qwen 4 35B-A3B Q4_K_M with 128K FP16 KV in pure VRAM?

Yes. 21.40 GiB weights plus 5.25 GiB (128K FP16 KV + GDN state) plus 0.75 GiB scratch equals 27.40 GiB—fitting cleanly inside ~30.2 GiB usable GDDR7 with Host-RAM Engram.

Why does Q4_K_M prefill faster than UD-IQ4_XS on long repository prompts?

Q4_K_M decodes 4-bit nibbles via direct affine arithmetic on SIMD/Tensor cores instead of non-linear IQ vector codebook table lookups.

Can a 24 GB M4 Pro MacBook Pro run Qwen 4 35B-A3B Q4_K_M without swapping?

No—21.40 GiB exceeds the ~18.0 GiB practical GPU pool on a 24 GB Mac; use UD-IQ3_S (12.90 GiB) on 24 GB Macs or upgrade to 48 GB Unified Memory.

How much Host RAM is needed to pin Qwen 4 Engram alongside Q4_K_M?

Allocate ~11.6 GiB of host RAM if Engram is quantized at Q4_K_M, or ~20.3 GiB if Engram is kept at Q8_0 precision.

Founder Pro $9.99/mo · 67% Off1-tap Stripe Checkout · Instant ?ref= Free Months · 40% Recurring Partner Payouts
1. Subscribe in 1 TapFOUNDER_999_LOCK

Unlock All 19 Pro Studios + Mac App

Lock $9.99/mo Founder Pro (reg. $29.99 — 67% off), $119/yr Web Annual (-34%), or $299/yr 5-Mac + Web Pro.

Redeem Code
2. Get 6 Months FreeZERO OTP

Mint Your ?ref= Link Instantly

Give friends 67% off ($9.99/mo). Every paid friend adds 30 days of Pro free to your account (up to 6 months).

Dashboard: /refer · Rules

3. Creator & Publisher Cash90-DAY COOKIE

Earn 40% Monthly · 30% Annual

Earn 40% recurring monthly until cancel + 30% annual & every renewal, or embed our free tools with data-ref.