DeepSeek-V4.1-Flash Engram table, NInfer v3 artifact

The Engram table of DeepSeek-V4.1-Flash-1017, as a NInfer v3 artifact for NInfer-all, the master branch of iamwavecut/ninfer-all. Every NInfer conversion of DeepSeek-V4.1-Flash-1017 published without its table reads its rows from this file:

model artifact
DeepSeek-V4.1-Flash-1017 GSQ-RCO IQ1_M WaveCut/DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ1_M-NInfer-v3
DeepSeek-V4.1-Flash-1017 GSQ-RCO Coder IQ2_XXS WaveCut/DeepSeek-V4.1-Flash-1017-GSQ-RCO-Coder-IQ2_XXS-NInfer-v3

Stock NInfer builds cannot read it: the model family and the gguf_* formats exist only in that line; build master from commit 42376e907 on.

What is inside

The two Engram blocks of the model (blocks 1 and 14) each add rows of their own table: the 2-, 3- and 4-grams ending at a position, hashed per head, address 24 rows a token in each block. This file holds both tables as one, the first block's 384,006,168 rows and then the second's 384,016,682: 768,022,850 rows of 256 values (196.6B parameters). The rows are ISTA-DASLab's IQ4_NL blocks (DeepSeek-V4.1-Flash-Engram-IQ4_NL.gguf, 144 bytes a row), copied byte for byte; the file is the same for every GSQ-RCO build of the model.

One file, DeepSeek-V4.1-Flash-Engram-IQ4_NL-ninfer-v3.ninfer, of 110,940,717,396 bytes (103.32 GiB), next to its conversion report, SHA256SUMS, NOTICE and LICENSE: the rows (103.00 GiB) and a hot-row profile of 345 MB for --ngram-residency ram-hot (below). Its engram component records the blocks, their row counts, the format and the SHA-256 of the rows, 36ee7d378c25f61acf794b78a404eb4946b5233531f37f1024033bbd5f6b41a5. A model names the table it needs by that digest, and NInfer refuses a table that differs. Conversion command (master from commit c0321db02 on for the profile; ninfer-ngram-profile counts it, as below; the converter checks it against the Engram hash of the model's split GGUF, --source gguf):

hf download deepseek-ai/DeepSeek-V4.1-Flash-1017 config.json tokenizer.json tokenizer_config.json \
  --local-dir models/deepseek-v4.1/hf
hf download ISTA-DASLab/DeepSeek-V4.1-Flash-1017-GSQ-RCO-GGUF \
  --revision 65d53bc8be65123e255ff02f3ded958b6dbf54fd \
  --include 'DeepSeek-V4.1-Flash-Engram-IQ4_NL.gguf' \
  --include 'DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ1_M-*.gguf' --local-dir models/deepseek-v4.1
python -m tools.convert --model models/deepseek-v4.1/hf --recipe deepseek_v41_gguf --components engram \
  --source engram=models/deepseek-v4.1/DeepSeek-V4.1-Flash-Engram-IQ4_NL.gguf \
  --source gguf=models/deepseek-v4.1/DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ1_M-00001-of-00006.gguf \
  --resource engram.hot=models/deepseek-v4.1/engram-broad-v1.hot \
  --name DeepSeek-V4.1-Flash-Engram-IQ4_NL \
  --out models/DeepSeek-V4.1-Flash-Engram-IQ4_NL-ninfer-v3.ninfer --device cpu

This file was converted from the Engram GGUF ISTA-DASLab published before October 27, a tensor per block, in 3 min 29 s on 24 cores of a Threadripper 3960X. The current file, in llama.cpp's layout, stores the same rows as one tensor; on November 4 its conversion wrote this file byte for byte, only the random id differing. ISTA-DASLab's Coder repository carries the same Engram GGUF. The profile was added on November 13 to the file converted then: its rows are the same bytes and their SHA-256 is unchanged, so models that name the table keep reading it.

Running

Download it next to a model and pass it with --ngram-table:

hf download WaveCut/DeepSeek-V4.1-Flash-Engram-IQ4_NL-NInfer-v3 \
  DeepSeek-V4.1-Flash-Engram-IQ4_NL-ninfer-v3.ninfer --local-dir models
hf download WaveCut/DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ1_M-NInfer-v3 \
  DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ1_M-ninfer-v3.ninfer --local-dir models
ninfer-serve models/DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ1_M-ninfer-v3.ninfer \
  --ngram-table models/DeepSeek-V4.1-Flash-Engram-IQ4_NL-ninfer-v3.ninfer \
  --model-id deepseek-v4.1-flash --expert-residency host --max-context 32768

With the default disk residency nothing reads the whole table at load: before each pass the engine reads the rows the pass addresses (48 a token, 6.9 KB) from the file through the OS page cache, with positioned reads on several threads, and copies them to the GPU, so the table can sit on any SSD. --ngram-residency ram loads all of it into RAM instead (103 GiB; with the model's experts in pinned host memory as well, about 210 GiB).

Rows in RAM

--ngram-residency ram-hot keeps the rows the file's hot-row profile ranks first in RAM, as many as --ngram-ram-mib holds (4,096 MiB by default), and reads the rest from the file as the default does (master from commit c0321db02 on):

ninfer-serve models/DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ1_M-ninfer-v3.ninfer \
  --ngram-table models/DeepSeek-V4.1-Flash-Engram-IQ4_NL-ninfer-v3.ninfer \
  --ngram-residency ram-hot --ngram-ram-mib 4096 \
  --model-id deepseek-v4.1-flash --expert-residency host --max-context 32768

A row depends on its token and the three before it and nothing else, so the profile was counted from text alone: 86,355,715 rows ranked by reads over 3,734,454 tokens (5,831 documents sampled from four Common Corpus shards, prose, web, press and science, and one github-code-clean shard). On 1,116,980 held-out tokens of the same sources (53,615,040 row reads, 47.6% of them of rows the profile lists) the leading rows serve this share of reads per RAM budget:

RAM budget, MiB 256 512 1,024 2,048 4,096 8,192 16,384 and more
Held-out row hits 18.4% 23.4% 28.1% 32.8% 37.7% 43.1% 47.6%

Hits measure row reuse, not speed or quality: the rows are the same either way. On an RTX 3090 the IQ1_M model with disk experts scored 3,547 tokens of WikiText to the same total NLL, bit for bit, with disk and with ram-hot (perplexity 2.09739). At startup ram-hot reads nearly the whole file at 4,096 MiB: there the engine was ready after 2 min 26 s, against 8.3 s with disk. --ngram-hot-profile PATH replaces the profile with a file of your own corpus (ninfer-ngram-profile, the n-gram rows).

A model started without its table is refused. --no-ngram-table overrides that, and the model then runs without its Engram blocks: a non-standard, experimental mode, warned about at startup. The model was trained with the table: without it the perplexity of a 1,112-token WikiText slice rose from 3.07 to 9.68 (measured on October 25).

Credits and license

The table comes from ISTA-DASLab's DeepSeek-V4.1-Flash-1017 GSQ-RCO GGUFs, which quantize deepseek-ai/DeepSeek-V4.1-Flash-1017, all under the MIT License, reproduced in LICENSE. Attribution notices are collected in NOTICE. This repository only re-packs those rows into NInfer's container.

Downloads last month
2,151
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for WaveCut/DeepSeek-V4.1-Flash-Engram-IQ4_NL-NInfer-v3