Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: tencent/Hy3
|
|
|
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
library_name: vllm
|
| 6 |
tags:
|
| 7 |
- hunyuan
|
|
|
|
| 8 |
- mixture-of-experts
|
| 9 |
- moe
|
| 10 |
- 4-bit
|
|
@@ -17,7 +19,7 @@ tags:
|
|
| 17 |
- yarn
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# Hy3
|
| 21 |
|
| 22 |
A **4-bit weight-only (W4A16)** quantization of **[tencent/Hy3](https://huggingface.co/tencent/Hy3)**
|
| 23 |
(`HYV3ForCausalLM`, `hy_v3`) — a 295B-parameter / 21B-active Mixture-of-Experts model.
|
|
@@ -33,16 +35,7 @@ Packaged in the **`compressed-tensors`** `pack-quantized` format so it loads dir
|
|
| 33 |
Marlin INT4 MoE + Linear kernels. Fast tensor-core prefill.
|
| 34 |
- **Long context via YaRN.** With YaRN RoPE scaling the context extends from the native
|
| 35 |
**262,144** up to **1,048,576 (1M)** tokens (configurable). Dense needle-in-a-haystack
|
| 36 |
-
retrieval is **verified past native (
|
| 37 |
-
|
| 38 |
-
## Verified results (single B300, this checkpoint)
|
| 39 |
-
|
| 40 |
-
| Test | Result |
|
| 41 |
-
|---|---|
|
| 42 |
-
| **HumanEval pass@1 (greedy)** | ✅ **150/164 = 91.5%** — coding ability well-preserved at 4-bit |
|
| 43 |
-
| Needle-in-a-haystack 4K / 16K / 64K / 137K | ✅ all PASS |
|
| 44 |
-
| **Needle-in-a-haystack 320k/1024K dense (YaRN ×4, fp8 KV)** | ✅ **PASS** |
|
| 45 |
-
|
| 46 |
|
| 47 |
## Quantization details
|
| 48 |
|
|
@@ -64,8 +57,8 @@ Requires a vLLM build new enough to include the `hy_v3` architecture (vLLM `main
|
|
| 64 |
writing). Example on a single GPU:
|
| 65 |
|
| 66 |
```bash
|
| 67 |
-
vllm serve /path/to/
|
| 68 |
-
--max-model-len
|
| 69 |
--gpu-memory-utilization 0.9 \
|
| 70 |
--trust-remote-code
|
| 71 |
```
|
|
@@ -75,10 +68,10 @@ runtime JIT could not compile for `compute_103a` with the bundled CUDA toolkit,
|
|
| 75 |
default sampler/attention. Work around it with the Triton attention backend + native sampler:
|
| 76 |
|
| 77 |
```bash
|
| 78 |
-
VLLM_USE_FLASHINFER_SAMPLER=0 vllm serve /path/
|
| 79 |
--attention-backend TRITON_ATTN \
|
| 80 |
--kv-cache-dtype fp8 \
|
| 81 |
-
--max-model-len
|
| 82 |
--gpu-memory-utilization 0.9 \
|
| 83 |
--trust-remote-code --enforce-eager
|
| 84 |
```
|
|
@@ -116,9 +109,11 @@ Memory on a single ~275 GB GPU (146 GB weights):
|
|
| 116 |
| Test | Result |
|
| 117 |
|---|---|
|
| 118 |
| **HumanEval pass@1 (greedy)** | ✅ **150/164 = 91.5%** — coding ability well-preserved at 4-bit |
|
| 119 |
-
|
|
| 120 |
-
|
|
| 121 |
-
|
|
|
|
|
|
|
| 122 |
|
| 123 |
<details>
|
| 124 |
<summary><b>How HumanEval was measured</b> (for reproducibility)</summary>
|
|
@@ -138,12 +133,19 @@ Memory on a single ~275 GB GPU (146 GB weights):
|
|
| 138 |
raw-completion protocol), so a few of the 14 misses may be extraction artifacts — treat 91.5%
|
| 139 |
as a conservative figure.
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
</details>
|
| 142 |
|
| 143 |
## Caveats & honesty
|
| 144 |
|
| 145 |
- **4-bit RTN is lossy.** Chat/reasoning quality is well-preserved in our checks, but expect small
|
| 146 |
degradation vs the BF16 original, especially on exact-match/coding tasks.
|
|
|
|
|
|
|
|
|
|
| 147 |
- This is a **community derivative**, not affiliated with or endorsed by Tencent.
|
| 148 |
|
| 149 |
## License
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: tencent/Hy3
|
| 4 |
+
base_model_relation: quantized
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
library_name: vllm
|
| 7 |
tags:
|
| 8 |
- hunyuan
|
| 9 |
+
- hy_v3
|
| 10 |
- mixture-of-experts
|
| 11 |
- moe
|
| 12 |
- 4-bit
|
|
|
|
| 19 |
- yarn
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# Hy3-W4A16 — 4-bit (INT4) quantization of tencent/Hy3
|
| 23 |
|
| 24 |
A **4-bit weight-only (W4A16)** quantization of **[tencent/Hy3](https://huggingface.co/tencent/Hy3)**
|
| 25 |
(`HYV3ForCausalLM`, `hy_v3`) — a 295B-parameter / 21B-active Mixture-of-Experts model.
|
|
|
|
| 35 |
Marlin INT4 MoE + Linear kernels. Fast tensor-core prefill.
|
| 36 |
- **Long context via YaRN.** With YaRN RoPE scaling the context extends from the native
|
| 37 |
**262,144** up to **1,048,576 (1M)** tokens (configurable). Dense needle-in-a-haystack
|
| 38 |
+
retrieval is **verified past native (318K, PASS)** on a single GPU; see *Long context* below.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
## Quantization details
|
| 41 |
|
|
|
|
| 57 |
writing). Example on a single GPU:
|
| 58 |
|
| 59 |
```bash
|
| 60 |
+
vllm serve /path/to/Hy3-W4A16 \
|
| 61 |
+
--max-model-len 262144 \
|
| 62 |
--gpu-memory-utilization 0.9 \
|
| 63 |
--trust-remote-code
|
| 64 |
```
|
|
|
|
| 68 |
default sampler/attention. Work around it with the Triton attention backend + native sampler:
|
| 69 |
|
| 70 |
```bash
|
| 71 |
+
VLLM_USE_FLASHINFER_SAMPLER=0 vllm serve /path/to/Hy3-W4A16 \
|
| 72 |
--attention-backend TRITON_ATTN \
|
| 73 |
--kv-cache-dtype fp8 \
|
| 74 |
+
--max-model-len 262144 \
|
| 75 |
--gpu-memory-utilization 0.9 \
|
| 76 |
--trust-remote-code --enforce-eager
|
| 77 |
```
|
|
|
|
| 109 |
| Test | Result |
|
| 110 |
|---|---|
|
| 111 |
| **HumanEval pass@1 (greedy)** | ✅ **150/164 = 91.5%** — coding ability well-preserved at 4-bit |
|
| 112 |
+
| **GSM8K (0-shot CoT, greedy)** | ✅ **1265/1319 = 95.9%** — math reasoning preserved at 4-bit |
|
| 113 |
+
| Chat sanity (`11+22+33` → 66; capital of France → Paris; first 5 primes) | ✅ correct |
|
| 114 |
+
| Needle-in-a-haystack 4K / 16K / 64K / 137K (in-range) | ✅ all PASS |
|
| 115 |
+
| **Needle-in-a-haystack 318K dense (YaRN ×4, fp8 KV)** | ✅ **PASS** — retrieval works past the native 262,144 |
|
| 116 |
+
| 1M-*distance* retrieval (sparse position probe, YaRN ×4) | ✅ retrieves where raw RoPE fails |
|
| 117 |
|
| 118 |
<details>
|
| 119 |
<summary><b>How HumanEval was measured</b> (for reproducibility)</summary>
|
|
|
|
| 133 |
raw-completion protocol), so a few of the 14 misses may be extraction artifacts — treat 91.5%
|
| 134 |
as a conservative figure.
|
| 135 |
|
| 136 |
+
**GSM8K:** full 1319-problem test set, **0-shot chain-of-thought**, greedy (`temperature=0`,
|
| 137 |
+
`max_tokens=512`), prompt *"Solve step by step… on the last line write 'The answer is <number>'"*;
|
| 138 |
+
the final number is compared to the gold answer (after `####`). Result: **1265/1319 = 95.9%**.
|
| 139 |
+
|
| 140 |
</details>
|
| 141 |
|
| 142 |
## Caveats & honesty
|
| 143 |
|
| 144 |
- **4-bit RTN is lossy.** Chat/reasoning quality is well-preserved in our checks, but expect small
|
| 145 |
degradation vs the BF16 original, especially on exact-match/coding tasks.
|
| 146 |
+
- **`>262144` is extrapolation.** The base model was trained to 262,144; YaRN is applied at inference.
|
| 147 |
+
Dense retrieval is verified to **318K**; full dense-1M quality across depths is **not** exhaustively
|
| 148 |
+
validated here — evaluate for your use case.
|
| 149 |
- This is a **community derivative**, not affiliated with or endorsed by Tencent.
|
| 150 |
|
| 151 |
## License
|