Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
base_model: tencent/Hy4-flash
|
| 4 |
+
tags:
|
| 5 |
+
- strata
|
| 6 |
+
- hy4-flash
|
| 7 |
+
- moe
|
| 8 |
+
- quantization
|
| 9 |
+
- latent-moe
|
| 10 |
+
- engram
|
| 11 |
+
- dfly2
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Tencent Hy4-Flash (220B-A12B) β Native Strata (`.strata` v1.0) Quantizations
|
| 15 |
+
|
| 16 |
+
Native **`.strata` v1.0** quantizations of [`tencent/Hy4-flash`](https://huggingface.co/tencent/Hy4-flash) (pinned revision `d88c9dfd96ba4f2e6b92adba0b8e8f1c8696f959`), engineered specifically for **consumer PCs (`64β128 GiB` RAM + `8β24+ GiB` GPU)** and **unified-memory workstations (`128 GiB` Strix Halo / Apple Silicon / DGX Spark)** running the native Strata engine (`strata-hy4` β pure C++/CUDA/HIP/Metal/SYCL, zero `llama.cpp`).
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## Key Innovations
|
| 21 |
+
|
| 22 |
+
1. **Separated Lossless 8-Bit NVMe Engram Shard (`Hy4-Flash-Engram-Q8.strata`, `67.58 GB`):**
|
| 23 |
+
- `Hy4-Flash` contains `63.36B` parameters in 4 Engram lookup tables (Layers `1, 11, 21, 31`). Standard GGUFs keep this entire table in RAM (`156.8 GiB` for `Q4_K_M`).
|
| 24 |
+
- `.strata` v1.0 moves the 4-module Engram table into **one shared `4 KiB` page-frame-aligned NVMe shard** (`Q8_INT8_SCALE_F32`: `4 B` FP32 scale + `96 B` symmetric `int8` = `100 B/row`, exact `40` rows per `4,096 B` NVMe page, **zero page straddling**) paired with a `900 MiB` Host-RAM cache (`64 MiB` embedded Section 2 hot seed + `836 MiB` clock LRU).
|
| 25 |
+
- **Measured fidelity vs BF16 Engram:** row cosine similarity **`0.999986`** (18Γ lower error than `FP8_E4M3` at identical `1` NVMe page read per miss!), `Q0-02` `top-1 = 95.68%` (`low-entropy KL = 0.01693`).
|
| 26 |
+
- **RAM saved:** `~60+ GiB` compared to GGUF β allowing `SQ-64` (`62.03 GB`) to fit 100% in `64 GiB` RAM with **`0 B/s` expert SSD spill**, and `SQ-128` (`113.65 GB`) to fit 100% in `128 GiB` RAM/UMA!
|
| 27 |
+
2. **Zero-Cost Folded MACaQ `s_xform=2`:**
|
| 28 |
+
- Per-channel activation smoothing + 64-wide Block-Hadamard ($H_{64}$) folded directly into `Q8` `routed_expert_down_proj` (`[1536, 3072]`) β **zero runtime transform cost**.
|
| 29 |
+
3. **Batched Pure-GPU In-HBM Block-LDL (GPTQ) + MACaQ 64-Flip Analytical Hessian Refinement:**
|
| 30 |
+
- Exact per-expert `1536Γ1536` FP32 Hessians accumulated over `96,256` 13-gram-decontaminated multi-domain calibration tokens (`505β512/512` experts hit per layer across all `20,992` routed experts).
|
| 31 |
+
- Per-sub-group MSE/Hessian-optimal clipping + Block-LDL propagation + up to 64 analytical Hessian coordinate flips per row across all 8 `S_K` codecs (`S1.25`, `S1.5`, `S2_K..S6_K`, `S8_K`).
|
| 32 |
+
4. **MACaQ-R Residual Compensation:**
|
| 33 |
+
- Damped ridge compensation absorbs systematic routed-expert quantization error into `Q8` `routed_expert_up_proj` and `shared_experts.down_proj`, reducing per-layer LatentMoE output MSE by **`-26%` to `-54%`** on every MoE layer across all builds.
|
| 34 |
+
5. **End-to-End Scale-QAT + Full 42-Layer Deep Polish on `SQ-64`:**
|
| 35 |
+
- All builds tuned against exact BF16 teacher top-256 + tail log-probabilities.
|
| 36 |
+
- Flagship **`Hy4-Flash-SQ-64.strata`** additionally received a **full 42-layer gradient-checkpointed deep Scale-QAT polish** (`422` parameter tensors / `821,069` FP32 params across all 42 layers' Sandwich norms, pre-norms, 4-stream `iHC` scales/bases, and per-layer LatentMoE & shared-expert channel scales folded zero-cost into Section 1).
|
| 37 |
+
6. **Embedded Proximal-QAT Distilled 5-Layer `DFly2` Speculative Tree-8 Drafter (`0.45 GB`, `S4_K`, `0 B` extra KV):**
|
| 38 |
+
- Full 5-layer `DFly2` drafter embedded in Section 1 and distilled against the quantized target for lossless Tree-8 + probabilistic SpecInfer multi-token speculative decoding (`0 B` additional KV cache, `1.7Γβ2.6Γ` end-to-end decode speedup).
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## Files & Hardware Recommendations
|
| 43 |
+
|
| 44 |
+
All three shipping transformer builds share the single **`Hy4-Flash-Engram-Q8.strata`** shard (required) and **`Hy4-Flash-Vision.strata`** shard (multimodal image reading, enabled by default in Strata `0.2.18+`):
|
| 45 |
+
|
| 46 |
+
| File | Exact Size (`GB` / `GiB`) | RAM + VRAM Resident | Expert Bands (`Hot / Warm / Cold`) | Recommended Hardware | Whole-File SHA-256 |
|
| 47 |
+
| :--- | :---: | :---: | :--- | :--- | :--- |
|
| 48 |
+
| **`Hy4-Flash-SQ-128.strata`** | **`113.65 GB`** (`105.85 GiB`) | `~107.5 GiB` | `160 S6_K+S8_K / 224 S5_K+S6_K / 128 S4_K+S5_K` + `S8_K` trunk | **128 GiB RAM + GPU** or **128 GiB UMA** (highest quality, near-lossless) | `6e8ba2729465f38ed42b5bfa7db02c92beddc25ca0413b7f0c24ab9f1e8b51f4` |
|
| 49 |
+
| **`Hy4-Flash-SQ-96.strata`** | **`89.58 GB`** (`83.43 GiB`) | `~85.1 GiB` | `128 S5_K+S6_K / 224 S4_K+S5_K / 160 S3_K+S4_K` + `S6_K` trunk | **96 GiB RAM + GPU** or **128 GiB UMA** (high quality) | `3b1c5755a220c69892b3d2dbad506b8593a30be24b17a390ecbd1642c0c1e14c` |
|
| 50 |
+
| **`Hy4-Flash-SQ-64.strata`** *(42L Polished)* | **`62.03 GB`** (`57.77 GiB`) | `~59.4 GiB` | `80 S4_K+S4_K / 176 S3_K+S3_K / 256 S2_K+S3_K` + `S5_K` trunk | **64 GiB RAM + 8/12/16+ GiB GPU** (Flagship, `0` expert SSD spill) | `b2cc38fe4bded35df82a701f9e868ea09c6fcd9be52c8446289e394f804417b2` |
|
| 51 |
+
| **`Hy4-Flash-Engram-Q8.strata`** *(Required)* | **`67.58 GB`** (`62.94 GiB`) | `0.90 GiB` LRU only | `Q8_INT8_SCALE_F32` (`40` rows/4K page, 4 modules) | **NVMe SSD** (shared by all builds; Sec 4 SHA-256: `176944953bf2b601645d206171964f7fa51b77522ef5dc14ae61b0eb1c803d74`) | `ab0cf9b3f9c64bd25f6212d4508e7443ab8b9bc133fbccc7bdfb83510a20c2c1` |
|
| 52 |
+
| **`Hy4-Flash-Vision.strata`** *(Vision)* | **`0.934 GB`** (`0.870 GiB`) | On demand | `SigLIP2-400M` 27L ViT + `perceive` projector (`441` tensors) | Multimodal image reading shard | `ef09bceff8f01b8d226d2dc56aef09cec719b21b45783ee9b5d64e7241b72a09` |
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## Full 42-Layer Measured Evaluation Results (vs Exact `BF16` Teacher)
|
| 57 |
+
|
| 58 |
+
Evaluated directly end-to-end from the packed `.strata` v1.0 files + `Hy4-Flash-Engram-Q8.strata` across all 42 layers on 13-gram-decontaminated held-out `development` (`8 Γ 512` tokens, reasoning) and `final_test` (`8 Γ 512` tokens, tool-calling) splits (all 512 raw prompt tokens scored β note that low-entropy generated-token KL is typically 2β3Γ lower):
|
| 59 |
+
|
| 60 |
+
| Build | Dev Mean KL | Dev Same Top-1 | Dev PPL (`BF16 = 5.263`) | Test Mean KL | Test Same Top-1 | Test PPL (`BF16 = 15.990`) | Low-Entropy Seq (`BF16 PPL = 3.06`) Top-1 / KL |
|
| 61 |
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 62 |
+
| **`Hy4-Flash-SQ-128.strata`** | **`0.08789`** | **`92.53%`** | **`5.204`** | **`0.17969`** | **`90.31%`** | **`15.062`** | **`94.53%`** / **`0.0477`** |
|
| 63 |
+
| **`Hy4-Flash-SQ-96.strata`** | **`0.13591`** | **`90.67%`** | **`5.309`** | **`0.23661`** | **`88.35%`** | **`15.478`** | **`94.73%`** / **`0.0660`** |
|
| 64 |
+
| **`Hy4-Flash-SQ-64.strata`** *(42L Polished)* | **`0.23206`** | **`86.87%`** | **`3.854`** | **`0.51828`** | **`81.98%`** | **`7.614`** | **`92.19%`** / **`0.1164`** *(pre-polish)* |
|
| 65 |
+
|
| 66 |
+
### Controlled 3-Layer Pilot (`Q1-06`, Layers 0β2 Substituted Inside 42-Layer BF16 Base)
|
| 67 |
+
- `Engram-Q8.strata` vs BF16 Engram: `all-prompt KL = 0.01749`, `low-entropy KL = 0.01693`, `top-1 = 95.68%` (`cos = 0.999986`)
|
| 68 |
+
- `SQ-128`: `mean KL = 0.01784` (`+0.00035` net over Engram-Q8), `top-1 = 94.24%`
|
| 69 |
+
- `SQ-96`: `mean KL = 0.01846` (`+0.00097` net over Engram-Q8), `top-1 = 94.24%`
|
| 70 |
+
- `SQ-64`: `mean KL = 0.02410` (`+0.00661` net over Engram-Q8), `top-1 = 92.81%`
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
## Native Engine & Hardware Support (`Strata 0.2.18+`)
|
| 75 |
+
|
| 76 |
+
Supported out of the box in **Strata Desktop** and **Strata CLI (`strata launch`)** across:
|
| 77 |
+
- **NVIDIA CUDA (`sm_70` Volta through `sm_120`/`sm_121` Blackwell & DGX Spark):** Adaptive VRAM expert cache, Split-K MoE decode, CUDA Graphs, cuBLAS side-stream prefill, and Tree-8 `DFly2` speculative decoding.
|
| 78 |
+
- **AMD ROCm HIP (`gfx1030` RDNA2, `gfx1100` RDNA3, `gfx1151` Ryzen AI Max+ 395 Strix Halo, `gfx1200`/`gfx1201` RDNA4):** Windows & Linux native HIP builds.
|
| 79 |
+
- **Apple Silicon Metal (`M1βM5` Max / Ultra):** Unified-memory zero-copy Metal execution.
|
| 80 |
+
- **Intel Arc SYCL (`XMX` / `dp4a`):** Native Intel Arc GPU backend.
|
| 81 |
+
|
| 82 |
+
## License & Attribution
|
| 83 |
+
Base model: [`tencent/Hy4-flash`](https://huggingface.co/tencent/Hy4-flash) (subject to Tencent's base model license). Quantization & `.strata` v1.0 container format built with Strata Quant (`tools/squant`).
|