Nandai AI
Sign In
GGF-19 · 20.5B PLE ENGRAM HOST-RAM OFFLOADING AT 0 MB GPU VRAM COST

Qwen 4 20.5B Engram Offload: O(1) Lookup Mechanics, 0 MB VRAM Residency & PCIe Latency Hiding

Unlike dense weights that sweep billions of bytes per token, Qwen 4’s 20.5B PLE Engram performs O(1) sparse row lookups—letting Host RAM or APFS NVMe hold the entire table at 0 MB VRAM cost.

Offload Math Disclosure: Engram lookup sizes (~10–64 KB/token) assume O(1) PLE embedding gathers; host-RAM bandwidth and PCIe latency only touch active Engram projection slices.

GGF-19 · Qwen 4 35B-A3B MoE · Engram Offload⌘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

VRAM savings and per-token PCIe cost of offloading the 20.5B PLE Engram table to Host RAM vs keeping Engram resident inside GPU VRAM across quantizations.

Hardware TierQuant / ModeWeight GiBActive GB/tokKV @ 32KKV @ 128KKV @ 1MRoofline tok/sResidency Fit
Engram Offloaded (UD-IQ3_S Host)0 MB VRAM · 7.52 GiB Host/NVMe12.90 GiB VRAM2.45 GB/tok1.50 GiB5.25 GiB40.25 GiB111.4 tok/s M4 Pro · 411.4 tok/s RTX 4090Fits 24 GB M4 Pro & 24 GB RTX 3090/4090
Engram Offloaded (UD-IQ4_XS Host)0 MB VRAM · 10.38 GiB Host/NVMe20.40 GiB VRAM2.95 GB/tok1.50 GiB5.25 GiB40.25 GiB185.1 tok/s M4 Max · 607.5 tok/s RTX 5090Fits 32 GB RTX 5090 & 36–64 GB Macs
Engram Offloaded (Q8_0 Host)0 MB VRAM · 20.28 GiB Host/NVMe37.40 GiB VRAM4.60 GB/tok1.50 GiB5.25 GiB40.25 GiB178.0 tok/s Ultra · Dual 3090 48 GBFits Dual RTX 3090 & 64–128 GB Macs
Engram Un-Offloaded (Q4_K_M VRAM)11.57 GiB Engram Wasted in VRAM32.97 GiB VRAM3.15 GB/tok1.50 GiB5.25 GiB40.25 GiBExceeds 24 GB & 32 GB RTX VRAM!Forces entire GPU into slow PCIe fallback
Variant / ModeMemory / ThroughputRecommended Hardware Configuration
Engram PLE Lookup Table (20.5B)0 MB GPU VRAM (Host/NVMe Pinned)Frees 7.5–38.2 GiB of pure VRAM for MoE + KV
Q4_K_M / Q8_0 Host Engram Size11.57 GiB (Q4_K) · 20.28 GiB (Q8_0)Pin in 32–64 GB DDR5 or lazy APFS mmap()
Per-Token Bus TransferO(1) ~10–64 KB Row GatherSub-2 microsecond transfer over PCIe 4.0 x16

Section 01 · GGF-19

Why 20.5B Engram Parameters Read Kilobytes Instead of Gigabytes per Token

Parameter-Lookup Embeddings behave like hash-indexed memory tables rather than dense matrix multiplications.

In conventional transformer feed-forward layers, activating a parameter requires multiplying an entire matrix row-by-row across the hidden dimension, streaming megabytes or gigabytes across DRAM on every forward step. Qwen 4’s 20.5B Parameter-Lookup Embedding (PLE) Engram takes a fundamentally different approach: n-gram and lexical token IDs hash directly into deterministic row indices inside the Engram embedding matrix.

Because looking up one or a few embedding vectors of hidden dimension d (for example, 2,048–4,096 elements × 1–2 bytes) transfers roughly ~8 KB to 64 KB per generated token, the Engram table has virtually zero bandwidth pressure. Placing 11.57–38.20 GiB of sparse Engram lookup weights inside precious 24 GB or 32 GB GPU VRAM wastes nearly half the card on cold memory rows that are untouched 99.99% of the time.

Consider the quantitative bandwidth contrast: an active token inside the 35B MoE backbone multiplies 8+1 experts plus 40 attention/DeltaNet layers totaling 2.45–4.60 GB of tensor reads, whereas the 20.5B Engram lookup fetches ~32 KB of sparse embedding rows—a 100,000-to-1 ratio in bus traffic per token!

Roofline / Allocation EquationEngram_PCIe_Time = 32 KB / 25,000,000 KB/s (PCIe 4.0 x16) ≈ 1.28 microseconds/tok (<0.1% of decode latency)

Section 02 · GGF-19

How PCIe 4.0/5.0 Hides Host-RAM Engram Latency on RTX 3090, 4090 & 5090

Prefetching the next step’s Engram embedding overlaps CPU gather with GPU attention compute.

On a desktop workstation pairing an RTX 3090 (24 GB), RTX 4090 (24 GB), or RTX 5090 (32 GB) with 64 GB of DDR5 system RAM, moving the 20.5B Engram table off GPU VRAM cuts required VRAM down by 7.5–20.3 GiB—turning Qwen 4 35B-A3B from an impossible fit into a pure-VRAM rocket.

Since the sampled token ID is known immediately at the end of layer 40 (or synchronously with MTP verification), the CPU gathers the tiny ~16–64 KB Engram vector in host L3/DDR5 and DMAs it across PCIe in ~1–3 microseconds—overlapped cleanly before deeper MoE blocks consume the residual signal.

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

Section 03 · GGF-19

Lazy APFS NVMe mmap() Engram Streaming on 24 GB Apple Silicon Macs

When physical Unified Memory is 24 GB, POSIX mmap() treats internal flash as a massive warm lookup tier.

On a 24 GB M4 Pro MacBook Pro or Mac mini, 12.90 GiB UD-IQ3_S weights + ~3 GiB KV + ~5 GiB macOS leave ~3 GiB of flexible page cache. Mapping the Engram slice read-only via POSIX mmap() without mlock() lets macOS keep frequently accessed Engram rows warm inside free page cache while faulting cold rare-token rows straight from internal APFS NVMe (~5–6 GB/s).

At 4 KB–16 KB APFS page sizes, a single cold lookup completes in tens of microseconds on Apple Silicon NVMe controllers, preserving smooth interactive streaming without pushing wired MoE weights into swap.

Avoid passing mlock flags when running APFS NVMe lazy Engram on 24 GB Macs: wiring all 20.5B Engram pages permanently would consume 7.5–20.3 GiB of non-evictable kernel RAM and crash smaller systems, whereas read-only mmap() lets macOS retain hot entries automatically in spare unified page cache.

Section 04 · GGF-19

How Much System DDR4/DDR5 RAM Should You Pair With Discrete GPUs?

Always check Host RAM >= Engram Size + 16 GB OS headroom when buying or configuring RTX builds.

Running Qwen 4 35B-A3B Q8_0 on Dual RTX 3090s (48 GB VRAM) fails smoothly if the workstation only has 32 GB of host DDR4 RAM, because a 20.28 GiB Q8_0 Engram table plus OS processes pushes Windows or Linux into disk pagefile thrashing. Budget >=32 GB host RAM for UD-IQ3_S/IQ4_XS Engram and >=64 GB host RAM for Q8_0 or BF16 Engram.

Check combined VRAM + Host Engram splits inside /tools/gguf-vram-calculator and inspect MDL-09 specs at /models/qwen4-35b-a3b-vector-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 Host-RAM Engram (0 MB) — Frequently Asked Questions

Does offloading the 20.5B Engram table to Host RAM slow down Qwen 4 35B-A3B?

Barely—because PLE Engram performs O(1) row lookups (~10–64 KB per token) instead of dense matrix multiplications, transferring that vector over PCIe 4.0/5.0 adds only microseconds while saving 7.5–38.2 GiB of GPU VRAM.

How much VRAM does Host-RAM Engram offloading actually use on my GPU?

Exactly 0 MB of GPU VRAM for the Engram lookup table, leaving 100% of your card’s memory for the 35B MoE backbone, 10 QSA KV buffers, and compute scratch.

Can a 24 GB M4 Pro Mac use Engram offloading without 48 GB Unified Memory?

Yes—via NVMe lazy Engram mmap(), macOS caches hot Engram rows in ~3–4 GiB of page cache and faults cold rows lazily from 6 GB/s internal APFS flash.

What happens if I run Qwen 4 35B-A3B without offloading Engram on a 24 GB RTX 4090?

Weights + Engram exceed 24 GB VRAM even at 3-bit precision, spilling active attention and MoE layers across PCIe and crashing throughput.

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.