Skip to content

deepseek41 : activate scheduler-backed full graph - #7

Open
ajaxdude wants to merge 6 commits into
jeromecoste-microsoft-deepseek-v41-expert-executionfrom
jeromecoste-microsoft-deepseek-v41-full-graph
Open

ajaxdude wants to merge 6 commits into
jeromecoste-microsoft-deepseek-v41-expert-executionfrom
jeromecoste-microsoft-deepseek-v41-full-graph

Conversation

@ajaxdude

@ajaxdude ajaxdude commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Overview

Activates the complete scheduler-backed 40-layer DeepSeek V4.1 Flash graph on top of the accepted schema, attention, Engram, expert-store, and bounded expert-execution layers.

The model-specific memory context owns bounded raw 128-window state, source-owned ratio-2/ratio-1 compressed KV, index keys, compressor carry, layer-20 candidate propagation, sequence positions, and Engram history. State is prepared transactionally and committed only after successful graph execution, backend completion, runtime error consumption, and expert lease completion. Supported single-sequence semantics include reset, clear, full copy, keep, full removal, immediate last-ubatch rollback, and save/restore into empty destinations. Unsupported coupled/partial or older rollback operations fail explicitly before mutation.

The graph applies Engram before attention HC mixing at layers 1 and 14; implements ratio 0/1/2 raw and compressed attention with shared softmax, source maps, compressor publication, index/candidate selection, shared plus routed MoE execution, four-stream HC mixing, and the normal output norm/head; and preserves original expert IDs for routing/telemetry while using cache slot IDs only for expert GEMMs.

Depends on #6 and tracks halo-box#48.

Reconciliation

Final head: dd2fd630d03edf6e1bf42f82ed4f034fd89b5d26

Final tree: 99085493075106773be2e7724f07cf2c945a1fa8

dd2fd630d is a tree-identical provenance successor of merge commit 5e013725ea45486f95943a6ec12e1105171a1c41. The merge commit parents are frozen PR #7 head 4f1a4ebd74b58f1b22580b5c7f5ab976fdb99506 and exact accepted PR #6 head 83024f92db6b344b55f75103c43507788d853b0a. Excluded PR #6 candidates were not consumed.

Mandatory production fixes

  • The final visible candidate block is physically excluded from ordinary top-(k-1) ranking and concatenated exactly once. k=1 returns only the final block. Executable all-+inf tests cover short k=1/k=2 inputs and 16,392 visible rows with 2,048 selected blocks, proving unique in-range IDs and final block 2,048 exactly once.
  • Four-branch HC collapse remains BF16, then crosses an explicit F32 boundary before final RMSNorm. An executable CPU-supported graph continues through the output matrix and produces finite logits with expected value 32.0.

Model-free validation

  • ctest --test-dir build-dsv41 --output-on-failure -I 27,40: 14/14 passed, including DeepSeek41 schema, Engram, expert/store, memory, runtime, no-allocation graph construction, generated architecture fixtures, recurrent rollback variants, and save/load state.
  • ctest --test-dir build-dsv41 --output-on-failure -R '^test-state-restore-fragmented$': passed.
  • PYTHONPATH=gguf-py python3 -m unittest gguf-py/tests/test_deepseek41_schema.py: 4/4 passed.
  • CPU AddressSanitizer build with leak detection disabled because Apple ASan does not support it: 8/8 DeepSeek41/Engram/expert tests passed.
  • test-llama-archs -a deepseek41 -s 1: passed. The metadata-only path rejects malformed present tensor dimensions, registers the external expert/Engram descriptors without loading their data, and reserves complete batch-64 and batch-1 graphs. Reported CPU compute workspace: 85.78 MiB; graph nodes: 7,413 / 6,858; graph splits: 636 / 1.
  • test-llama-archs -a qwen4exp -s 1 and -a grovemoe -s 1: exited 0 with CPU, Accelerate, and Metal/device comparisons passing. Meta roundtrip remains the established test limitation (SKIP), not a DeepSeek regression.
  • git diff --check, conflict-marker checks, ASCII-only changed-file validation, exact ancestry checks, and accepted PR deepseek41 : add bounded routed expert execution #6-only file preservation passed.

Measurements and unverified gaps

No performance measurement or real-model correctness claim is made. No model or GGUF data was loaded. No Strix host, Vulkan/RADV, ROCm, corpus/logit equivalence run, or benchmark was used. The calibrated GGUF is unchanged. A guarded metadata-only or no-allocation real-GGUF probe is structurally possible, but it was not run. Automatic host-memory fitting and wave-prefill remain out of scope.

Requirements

  • I have read and agree with CONTRIBUTING.md.
  • This change is Strix Halo specific; general upstream-bound work belongs in halo-box/llama.cpp.
  • Agent-authored by GPT-5.6 Sol. The final head contains parseable Assisted-by, Copilot-Session, and Copilot Co-authored-by trailers.

Assisted-by: GPT-5.6 Sol

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-5.6 Sol

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-5.6 Sol

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-5.6 Sol

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ajaxdude
ajaxdude marked this pull request as ready for review September 14, 2026 07:27
Jerome Coste and others added 2 commits September 14, 2026 02:58
Assisted-by: GPT-5.6 Sol

Copilot-Session: 30a08176-cebe-482f-a2f6-eebfac0a3d34

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-5.6 Sol
Copilot-Session: 30a08176-cebe-482f-a2f6-eebfac0a3d34
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant