Hy-Memory-30B-A3B — 24GB VRAM Optimized Asymmetric Hybrid GGUF (imatrix)

An Asymmetric Hybrid Q4_K_M (Q8_0 / Q6_K / Q4_K_M) GGUF quantization of tencent/Hy-Memory-30B-A3B, calibrated with an importance matrix (imatrix) and tuned specifically for single 24 GB GPUs (RTX 3090 / RTX 4090) as well as zero-VRAM CPU sidecar deployments.


Why Asymmetric Hybrid Quantization for Hy-Memory-30B-A3B?

Hy-Memory-30B-A3B (HYV3ForCausalLM / hy_v3 architecture) is a sparse Mixture-of-Experts memory writer model with 30.66B total parameters and ~3.0B active parameters per token (39 MoE layers, 128 routed experts, top-8 routing + 1 shared expert, and 8:1 GQA).

Because 94.5% of the model's parameters (28.97B) live inside the 128 sparse routed experts while only 5.5% (1.69B) make up the always-active backbone, uniform quantization leaves massive quality on the table. Paying just ~0.27 GiB extra keeps the entire always-active backbone at near-lossless Q6_K/Q8_0 precision while fitting comfortably in 24 GB VRAM with room for a 64k–128k q8_0 KV cache:

Component Tensors Parameter Share Quantization Why
Output / LM Head output.weight 0.26B (0.8%) Q8_0 Preserves exact JSON token probabilities, brackets, and schema keys
GQA 8:1 Attention attn_qkv.weight, attn_output.weight 0.50B (1.6%) Q6_K 8 query heads share 1 KV head across 256k RoPE context; high sensitivity to quantization noise
Shared Experts & Dense Layer 0 ffn_*_shexp.weight, blk.0.ffn_*.weight 0.68B (2.2%) Q6_K Active on 100% of tokens
Token Embeddings token_embd.weight 0.26B (0.8%) Q6_K Clean input representation across long contexts
MoE Router Gates & Norms ffn_gate_inp.weight, *_norm.weight 0.01B (<0.1%) F32 Exact top-8 expert routing decisions without router drift
128 Routed Experts (Layers 1–39) ffn_gate_up_exps.weight, ffn_down_exps.weight 28.97B (94.5%) Q4_K_M (imatrix) Each expert activates on only 6.25% of tokens; calibrated with a 575-chunk hy_v3 imatrix

File Summary

File Quant Tier Breakdown Size Avg BPW 24 GB GPU Fit (RTX 3090 / 4090)
Hy-Memory-30B-A3B-Hybrid-Q4_K_M.gguf Q8_0 head + Q6_K attn/shared/embd + Q4_K_M (imatrix) experts 17.36 GiB (17,774 MiB) 4.96 BPW Full offload (-ngl 99) + up to 128k q8_0 KV cache (~19.2 GB total VRAM)

Includes Upstream hy_v3 GGUF Converter Fix (expert_feed_forward_length = 768)

In upstream llama.cpp, convert_hf_to_gguf.py (HunyuanMoEModel.set_gguf_parameters in conversion/hunyuan.py) reads moe_intermediate_size (1536) instead of expert_hidden_dim (768) for HYV3ForCausalLM, causing llama.cpp to reject converted GGUFs on load with a tensor shape mismatch (blk.1.ffn_down_exps.weight expected [768, 2048, 128], got [1536, 2048, 128]).

This build was converted with --fuse-gate-up-exps --fuse-qkv and the corrected hy_v3.expert_feed_forward_length = 768 metadata, so it loads cleanly out of the box on llama.cpp (b9993+, verified on b11695).


Importance Matrix (imatrix) Calibration

Calibrated across 575 chunks (~1 MB) formatted with native hy_v3 special tokens (<|hy_begin▁of▁sentence|>, <|hy_User|>, <|hy_Assistant|><think>\n\n</think>) covering:

  • Multi-turn conversational logs and episodic summarization prompts
  • Structured JSON memory state extraction & schema-constrained updates (add / update / delete / noop)
  • Technical Markdown documentation and Python/JavaScript source code (preventing MoE router collapse on single-domain text)

Recommended Launch Configurations (llama-server)

Important (no_think + temp 0.0): Per Tencent's official Hy-Memory-30B-A3B evaluation setup, run with thinking disabled (no_think) and greedy decoding (--temp 0.0) for deterministic, clean JSON memory operations without <think> trace overhead.

1. Full 24 GB GPU Mode (RTX 3090 / 4090 — 128k Context)

llama-server \
  -m Hy-Memory-30B-A3B-Hybrid-Q4_K_M.gguf \
  -ngl 99 \
  -c 131072 \
  --flash-attn on \
  --cache-type-k q8_0 \
  --cache-type-v q8_0 \
  --jinja \
  --reasoning off \
  --chat-template-kwargs '{"reasoning_effort":"no_think"}' \
  --temp 0.0

2. Zero-VRAM CPU Sidecar Mode (Run Alongside Another Local LLM / ComfyUI)

Because only 3B parameters are active per token, Hy-Memory-30B-A3B runs remarkably fast on system RAM (~15–20 tok/s on modern DDR5 desktops) while using 0 MB of GPU VRAM — ideal as an always-on background memory consolidator alongside a primary GPU model:

CUDA_VISIBLE_DEVICES="" llama-server \
  -m Hy-Memory-30B-A3B-Hybrid-Q4_K_M.gguf \
  -ngl 0 \
  --device none \
  -c 131072 \
  --flash-attn on \
  --cache-type-k q8_0 \
  --cache-type-v q8_0 \
  -t 16 \
  --jinja \
  --reasoning off \
  --chat-template-kwargs '{"reasoning_effort":"no_think"}' \
  --temp 0.0

3. Unsloth Studio "Extra Arguments" Box

Unsloth Studio passes --jinja automatically. Paste the following single line into Extra Arguments:

--reasoning off --chat-template-kwargs {"reasoning_effort":"no_think"} --temp 0.0 --cache-type-k q8_0 --cache-type-v q8_0

Exact llama-quantize Recipe Used

llama-quantize \
  --imatrix imatrix.dat \
  --tensor-type "output.weight=q8_0" \
  --tensor-type "token_embd.weight=q6_k" \
  --tensor-type "attn_qkv=q6_k" \
  --tensor-type "attn_output=q6_k" \
  --tensor-type "shexp=q6_k" \
  --tensor-type "blk.0.ffn=q6_k" \
  hy-memory-bf16.gguf \
  Hy-Memory-30B-A3B-Hybrid-Q4_K_M.gguf \
  Q4_K_M
Downloads last month
144
GGUF
Model size
30B params
Architecture
hy_v3
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ChiefBroseph/Hy-Memory-30B-A3B-GGUF

Quantized
(21)
this model