1314521gjy/ninfer-fusion-kvmem
No repository description was reported by the source.
Older snapshot: check the original source for current information.
From the publisher
README & documentation
Source previewRead the project’s overview, installation instructions and usage examples. The original README is the source of truth.
面向 Windows / NVIDIA GPU 的长上下文推理实验:以 KVMem 环为主线,融合流式(streaming)的「缺页可拉回、容量不够就按账让位」,让设备 KV 池可以小于逻辑上下文;配主机 KV 存储、按需检索与分段注入网关,多轮仍能复用上下文,超出池的题面走分片而不是静默错。 本项目基于 NInfer 0.11.0 线(KVMem 融合线;2026-10-19 的 sm86 / sm89 / sm120a 三份引擎由同一份源码各自编译),发布融合后的源码、复现记录和验证工具。它是 NInfer 的下游衍生项目;基座与第三方算法来源见 署名与改动声明。 获取引擎 · 编译指南 · 复现白皮书 · 实测回执 · 问题反馈 长上下文会增加 KV 缓存占用。本项目将三个容量分别配置: KVMem 环保留常驻窗口,将其他页降到主机层;需要时按内容相关性选页、搬回设备并装配注意力窗口。host-backed 复用与惰性物化让后续轮次可以继续使用主机驻留的检查点。按卡档位则为内核调度选择路由。 小 KV 池不代表模型权重也能装进小显存,也不代表检索与完整注意力在任意任务上质量等价。模型权重、运行工作区、投机头、CUDA Graph 和主机内存都需要单独预算。机制、容量公式与负控见 白皮书 §2–§4。 这一版做的是架构融合,不是修单个 bug:把流式(streaming)里"缺页可拉回、容量不够时谁让位"的机制接到 KVMem 环上,同时新增 Bonsai 27B ternary(qwen35)这条模型线。 加了什么 27B ternary 几何:64 层 = 3×linearattention + 1×fullattention ⇒ 只有 16 层带 KV,25,728 B/token;contextwindow 262144。本机(RTX 4080 SUPER / sm89)8 GiB 快档实测 engine ≈7,365 MiB、decode 100–275 tok/s、TTFT 10 s 量级(20K 题面);8 GiB 长档为预测值。 硬边界(读这一版必须先知道):题面 token > 池 token ⇒ 单请求答案不可信(引擎会打 unverified 告警;"没打警告"不等于安全,见 src/serve/generationservice.cpp 的注释)。超池题面必须走分片网关、每片 ≤ 池。分片聚合已实测精确(94K 题面 / 池 32,768 ⇒ n=3、final=3241 = 真值)。 这一版与下方旧口径的关系:下方"获取与启动 / 8 GB 档 / 实测结果"记录的是旧线(PQ2 + dflash2 + start-8g.bat),仍然有效但不要与新线配方混用;新线的两套 8 GB 配方见"当前边界与排错"里新增的小节。 本版同时支持 Qwen4 预览架构 —— 即 Qwen3.8-Flash-Next。artifact 里 architectures = Qwen4ExpForConditionalGeneration、modeltype = qwen4exp 会被识别成 Architecture::Qwen4Exp(src/models/registry.cpp:15-20,实现目录 src/models/qwen38flashnext/)。 它与本文主线的 27B ternary 是两条不同架构线,配方与 env 不可混用;本轮三 arch 引擎只针对 27B 线构建。 源码可以直接克隆;运行引擎和模型时,使用纯…
Read the full README ↗ · Preview checked 2026-10-28T10:42:56.615Z
Inside the original README — Document outline
- NInfer Fusion KVMem
- 这个项目做了什么
- 本次更新(2026-10-19):把 streaming 的思路接进 KVMem
- 另支持:Qwen4 预览架构(Qwen4Exp / qwen38flashnext)
- 从哪里开始
- 获取与启动
- 1. 准备引擎、依赖与模型
- 2. 启动一个文本服务
- 3. 发一条真实请求
- 4. 控制思考(reasoning)通道(可选)
- 旧参数 → 新参数对照(从 KVMem 分支迁移必读)
- 怎么确认 KVMem 与复用在工作
Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.
Links from the README
References supplied by the publisher, not independently verified endorsements. Check the destination before downloading files or entering credentials.
Documentation belongs to its respective authors. Reported project/model license: Apache-2.0. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.
What this repository does
The source does not provide a repository description. Read the project README before evaluating it.
Repository facts
- Owner
- 1314521gjy
- Primary language
- C++
- Stars
- 281
- Forks
- 23
- Open issues + pull requests
- 3
- License
- Apache-2.0
- Archived
- No
- Default branch
- main
- Created
- 2026-10-04T12:04:52.000Z
- Last push
- 2026-10-10T09:21:30.000Z
Topics and intended use
No topics were included in the latest source metadata.
Review the README for scope, installation, examples and limitations. We do not run repository code or certify it.
Evaluate before installing
Review licensing and dependencies, inspect recent commits and unresolved issues, and test in an isolated environment before production use. Stars and forks alone cannot answer these questions.
Source and freshness
Source: GitHub. Metadata observed 2026-10-11T12:07:14.119Z. Daily imports are snapshots, not real-time monitoring.
Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.