Upload pb27c/README.md
Browse files- pb27c/README.md +57 -0
pb27c/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: vllm
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- pseudobrain
|
| 7 |
+
- qwen3.5
|
| 8 |
+
- gated-deltanet
|
| 9 |
+
- long-context
|
| 10 |
+
- 1m-context
|
| 11 |
+
- constant-memory
|
| 12 |
+
- nvfp4
|
| 13 |
+
- vllm
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# PseudoBrain-27B (`pb27c` / `PB27ForConditionalGeneration`)
|
| 17 |
+
|
| 18 |
+
**GitHub Repository & vLLM Plugin:** [https://github.com/defnotean/pseudobrain](https://github.com/defnotean/pseudobrain)
|
| 19 |
+
**Hugging Face Weights:** [https://huggingface.co/defnotean1/PseudoBrain-27B-NVFP4](https://huggingface.co/defnotean1/PseudoBrain-27B-NVFP4)
|
| 20 |
+
**Architecture Paper:** [`docs/PSEUDOBRAIN_ARCHITECTURE_PAPER.md`](https://github.com/defnotean/pseudobrain/blob/main/docs/PSEUDOBRAIN_ARCHITECTURE_PAPER.md)
|
| 21 |
+
|
| 22 |
+
## Overview
|
| 23 |
+
|
| 24 |
+
**PseudoBrain-27B (`pb27c`)** is a constant-GPU-memory hybrid long-context conversion of the 27B dense Qwen3.5 architecture (`Huihui-Qwen3.8-27B-abliterated`). Every fourth layer (`16` full-attention layers `[3, 7, 11, ..., 63]`) is converted into a **Hybrid Windowed-Attention + Parallel Gated DeltaNet** block (`PB27DecoderLayer`) paired with PseudoBrain's **Three-Tier NVMe/Page-Cache Exact Memory Archive** (`pb27_vllm`).
|
| 25 |
+
|
| 26 |
+
- **$O(1)$ Constant GPU KV Cache from `8K` to `1,000,000+` Tokens:** Local sliding window $W = 16,384$ + $4$ StreamingLLM sinks in GPU HBM (`--kv-cache-memory-bytes 6G–8G`, total GPU footprint `~29–33 GiB` even at $1,000,000$ tokens).
|
| 27 |
+
- **Parallel Gated DeltaNet Recurrent Branches (`16` layers + `48` native GDN layers):** Carries dense global discourse state across the entire context.
|
| 28 |
+
- **Unrotated Two-Hop Exact Memory Retrieval:** Evicted post-RoPE keys/values are archived in $64$-token blocks in sparse unlinked `mmap` files (`PB27_MEMORY_OFFLOAD=nvme`, `PB27_MEMORY_NVME_DTYPE=bf16`) with GPU-resident Quest min/max bounds, per-query Z-score + query-centered bound scoring, `[b, b+1]` successor expansion, and position-invariant 2-hop key-to-key bridge retrieval over the $75\%$ unrotated key subspace (`d // 4 :`), merged with the sliding window via FlashAttention-2 exact LSE rescaling.
|
| 29 |
+
|
| 30 |
+
## Benchmark Summary
|
| 31 |
+
|
| 32 |
+
| Benchmark / Metric | Result |
|
| 33 |
+
| :--- | :---: |
|
| 34 |
+
| **Medium Coding Benchmark (`custom_code_bench.py`, 33 problems × 2)** | **`90.91%` (`60 / 66`)** |
|
| 35 |
+
| **Single-Needle Exact Recall (`8K, 32K, 65K, 120K, 200K, 250K, 500K, 1M`)** | **`100.0%` (`24 / 24` across all depths `0.1, 0.5, 0.9`)** |
|
| 36 |
+
| **Multi-Needle 4-Constant JSON Recall (`8K–250K`)** | **`100.0%` (`4 / 4` at every length)** |
|
| 37 |
+
| **GPU KV Pool Usage at `1,000,000` Tokens** | **`8.1%` of `6 GiB` pool (`~33 GiB` total GPU memory)** |
|
| 38 |
+
| **Standing Decode Throughput (`8K` context, batch 1)** | **`13.07 tok/s`** |
|
| 39 |
+
|
| 40 |
+
## Quickstart with vLLM
|
| 41 |
+
|
| 42 |
+
1. Clone the PseudoBrain repository and install the `pb27_vllm` out-of-tree vLLM plugin:
|
| 43 |
+
```bash
|
| 44 |
+
git clone https://github.com/defnotean/pseudobrain.git
|
| 45 |
+
cd pseudobrain
|
| 46 |
+
pip install -e serving/pb27_vllm
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
2. Launch the constant-memory vLLM server:
|
| 50 |
+
```bash
|
| 51 |
+
bash serving/pb27_vllm/serve.sh defnotean1/PseudoBrain-27B-NVFP4 8000
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
3. For $1,000,000$-token extended context serving (`6 GiB` KV pool + NVMe BF16 exact memory tier):
|
| 55 |
+
```bash
|
| 56 |
+
bash scripts/bench/custom_longctx_extended.sh pb27c_ext /path/to/pb27c_nvfp4
|
| 57 |
+
```
|