Downloads · 30 days
9
7% of all-time downloads
avtc/Hy3-autoround-RTN-4bit-tp8-ep
Hy3-autoround-RTN-4bit-tp8-ep is a text generation model from avtc. Use it when you need the model to write or continue text. It is set up for vllm. The card lists the license as apache-2.0.
This repository contains a 4-bit RTN-quantized version of the Tencent Hy3 Mixture-of-Experts model, tuned for max fp8 context window on 8x3090.
Downloads · 30 days
9
7% of all-time downloads
All-time downloads
132
Public
Parameters
44.4B
163 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors163 GB · 100%
How the weights are stored.
I3237B · 83%
From the Hugging Face model README
This repository contains a 4-bit RTN-quantized version of the Tencent Hy3 Mixture-of-Experts model, tuned for max fp8 context window on 8x3090.
Hy3 is a 295B-parameter MoE model with 21B active parameters, 192 experts (top-8 routed), and a 256K context window. Quantizing it to 4-bit with expert group_size=128 reduces the weight footprint, enabling a 174K context window with fp8 kv cache on a single 8x24 GB node.
Quantized with AutoRound (0.14.0) in model-free RTN mode (calibration-free, iters=0).
auto_round /home/ubuntu/models/Hy3-tencent \
--model_free \
--scheme W4A16 \
--group_size 128 \
--layer_config "{ '.*model.layers.0.':{'bits':16,'data_type':'float'}, '.*model.layers.80.':{'bits':16,'data_type':'float'}, '.*shared_mlp':{'group_size':64} }" \
--output_dir /home/ubuntu/models/autoround/tencent-Hy3-RTN-tp8-EP
| Property | Value |
|---|---|
| Quant method | AutoRound RTN (auto_round:auto_gptq packing) |
| Bits | 4 |
| Symmetric | true |
| Global group size | 128 (dense layers, attention projections) |
| Routed-expert group size | 128 (global default — requires --enable-expert-parallel) |
| Shared-MLP group size | 64 (dynamic override) |
| Layer 0 (dense FFN) | fp16 (not quantized) |
| Layer 80 (MTP) | fp16 (not quantized, optional) |
| All norms / router / lm_head | fp16 |
Layer 0 is kept in full precision as the single dense FFN layer that processes every token. Layer 80 is the Multi-Token Prediction (MTP) draft layer — kept in fp16 for optimal speculative-decoding acceptance. When MTP is not enabled, layer 80 does not occupy VRAM.
This model requires a patched vLLM build. Stock vLLM cannot load it due to weight-name remapping and shared-expert prefix issues:
➡️ avtc/vllm @ fix/load-quantized-hy3
Build from source:
git clone -b fix/load-quantized-hy3 https://github.com/avtc/vllm.git
cd vllm
uv venv --python 3.12 --seed --managed-python
source .venv/bin/activate
TORCH_CUDA_ARCH_LIST="8.6" uv pip install --editable . --torch-backend=auto
Set
TORCH_CUDA_ARCH_LISTto your GPU's compute capability to skip unused architectures and speed up the build (e.g.8.6for RTX 3090,8.9for RTX 4090,9.0for H100).
Verified to run with Expert Parallel on 8x NVIDIA RTX 3090 (24 GB each) GPUs.
| Config | Value |
|---|---|
| Parallel | --enable-expert-parallel -tp 8 |
| KV cache | fp8_e4m3 (2x faster than 4-bit on 3090) |
| Max context | 174K tokens at --gpu-memory-utilization 0.945 |
| Model weight footprint | ~152 GB |
| MTP | Optional — does not occupy VRAM when not enabled |
export VLLM_SLEEP_WHEN_IDLE=1
export TORCH_CUDA_ARCH_LIST="8.6"
export CUDA_VISIBLE_DEVICES=4,5,6,7,0,1,2,3
export RAY_memory_monitor_refresh_ms=0
export NCCL_CUMEM_ENABLE=0
export VLLM_ENABLE_CUDAGRAPH_GC=1
export VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0
export VLLM_ALLOW_LONG_MAX_MODEL_LEN=1
export VLLM_MARLIN_USE_ATOMIC_ADD=1
export VLLM_FLOAT32_MATMUL_PRECISION=high
export OMP_NUM_THREADS=1
export VLLM_FLASHINFER_ALLREDUCE_BACKEND=trtllm
vllm serve /path/to/tencent-Hy3-RTN-tp8-EP \
-tp 8 \
--enable-expert-parallel \
--tool-call-parser hy_v3 \
--reasoning-parser hy_v3 \
--enable-auto-tool-choice \
--served-model-name hy3 \
--port 8000 \
--host 0.0.0.0 \
--uvicorn-log-level info \
--trust-remote-code \
--max-num-seqs 4 \
--seed 1234 \
--max-model-len 174000 \
--skip-mm-profiling \
-O3 \
--no-use-tqdm-on-load \
--default-chat-template-kwargs '{"interleaved_thinking": true}' \
--performance-mode balanced \
--enable-chunked-prefill \
--max-num-batched-tokens 2048 \
--enable-prefix-caching \
--kv-cache-dtype fp8_e4m3 \
--gpu-memory-utilization 0.945
MTP is optional and does not occupy VRAM when not enabled. Add these flags to enable Multi-Token Prediction (uses layer 80 fp16 weights and left almost no space for kv cache on 8x3090 ~10K size):
--speculative-config.method mtp \
--speculative-config.num_speculative_tokens 2
Then call the OpenAI-compatible API:
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
response = client.chat.completions.create(
model="hy3",
messages=[
{"role": "user", "content": "Hello! Can you briefly introduce yourself?"},
],
temperature=0.9,
top_p=1.0,
# reasoning_effort: "no_think" (default, direct response),
# "low", "high" (deep chain-of-thought)
extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}},
)
print(response.choices[0].message.content)
Recommended sampling parameters: temperature=0.9, top_p=1.0.
Reasoning mode: Set reasoning_effort to "high" for complex tasks (math, coding, reasoning) or "no_think" for direct responses.
For full details on the architecture, benchmarks, and capabilities of the base model, see the original model card: ➡️ tencent/Hy3
| Property | Value |
|---|---|
| Architecture | Mixture-of-Experts (MoE) |
| Total Parameters | 295B |
| Activated Parameters | 21B |
| Number of Layers | 80 (+ 1 MTP layer in fp16) |
| Attention Heads | 64 (GQA, 8 KV heads, head dim 128) |
| Hidden Size | 4096 |
| Intermediate Size | 13312 (dense), 1536 (expert) |
| Context Length | 256K |
| Vocabulary Size | 120,832 |
| Number of Experts | 192, top-8 activated |
| License | Apache 2.0 |
This model inherits the Apache License 2.0 of the base model. See the original license.