[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111801":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":30,"discoverSource":31},111801,"DeepSeek-V4.1-Flash-1017-BLACKFOLD-TP2","Blackwellboy\u002FDeepSeek-V4.1-Flash-1017-BLACKFOLD-TP2","Blackwellboy","Uncensored DeepSeek-V4.1-Flash-1017 on 2x DGX Spark: refusals 94 to 6, same answers as DeepSeek's API, 2,008 tok\u002Fs prefill at 128K, 113 tok\u002Fs code decode. TensorFold native, 3 engine patches, 2 RoCE rails.","https:\u002F\u002Fhuggingface.co\u002FBlackwellBoy\u002FDeepSeek-V4.1-Flash-1017-BLACKFOLD-EXL3-2.9bpw-TP2",null,"Python",65,6,57,1,0,2,7,3,46.24,"Apache License 2.0",false,"main",true,[],"2026-11-21 18:39:56","2026-11-23 16:37:10","![BLACKFOLD](assets\u002Fbanner.jpg)\n\n# BLACKFOLD: DeepSeek-V4.1-Flash-1017 TP2 recipe\n\n**Uncensored, fast, and checked.** DeepSeek-V4.1-Flash-1017 (763B MoE) on two DGX Sparks: JailbreakBench\nrefusals cut from 94 to 6, the same answers as DeepSeek's own API, 2,008 tok\u002Fs cold prefill on a 128K prompt and\n113 tok\u002Fs single-stream code decode.\n\nThose speeds are best cases: greedy, thinking off, short prompts, one request. Prose decodes at about 57-65 tok\u002Fs,\nand a thinking agent at 150-190K context saw about 57 tok\u002Fs. **[Real-world speed](docs\u002FREAL_WORLD_SPEED.md)** shows\nwhat to expect for your use, and what it takes to get these numbers on your own pair.\n\nThis is the TP2 recipe: how to run BLACKFOLD on two GB10 nodes with TensorFold's native engine, the three engine\npatches that make it fast, the two-rail network setup, and every measurement. The weights live on Hugging Face:\n\n**Model:** [BlackwellBoy\u002FDeepSeek-V4.1-Flash-1017-BLACKFOLD-EXL3-2.9bpw-TP2](https:\u002F\u002Fhuggingface.co\u002FBlackwellBoy\u002FDeepSeek-V4.1-Flash-1017-BLACKFOLD-EXL3-2.9bpw-TP2) (gated, responsible-use terms)\n\n![What BLACKFOLD changes](assets\u002Fhow-it-works.png)\n\n## Quick start\n\n**You need:** two DGX Spark (or other GB10, 128 GB) nodes on a 200 GbE link or switch, Docker with the NVIDIA\nruntime, `nvcr.io\u002Fnvidia\u002Fpytorch:26.07-py3`, passwordless SSH from the first node (head) to the second (worker),\nand about 520 GB free on each node.\n\n**1. Weights (both nodes).** Request access on the model page, then:\n```bash\nhf download BlackwellBoy\u002FDeepSeek-V4.1-Flash-1017-BLACKFOLD-EXL3-2.9bpw-TP2 --local-dir blackfold-hf\ncd blackfold-hf && .\u002Fsetup.sh \u002Fmodels     # downloads LibertAI's pack + Engram, applies and verifies the patch\n```\nRun it on one node and copy `\u002Fmodels` to the other over the fabric, or run it on both.\n\n**2. Base TP2 setup.** Follow [lucataco's two-Spark recipe](https:\u002F\u002Fgithub.com\u002Flucataco\u002FDeepSeek-V4.1-Flash-2x-DGX-Spark)\nwith `\u002Fmodels\u002Fexl3-2.9bpw-heretic` as the model and `\u002Fmodels\u002Fengram-src` as the Engram folder. Its first start\nwrites the per-rank weight caches (`tf-ds-rank`) and `dsv41_token_map.json`, which the native engine reads. Check\nit answers, then stop it (`scripts\u002Fstart.sh stop`). Get the kernel kit v0.6.1 from\n[bertholomus's TP2 recipe](https:\u002F\u002Fgithub.com\u002Fbertholomus\u002Fdeepseek-v4.1-tensorfold-tp2-2xgb10) and generate the\nRoPE tables and the 1017 image-routing bias with its tools, as\n[tonyd2wild's TP2 lane](https:\u002F\u002Fgithub.com\u002Ftonyd2wild\u002FDeepSeek-V4.1-Flash-vLLM-DGX-Spark\u002Ftree\u002Fmain\u002Fruns\u002F2026-10-18-1017-tensorfold-tp2) documents (step 4).\n\n**3. Build the engine (one node, no GPU needed, then copy `zig-out\u002F` to the other).**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fbertholomus\u002FTensorFold && cd TensorFold\ngit checkout 6366d2c585b4f05fe33bfe5cbdb33ea15264841a   # includes upstream #25 (DSML tool-call fix)\ngit apply ..\u002FDeepSeek-V4.1-Flash-1017-BLACKFOLD-TP2\u002Fpatches\u002F000*.patch\n# inside nvcr.io\u002Fnvidia\u002Fpytorch:26.07-py3 with Zig 0.17.0 on PATH:\nzig build test        # 227\u002F227\nzig build install native -Dtarget=aarch64-linux-gnu.2.28 -Doptimize=ReleaseFast \\\n  -Dnvcc=\u002Fusr\u002Flocal\u002Fcuda\u002Fbin\u002Fnvcc -Dsm=121\n```\n\n**4. Chat template.** The native renderer needs one expression rewritten:\n```bash\nsed 's\u002Fdict(schema.d, \\*\\*{k: v})\u002Fdict((schema.d.items() | list) + [[k, v]])\u002F' \\\n  chat_template.jinja > chat_template.native.jinja\n```\n\n**5. Second rail (optional, about 9% faster cold prefill).** See [docs\u002FRAILS.md](docs\u002FRAILS.md).\n\n**6. Start.** Copy `deploy\u002Fblackfold.env.example` to `deploy\u002Fblackfold.env`, fill in addresses and paths, then:\n```bash\ndeploy\u002Fblackfold-native start      # also: stop, status\ncurl http:\u002F\u002F\u003Chead>:18191\u002Fv1\u002Fmodels\n```\nOpenAI-compatible API on port 18191: 1M context, 4 parallel streams, vision, tool calls, thinking on by default\n(send `chat_template_kwargs: {\"enable_thinking\": false}` to turn it off per request).\n\n**Before you use it:**\n- Set `max_tokens` on requests. Thinking counts against it; the deploy default is now 32,768.\n- Keep one thinking setting per conversation, so the prompt cache can reuse earlier turns.\n- Leave `top_k` unset or send 1-50: on this engine pin, `top_k` 0 or -1 fails the decode round for every request\n  running at that moment.\n- Set `API_KEY_FILE` in `blackfold.env` if the port is reachable from other machines.\n\nDetails: [Real-world speed](docs\u002FREAL_WORLD_SPEED.md).\n\n## Results\n\nI built on lucataco's and tonyd2wild's TP2 work, so I benchmarked BLACKFOLD with their **own** tools and put it\nnext to the numbers each of them published for their stock (censored) builds. Raw files and conditions:\n[results\u002F](results\u002FRESULTS.md).\n\n![lucataco's kit_bench](assets\u002Flucataco-kit-bench.png)\n\n![tonyd2wild's v41bench_tf](assets\u002Ftonyd2wild-v41bench.png)\n\n![Quality](assets\u002Fquality.png)\n\n![Refusals](assets\u002Frefusals.png)\n\n## Getting these numbers on your pair\n\n1. Both RoCE rails, MTU 9000, GID aligned ([docs\u002FRAILS.md](docs\u002FRAILS.md)).\n2. Matched, unthrottled GPUs. Run `tools\u002Fbf_preflight.sh` on both nodes and compare them; the slower node sets the pace.\n3. Nothing else running on either node.\n4. One warm-up request at your working context size: the first long reply after a start is slow while the engine\n   prepares its graphs.\n5. Measure with `tools\u002Fbf_lab.py` in both regimes, greedy with thinking off and sampled with thinking on\n   ([tools\u002FREADME.md](tools\u002FREADME.md)). Two runs of the same build match token for token in either.\n\n**Short on disk?** Each node only reads half of the 189 GB Engram tables.\n[docs\u002FENGRAM_DISK.md](docs\u002FENGRAM_DISK.md) gives ~95 GB back per node, in place, with a start-up check that stops a\nnode from serving the wrong rank.\n\n## Issues I hit along the way, and the fixes\n\nThe TP2 builds I learned from pin TensorFold commits from before some upstream fixes, so I left a note on each repo.\n\n- **lucataco's pin (`8e0966e`)** predates the DSML tool-call fix (#20), so tool-call markup could end up in replies,\n  and the RDMA gather's proxy thread spins a core while idle (fixed in #27).\n- **tonyd2wild's pin (`3ff3b2a`)** predates the kept-prompt fixes: coming back to a conversation after another one\n  with the same system prompt reused 0 cached tokens. On `629c524` (#26) it reuses 98,304. The final save in\n  `v41bench_tf.py` also fails if the `--out` folder does not exist yet.\n- **TensorFold native at `629c524`** leaked raw DSML when the model called a tool the request did not offer.\n  Upstream fixed it in #25, and this recipe pins `6366d2c`, which includes it.\n- **Native ran about 3% more verification rounds** than the Python engine for the same answer. Patches `0002` and\n  `0003` fix it (below).\n- **Tool-only streamed replies** sent a couple of newlines before the call, which strict clients read as content.\n  Patch `0001` fixes it.\n\n## What we built\n\n1. **Engine patches** ([patches\u002F](patches\u002FREADME.md)) on bertholomus\u002FTensorFold `6366d2c` (they also apply to `629c524`):\n   - `0001` holds back leading whitespace in streamed replies until it is clear whether a tool call follows\n     (tool-call checks 4\u002F8 to 8\u002F8).\n   - `0002` lets a backend use a fixed per-round draft allowance for a lone stream; DeepSeek uses its 3.5 ms,\n     matching the Python engine.\n   - `0003` lets a backend turn off suffix-lookup copy windows; DeepSeek does while its draft head is loaded,\n     as the Python engine never proposes copies.\n   Both settings are opt-in; other backends keep upstream behaviour.\n2. **The finding behind them:** native ran 309 to 311 verification rounds where the Python engine ran 300 for the\n   same answer. With 0002 and 0003 it runs exactly 300, and its faster rounds then win.\n   [docs\u002FCOPY_WINDOWS.md](docs\u002FCOPY_WINDOWS.md)\n3. **Two rails** with GID alignment that survives reboots and NetworkManager. [docs\u002FRAILS.md](docs\u002FRAILS.md)\n4. **Tool calls checked to 250K context:** 32\u002F32 clean (thinking on and off, streamed and not, multi-turn), and\n   24\u002F24 DSML edge cases, including a call to a tool the request did not offer, which `629c524` leaked as raw\n   markup and upstream fixed in #25. [results\u002F](results\u002FRESULTS.md)\n5. **Deploy scripts** ([deploy\u002F](deploy\u002FREADME.md)) and every measurement in [results\u002F](results\u002FRESULTS.md):\n   controlled A\u002FB trials (all outputs identical by token), qualification, same-tool benchmarks and quality.\n6. **Measurement tools** ([tools\u002F](tools\u002FREADME.md)): `bf_lab.py` records and compares a serve by full token IDs and\n   engine counters, and `bf_preflight.sh` reports a node's clocks, memory and rails.\n\n| 125K-context cell (same pair) | Python engine | Native + patches, 1 rail | Native + patches, 2 rails |\n|---|---:|---:|---:|\n| Cold prefill, code prompt | 93.8 s | 67.9 s | **62.0 s** |\n| Solo code decode, tok\u002Fs | 89.6 | 91.5 | **92.8** |\n| Solo prose decode, tok\u002Fs | 55.2 | 56.2 | **57.1** |\n| 2-stream code, per stream | 63.6 | 68.1 | **69.8** |\n\n## Credits and licence\n\nBLACKFOLD stands on DeepSeek-AI, LibertAIDAI, turboderp, p-e-w, pqhaz, ashhart, bertholomus and the TensorFold\ncontributors, lucataco, tonyd2wild and MiaAI-Lab: details in [CREDITS.md](CREDITS.md). Our scripts, patches and\ndocuments are Apache-2.0 ([LICENSE](LICENSE), [NOTICE](NOTICE)); the patches modify TensorFold (Apache-2.0), whose\nLICENSE and NOTICE are in [patches\u002F](patches\u002F). The weights are MIT and are distributed only through the gated\nHugging Face repository.\n","BLACKFOLD 是一个针对 DeepSeek-V4.1-Flash-1017（763B MoE）大模型的高性能分布式推理优化方案，专为双节点 DGX Spark（GB10）集群设计。它基于 TensorFold 原生推理引擎，集成 3 个关键引擎补丁与双 RoCE 网络通道，显著降低内容拒绝率（JailbreakBench 从 94 降至 6），保持与官方 API 一致输出，并实现 2008 tok\u002Fs 的冷启动预填充（128K 上下文）和 113 tok\u002Fs 的代码生成解码速度。适用于需要高吞吐、低延迟、长上下文支持且需合规可控的大模型服务部署场景，如企业级 AI 推理平台、私有化代码助手或研究型大模型实验基础设施。","2026-11-24 04:41:49","CREATED_QUERY"]