---
title: Hy4-Flash-NVFP4-FP8
canonical_url: "https://www.modelscope.cn/models/Merkyor/Hy4-Flash-NVFP4-FP8"
md_url: "https://www.modelscope.cn/models/Merkyor/Hy4-Flash-NVFP4-FP8.md"
repository: Merkyor/Hy4-Flash-NVFP4-FP8
chinese_name: "Hy4-Flash（NVFP4 + FP8 混合精度）"
last_updated: 2026-11-26
license: other
pipeline_tag: text-generation
tasks:
  - text-generation
base_model:
  - tencent/Hy4-flash
base_model_relation: finetune
downloads: 2
stars: 0
tags:
  - hy4-flash
  - nvfp4
  - fp8
  - basalt
  - blackwell
  - rtx-pro-6000
---

# Hy4-Flash-NVFP4-FP8

> Hy4-Flash-NVFP4-FP8 - Merkyor 在 ModelScope 开源的模型。Hy4-Flash NVFP4 MoE experts + FP8 trunk for RTX PRO 6000 Blackwell. Private review copy.

Merkyor/Hy4-Flash-NVFP4-FP8 是 ModelScope 魔搭社区上的text-generation模型，采用 other 许可，基于 tencent/Hy4-flash 构建。

- **Repository**: Merkyor/Hy4-Flash-NVFP4-FP8
- **License**: other
- **Tasks**: text-generation
- **Base model**: tencent/Hy4-flash
- **Tags**: hy4-flash, nvfp4, fp8, basalt, blackwell, rtx-pro-6000
- **Downloads**: 2
- **Stars**: 0
- **Last updated**: 2026-11-26

Source: https://www.modelscope.cn/models/Merkyor/Hy4-Flash-NVFP4-FP8

---

# Hy4-Flash（NVFP4 + FP8 混合精度）

[中文](#中文) | [English](#english)

<a id="中文"></a>

单卡 **NVIDIA RTX PRO 6000 Blackwell（96 GB，`sm_120`，1.792 TB/s GDDR7）** 上的 Hy4-Flash 开箱即用生产部署方案：41 层自研量化 NVFP4 MoE 专家全常驻显存 + FP8 主干 + FP16 KV，**Engram 向量表强制常驻 `/dev/shm` 纯内存（严禁走 SSD mmap）**。推理引擎采用已验证的 Basalt 合并版二进制（`MERGED = P1 + P5 + P6`）。

- **Hugging Face**：[nerkyor/Hy4-Flash-NVFP4-FP8](https://huggingface.co/nerkyor/Hy4-Flash-NVFP4-FP8)
- **ModelScope（魔搭社区）**：[Merkyor/Hy4-Flash-NVFP4-FP8](https://www.modelscope.cn/models/Merkyor/Hy4-Flash-NVFP4-FP8)
- **GitHub 部署脚本与评测图**：[MerkyorLynn/hy4-flash-blackwell-deploy](https://github.com/MerkyorLynn/hy4-flash-blackwell-deploy)
- **预编译引擎 Release**：[v1.0.0](https://github.com/MerkyorLynn/hy4-flash-blackwell-deploy/releases/tag/v1.0.0)（`basalt`，80.17 MiB，SHA256 `a687714e858a428794d38fa02e26c41461eacc32ab433575d1e2119dd4274f59`）
- **Engram 向量表与社区参考 pack 来源**：[`jesdga/Hy4-flash-Basalt`](https://huggingface.co/jesdga/Hy4-flash-Basalt)（仅稀疏拉取非专家段）
- **许可说明**：基座模型许可沿用 [`tencent/Hy4-flash`](https://huggingface.co/tencent/Hy4-flash)（`license: other`）；推理引擎与启动脚本派生自 [Basalt v0.5.7](https://github.com/jesdga95/basalt)（MIT）。

![全链路吞吐演进：从社区约 50 tok/s 到单流 107、八并发 296 tok/s](eval/charts/fig1_throughput_evolution.png)

## 三步上手

### 1. 硬件要求与下载权重

- **GPU**：RTX PRO 6000 Blackwell（96 GB 显存）
- **主机内存（关键）**：`/dev/shm` 可用空间 **≥ 72 GiB**（Engram 向量表约 59 GiB，**必须常驻 `tmpfs` 内存**；若用 Docker，请务必加 `--shm-size=80g`）
- **软件环境**：CUDA **13.1** 运行时（`libcudart` / `libcublas`），Python 3.11+

```bash
# 方式 A：Hugging Face 下载
hf download nerkyor/Hy4-Flash-NVFP4-FP8 --local-dir ./Hy4-Flash-NVFP4-FP8
# 方式 B：ModelScope 国内高速下载
# modelscope download --model Merkyor/Hy4-Flash-NVFP4-FP8 --local_dir ./Hy4-Flash-NVFP4-FP8

cd Hy4-Flash-NVFP4-FP8
pip install -r engine/requirements.txt
# 若从 GitHub 克隆不含预编译二进制，先拉取引擎（自动校验 SHA256）：
# ./start.sh fetch-bin
```

也可按 [`engine/patches/README.md`](engine/patches/README.md) 从 Basalt v0.5.7 源码自行编译，产物 SHA256 应与上方一致。

### 2. 下载 Engram 向量表（稀疏拉取社区参考 pack，绝不重复下专家）

本仓库已自带 41 层自研 NVFP4 专家（`model/moe-experts/`）与 FP8 主干（`model/fp8-trunk/`），但 **~59 GiB 的 Engram 向量表** 与 tokenizer / 非专家元数据位于社区公开参考包 [`jesdga/Hy4-flash-Basalt`](https://huggingface.co/jesdga/Hy4-flash-Basalt) 的 `Hy4-flash-NVFP4.basalt` 中。

直接运行下方命令即可按 `model/reference-pack.json` 的字节区间**稀疏下载（HTTP Range）**——自动跳过官方 `experts` 段，仅下载约 **70 GiB** 有效数据（含 Engram 向量表）并逐段校验 SHA256，支持断点续传：

```bash
# 默认先落盘到 model/Hy4-flash-NVFP4.basalt 作为持久缓存（重启机器不用重下）；
# 后续 ./start.sh 启动时会自动稀疏拷贝进 /dev/shm/hy4/ 内存运行，绝不直接 mmap SSD！
./start.sh fetch-pack

# 国内网络可使用 HF 镜像加速：
# HF_ENDPOINT=https://hf-mirror.com ./start.sh fetch-pack

# 如果不想占本地磁盘空间，也可直接稀疏下载到内存盘 /dev/shm/hy4：
# PACK_DEST=/dev/shm/hy4/Hy4-flash-NVFP4.basalt ./start.sh fetch-pack
```

> **为什么 Engram 向量表绝不能走 SSD？**
> `start.sh` 已内置 `tmpfs`/`ramfs` 文件系统硬检查：运行服务前会强制确认 `SHM_DIR`（默认 `/dev/shm/hy4`）位于纯内存且剩余空间 ≥ 72 GiB，并通过 `cp --sparse=always` 将参考包拷贝到 `/dev/shm/hy4/Hy4-flash-NVFP4.basalt` 后再启动 `basalt`。如果 Engram 误放在 SSD 上走 `mmap`，单流和八并发吞吐会从 ~91–296 tok/s 直接暴跌到 **~25 / 38 tok/s**。

### 3. 一键启动（含完整参数注释）

```bash
# 先做环境与文件预检（查 GPU、/dev/shm 是否为 tmpfs 且 ≥72GiB、引擎 SHA256、41 层专家完整性）
./start.sh check

# 场景 1：单人交互 / 本地代码助手（推荐甜点位：C1 + --spec 3，实测 ~105 tok/s）
./start.sh c1-spec

# 场景 1 进阶：追求单流极致速度（C1 + --spec 7，实测 ~107 tok/s）
# ./start.sh c1-spec --spec 7

# 场景 2：批量并发 / 基准评测 / 数据合成（C8 + --spec 0，实测 ~286–296 tok/s，多并发切忌开投机）
# ./start.sh c8

# 场景 3：单流关闭投机对照（C1 + --spec 0，实测 ~91.5–94.9 tok/s）
# ./start.sh c1
```

`start.sh` 内部实际执行的已验证生产启动命令等价于（自动导出 `engine/flags.sh`、`HY4_EXPERT_LAYER_FILES` 并清除 `HY4_VERIFY_EXPERT_LOAD`）：

```bash
# 关键环境变量（由 engine/flags.sh + start.sh 自动注入）：
#   HY4_BATCHED_ATTN=1 HY4_TRUNK_CONCAT=1 HY4_FP8_INLINE_PACK=1 HY4_W4A16_PREPACK=1
#   HY4_ADAPTIVE_LOOKUP=1 HY4_MLA_TAIL=1 HY4_FULL_STEP_GRAPH=1
#   HY4_EXPERT_LAYER_FILES=<repo>/model/own-experts.manifest   # 41 层自研 NVFP4 专家绝对路径
#   unset HY4_VERIFY_EXPERT_LOAD                               # 生产必须清除，避免加载校验开销

# 实际启动（PACK 固定指向 /dev/shm/hy4/Hy4-flash-NVFP4.basalt，纯内存加载 Engram 向量表）：
./engine/bin/basalt serve /dev/shm/hy4/Hy4-flash-NVFP4.basalt \
  --python python3 \
  --host 127.0.0.1 --port 8080 \
  --parallel 1 \              # c1/c1-spec 为 1；c8 为 8
  --max-context 73728 \       # 每槽 72K；c8 自动设为 8×73728=589824
  --kv fp16 \                 # 全精度 FP16 KV Cache，保证 72K 长链无损
  --diag-rows 256 \
  --spec 3 \                  # c1-spec 默认 3（甜点）；c8 强制为 0
  --vision off \
  --resident-budget-gib 2     # 配合 41 层专家全常驻显存
```

默认监听 `http://127.0.0.1:8080/v1`（OpenAI 兼容接口）。客户端推荐采样参数：

```json
{ "temperature": 1.0, "reasoning_effort": "max" }
```

`xhigh` 会自动映射为 `max`。**切勿使用 `temperature=0` 跑长思考**，容易触发复读或乱码。

## 推荐运行模式

| 预设 | 命令 | 适用场景 | 实测吞吐（墙钟 / F2L tok/s） |
| --- | --- | --- | --- |
| 交互甜点 | `./start.sh c1-spec`（`--spec 3`） | 单人对话、本地代码助手 | C1：104.95 / 105.28（接受率 49.1%） |
| 极致单流 | `./start.sh c1-spec --spec 7` | 单流极限响应 | C1：106.77 / **107.11**（接受率 49.7%） |
| 批量 / 评测 | `./start.sh c8`（`--spec 0`） | 高并发吞吐、基准评测、数据合成 | C8 扫参：285.15 / 288.18；无投机矩阵峰值 **286.39–295.59** |

> C4 / C8 多并发开启投机反而掉速（约 184 / 272 tok/s）且多占 ~1 GB 显存，批量场景请始终保持 `--spec 0`。

![投机解码扫参：C1 正向，C4/C8 倒挂](eval/charts/fig3_spec_decoding_sweep.png)

## 已验证实测成绩（同一 `MERGED` 二进制）

- 引擎 SHA256：`a687714e858a428794d38fa02e26c41461eacc32ab433575d1e2119dd4274f59`，开关见 `engine/flags.sh`。
- 门禁验证：41 层 unit parity **164/164**、greedy top-1 **16,384/16,384**、端到端文本 **32/32** 全部 100% 通过。
- GPQA 40 题固定集回归：**38/40（95.0%）**，0 截断 / 0 空答；总墙钟 893.96 s，较优化前 1,214.6 s **提速 +33.9%**。

**72K 长上下文全量三套基准（C8 并发 / `max` 推理强度）**

| 基准 | 得分 | 截断 / 空答 | 思考长度 P50 / P70 / P90 (tokens) |
| --- | --- | --- | --- |
| **GPQA Diamond** | **178 / 198（89.9%）** | 0 / 0 | **3,075 / 5,456 / 12,571** |
| **MMLU-Pro** | **470 / 500（94.0%）** | 0 / 0 | **216 / 400 / 2,336** |
| **LiveCodeBench** | **88 / 100（88.0%）** | 1 / 0 | **3,838 / 7,526 / 14,562** |

相比 Coder390，Hy4-Flash 在保持同梯队高分的同时，最大优势之一就是整体思考更加克制精炼、单位有效回答的推理开销更低。

![72K 全量精度与 GPQA 40 题墙钟提速 33.9%](eval/charts/fig4_quality_and_wallclock.png)

![96 GB 显存布局与 Whole-Graph nsys 平均空泡 0.327 ms](eval/charts/fig2_vram_and_nsys_headroom.png)

完整扫参数据见 [`eval/SUMMARY.md`](eval/SUMMARY.md)。

## 仓库目录结构

```text
README.md              中英双语说明与模型卡
start.sh               一键启动 / 拉取二进制与 Engram 参考 pack（内置 tmpfs 防 SSD 校验）
LICENSE                引擎与脚本：MIT
THIRD_PARTY_LICENSES   第三方开源许可声明
model/                 FP8 主干、41 层 NVFP4 专家、SHA256SUMS 与参考 pack 元数据
engine/                Basalt 生产二进制、flags、serve、model_file / tokenizer 与采纳补丁
eval/                  评测汇总与 4 张高清实测图
```

## 常见排障

- **缺少 `engine/bin/basalt`**：运行 `./start.sh fetch-bin` 或从 [Release v1.0.0](https://github.com/MerkyorLynn/hy4-flash-blackwell-deploy/releases/tag/v1.0.0) 下载并校验 SHA256。
- **提示 `SHM_DIR is not tmpfs` 或 `/dev/shm` 空间不足**：宿主机需至少 72 GiB 空闲内存给 `/dev/shm`（Docker 容器请加 `--shm-size=80g`），切勿把 `SHM_DIR` 指到 SSD 目录。
- **漏配专家清单**：请通过 `start.sh` 自动生成 `model/own-experts.manifest` 并导出 `HY4_EXPERT_LAYER_FILES`，切勿设置 `HY4_VERIFY_EXPERT_LOAD`。
- **长思考乱码 / 复读**：检查客户端采样参数是否为 `temperature=1.0`、`reasoning_effort=max`。

---

<a id="english"></a>

## English

Production-ready, out-of-the-box deployment of **Hy4-Flash (NVFP4 MoE experts + FP8 trunk + FP16 KV)** on a single **NVIDIA RTX PRO 6000 Blackwell (96 GB, `sm_120`, 1.792 TB/s GDDR7)**. All 41 custom-quantized NVFP4 MoE expert layers and the FP8 trunk stay resident in VRAM, while the ~59 GiB **Engram embedding table is strictly staged in `/dev/shm` (`tmpfs` RAM, never SSD mmap)**. Powered by the verified merged Basalt binary (`MERGED = P1 + P5 + P6`).

- **Hugging Face**: [nerkyor/Hy4-Flash-NVFP4-FP8](https://huggingface.co/nerkyor/Hy4-Flash-NVFP4-FP8)
- **ModelScope**: [Merkyor/Hy4-Flash-NVFP4-FP8](https://www.modelscope.cn/models/Merkyor/Hy4-Flash-NVFP4-FP8)
- **GitHub (Scripts, Patches & Charts)**: [MerkyorLynn/hy4-flash-blackwell-deploy](https://github.com/MerkyorLynn/hy4-flash-blackwell-deploy)
- **Prebuilt Engine Release**: [v1.0.0](https://github.com/MerkyorLynn/hy4-flash-blackwell-deploy/releases/tag/v1.0.0) (`basalt`, 80.17 MiB, SHA256 `a687714e858a428794d38fa02e26c41461eacc32ab433575d1e2119dd4274f59`)
- **Engram Table & Reference Pack Source**: [`jesdga/Hy4-flash-Basalt`](https://huggingface.co/jesdga/Hy4-flash-Basalt) (sparse range-fetch, non-expert segments only)
- **License**: Base model weights follow [`tencent/Hy4-flash`](https://huggingface.co/tencent/Hy4-flash) (`license: other`). Engine patches and launcher scripts derive from [Basalt v0.5.7](https://github.com/jesdga95/basalt) (MIT).

### Quick Start (3 Steps)

**1. Requirements & Download**
- **GPU**: NVIDIA RTX PRO 6000 Blackwell (96 GB VRAM)
- **Host RAM (Critical)**: **≥ 72 GiB** free in `/dev/shm` (`tmpfs`, for the ~59 GiB Engram table; pass `--shm-size=80g` in Docker)
- **Runtime**: CUDA **13.1** (`libcudart` / `libcublas`), Python 3.11+

```bash
# Download from Hugging Face
hf download nerkyor/Hy4-Flash-NVFP4-FP8 --local-dir ./Hy4-Flash-NVFP4-FP8
# Or from ModelScope
# modelscope download --model Merkyor/Hy4-Flash-NVFP4-FP8 --local_dir ./Hy4-Flash-NVFP4-FP8

cd Hy4-Flash-NVFP4-FP8
pip install -r engine/requirements.txt
# If cloning from GitHub without the binary: ./start.sh fetch-bin
```

**2. Sparse-Fetch the Engram Embedding Table (Reference Pack)**

`./start.sh fetch-pack` uses HTTP range requests (per `model/reference-pack.json`) to download only the non-expert segments (~70 GiB, including the ~59 GiB Engram table and tokenizer) from `jesdga/Hy4-flash-Basalt`, verifies every section SHA256, and skips the official expert weights:

```bash
# Caches sparse pack to model/Hy4-flash-NVFP4.basalt; start.sh automatically sparse-copies it into /dev/shm/hy4 before launch
./start.sh fetch-pack

# Optional: download directly into RAM (/dev/shm/hy4) without using disk space:
# PACK_DEST=/dev/shm/hy4/Hy4-flash-NVFP4.basalt ./start.sh fetch-pack

# Optional: use an HF mirror:
# HF_ENDPOINT=https://hf-mirror.com ./start.sh fetch-pack
```

> `start.sh` enforces a `tmpfs`/`ramfs` filesystem check on `SHM_DIR` (`/dev/shm/hy4`) so Engram never silently falls back to SSD mmap (which collapses throughput from ~91–296 to ~25–38 tok/s).

**3. Launch Server**
```bash
./start.sh check      # Preflight GPU, tmpfs /dev/shm >= 72 GiB, binary SHA256, and 41 experts
./start.sh c1-spec    # Interactive single-stream (--spec 3, ~105 tok/s; --spec 7 for ~107 tok/s)
# ./start.sh c8       # Batch / eval 8-way concurrency (--spec 0, ~286–296 tok/s)
# ./start.sh c1       # Single-stream without speculation (--spec 0, ~91.5–94.9 tok/s)
```

Serves an OpenAI-compatible API on `http://127.0.0.1:8080/v1`. Recommended sampling parameters:
```json
{ "temperature": 1.0, "reasoning_effort": "max" }
```
*(Do not use `temperature=0` for long chain-of-thought reasoning; `xhigh` automatically maps to `max`.)*

### Recommended Presets & Throughput

| Preset | Command | Best For | Measured Throughput (Wall / F2L tok/s) |
| --- | --- | --- | --- |
| Interactive | `./start.sh c1-spec` (`--spec 3`) | Single-user chat / coding | C1: 104.95 / 105.28 (49.1% accept) |
| Max C1 | `./start.sh c1-spec --spec 7` | Peak single-stream speed | C1: 106.77 / **107.11** (49.7% accept) |
| Batch / Eval | `./start.sh c8` (`--spec 0`) | High-throughput batch / evals | C8 sweep: 285.15 / 288.18; matrix peak **286.39–295.59** |

> Speculative decoding hurts throughput at C4/C8 (~184 / 272 tok/s) and adds ~1 GB VRAM overhead; always use `--spec 0` for multi-concurrency workloads.

### Verified Accuracy & 72K Long-Context Benchmarks

- **Deterministic Gates**: 41-layer unit parity **164/164**, greedy top-1 **16,384/16,384**, E2E text **32/32** — 100% pass.
- **GPQA 40-Q Regression**: **38/40 (95.0%)**, 0 truncations / 0 empty; wall-clock 893.96 s (**+33.9% faster** than baseline 1,214.6 s).
- **Whole-Graph `nsys` Headroom**: 25.33 ms mean step, only **0.327 ms** true inter-step GPU gap (~98.7% GPU active).

| Benchmark (C8 / 72K / `max`) | Score | Trunc / Empty | Thinking Length P50 / P70 / P90 (tokens) |
| --- | --- | --- | --- |
| **GPQA Diamond** | **178 / 198 (89.9%)** | 0 / 0 | **3,075 / 5,456 / 12,571** |
| **MMLU-Pro** | **470 / 500 (94.0%)** | 0 / 0 | **216 / 400 / 2,336** |
| **LiveCodeBench** | **88 / 100 (88.0%)** | 1 / 0 | **3,838 / 7,526 / 14,562** |

Compared with Coder390, one of Hy4-Flash's biggest advantages is significantly more concise thinking while maintaining top-tier benchmark scores.

### Repository Layout

```text
README.md              Bilingual guide & model card
start.sh               One-command launcher / binary & Engram pack fetcher (enforces tmpfs /dev/shm)
LICENSE                MIT (engine & scripts)
THIRD_PARTY_LICENSES   Third-party license notices
model/                 FP8 trunk, 41 NVFP4 expert layers, SHA256SUMS, pack metadata
engine/                Basalt binary, flags, serve/, tools/{model_file,tokenizer}.py, patches
eval/                  Benchmark summary & 4 high-res charts
```
