[PR #442] [CLOSED] DeepSeek-V4.1: 512K and 1M contexts in setup and the dashboard #526

Closed
opened 2026-10-29 21:26:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/442
Author: @needmorevram
Created: 10/24/2026
Status: ❌ Closed

Base: main ← Head: ds4-1m-context


📝 Commits (1)

  • abc24fd DeepSeek-V4.1: 512K and 1M contexts in setup and the dashboard (the model's native reach)

📊 Changes

6 files changed (+81 additions, -7 deletions)

View changed files

📝 docs/SETUP.md (+3 -2)
📝 maya.py (+10 -2)
📝 serve/server.py (+25 -1)
📝 serve/test_dashboard.py (+25 -1)
📝 serve/web/app.js (+2 -1)
📝 tools/test_setup_ds4.py (+16 -0)

📄 Description

DeepSeek-V4.1-Flash-1017 reads 1,048,576 positions natively (its config's max_position_embeddings). Setup and the dashboard stopped at 256K; this offers 512K and 1M too.

What changes

  • Setup (./maya.sh): DeepSeek's context choices are 32K-1M, shown as "512K" and "1M"; --context takes 524288 and 1048576.
  • Dashboard:
    • the Context size goes up to the pack's own limit (ds4.txt's max_position_embeddings; a pack without it works as before);
    • the "untested" warning starts past the largest context each engine has run end to end: 1M for maya-ds4, 256K for the GLM engine as before (/api/context gains tested).
  • docs/SETUP.md: the new contexts and what they cost. That's about 1.1 KB of VRAM a position on each GPU of a tensor-parallel group, taken from the expert cache. A prompt that long also reads slowly, since the indexer's work grows with the square of its length.

Nothing in the engine changes, and no RoPE scaling is added: the model's own settings already cover 1M.

Tested

Needle in a haystack through the server at --tp 8 (9 GPUs, LibertAIDAI's 3.5-bit quant, --max-context 1048576). The haystack is this repo's own files (no repeated filler), with three door codes hidden at 10%, 50% and 90% of it and one question for all three at the end; each prompt starts with its own header, so nothing is reused from a cache.

prompt read in codes found
118,084 tokens 2.3 min (859 tok/s) 3 of 3
497,760 tokens 10.4 min (802 tok/s) 3 of 3
1,028,310 tokens 23.8 min (720 tok/s) 3 of 3

The 1M run used v1.1.26's engine with --prefill-chunk 2048; the two shorter ones the engine as #344 merged it.

  • With a 1M context the KV cache moves experts out of VRAM: on this PC 154 GB of them went to RAM, against 147 GB at 256K, which left 10-14 GB of its 183 GB free.
  • A 1M prompt is also about 24 minutes of every GPU at full load. On this PC that needed the RTX 5060 Tis capped at 150 W: uncapped, those runs ended in a power-off, which the iDRAC logged as a fatal PCIe error on one GPU's port. That's this box's hardware, not the change, but it may be worth knowing for other full machines.
  • serve.test_dashboard and tools.test_setup_ds4 pass (82 tests), including new ones for the pack's limit, /api/context, 1M accepted and 2M refused, and setup's choices.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/442 **Author:** [@needmorevram](https://github.com/needmorevram) **Created:** 10/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `ds4-1m-context` --- ### 📝 Commits (1) - [`abc24fd`](https://github.com/mw00/project-maya/commit/abc24fd9090571bc01177592c83a840ef213ad1a) DeepSeek-V4.1: 512K and 1M contexts in setup and the dashboard (the model's native reach) ### 📊 Changes **6 files changed** (+81 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/SETUP.md` (+3 -2) 📝 `maya.py` (+10 -2) 📝 `serve/server.py` (+25 -1) 📝 `serve/test_dashboard.py` (+25 -1) 📝 `serve/web/app.js` (+2 -1) 📝 `tools/test_setup_ds4.py` (+16 -0) </details> ### 📄 Description DeepSeek-V4.1-Flash-1017 reads 1,048,576 positions natively (its config's `max_position_embeddings`). Setup and the dashboard stopped at 256K; this offers 512K and 1M too. ## What changes - **Setup (`./maya.sh`):** DeepSeek's context choices are 32K-1M, shown as "512K" and "1M"; `--context` takes 524288 and 1048576. - **Dashboard:** - the Context size goes up to the pack's own limit (`ds4.txt`'s `max_position_embeddings`; a pack without it works as before); - the "untested" warning starts past the largest context each engine has run end to end: 1M for maya-ds4, 256K for the GLM engine as before (`/api/context` gains `tested`). - **`docs/SETUP.md`:** the new contexts and what they cost. That's about 1.1 KB of VRAM a position on each GPU of a tensor-parallel group, taken from the expert cache. A prompt that long also reads slowly, since the indexer's work grows with the square of its length. Nothing in the engine changes, and no RoPE scaling is added: the model's own settings already cover 1M. ## Tested Needle in a haystack through the server at `--tp 8` (9 GPUs, LibertAIDAI's 3.5-bit quant, `--max-context 1048576`). The haystack is this repo's own files (no repeated filler), with three door codes hidden at 10%, 50% and 90% of it and one question for all three at the end; each prompt starts with its own header, so nothing is reused from a cache. | prompt | read in | codes found | |---|---|---| | 118,084 tokens | 2.3 min (859 tok/s) | 3 of 3 | | 497,760 tokens | 10.4 min (802 tok/s) | 3 of 3 | | 1,028,310 tokens | 23.8 min (720 tok/s) | 3 of 3 | The 1M run used v1.1.26's engine with `--prefill-chunk 2048`; the two shorter ones the engine as #344 merged it. - With a 1M context the KV cache moves experts out of VRAM: on this PC 154 GB of them went to RAM, against 147 GB at 256K, which left 10-14 GB of its 183 GB free. - A 1M prompt is also about 24 minutes of every GPU at full load. On this PC that needed the RTX 5060 Tis capped at 150 W: uncapped, those runs ended in a power-off, which the iDRAC logged as a fatal PCIe error on one GPU's port. That's this box's hardware, not the change, but it may be worth knowing for other full machines. - `serve.test_dashboard` and `tools.test_setup_ds4` pass (82 tests), including new ones for the pack's limit, `/api/context`, 1M accepted and 2M refused, and setup's choices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:26:24 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#526
No description provided.