recipe.toml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # DeepSeek-V4.1-Flash-1017 on 4x DGX Spark with Aiden's SGLang production-1.7.1
  2. # (aidenle.com/recipes/deepseek-v4-1-flash-sglang-4x-dgx-spark).
  3. #
  4. # DROP-IN of the 2026-10-17 re-cut `deepseek-ai/DeepSeek-V4.1-Flash-1017`
  5. # (same arch DeepseekV41ForCausalLM, fp8, 48 shards) over the old
  6. # `deepseek-ai/DeepSeek-V4.1-Flash` — same serving contract as
  7. # dsv41-flash-4x-sglang-aiden16, only the model repo (+ staging src) changes.
  8. #
  9. # Image: aidendle94/sparkrun-sglang-dsv41-gb10:production-1.7.1 (Docker Hub,
  10. # 2026-09-29 — Aiden's latest DSV4.1 SGLang production image) = lmsysorg
  11. # SGLang DSV4.1 + Aiden's MIT overlay (Engram row store inside the CUDA graph,
  12. # b12x SM12x FP8 dense kernels, SM120 prefill paging, RDMA collectives).
  13. #
  14. # Model: deepseek-ai/DeepSeek-V4.1-Flash-1017 (~476 GB, fp8) on the NAS HF
  15. # cache (weights mmap-loaded from the snapshot). The Engram rows are staged
  16. # node-locally by [[staging]] below and mounted at /engram-local —
  17. # SPARK_ENGRAM_DIR points there. NOTE: the staging dst is a NEW dir
  18. # (/home/kilork/engram-1017) — the old aiden-engram copies are packed from the
  19. # OLD snapshot's tables and must not be reused. First serve packs ~95 GiB/node
  20. # from the NAS; later serves verify sampled row hashes against the ledger.
  21. # Unknown risk: the 1.7.1 overlay predates 1017 — if the re-cut changed the
  22. # Engram table layout, staging/serve will say so (row ranges derive from the
  23. # checkpoint's safetensors headers, nothing is hardcoded).
  24. engine = "sglang"
  25. name = "DeepSeek-V4.1-Flash-1017 (SGLang 4x, Aiden production-1.7.1)"
  26. docker_image = "dsv41-sglang-1017:local"
  27. docker_image_dir = "dsv41-sglang-1017"
  28. model = "deepseek-ai/DeepSeek-V4.1-Flash-1017"
  29. parent_model = "deepseek-ai/DeepSeek-V4.1-Flash"
  30. port = 30000
  31. required_nodes = 4
  32. tensor_parallel_size = 4
  33. distributed_backend = "mp"
  34. shm_size = "32gb"
  35. # The wrapper (mounted read-only from the host via extra_mounts below) sets
  36. # SPARK_ENGRAM_ROWS (+ B12X_ROCE_GID_INDEX) from NODE_RANK and execs the
  37. # engine with the launcher's full flag list in "$@".
  38. entrypoint = ["sh", "/aiden4x-launch.sh"]
  39. args = [
  40. "--trust-remote-code",
  41. "--served-model-name", "deepseek-v4.1-flash",
  42. "--load-format", "safetensors",
  43. # Aiden's measured shape (production-1.6, carried into 1.7.1); --tp 4 /
  44. # --nnodes 4 / --node-rank / --dist-init-addr are appended by the launcher
  45. "--ep-size", "4",
  46. "--attention-backend", "dsv4",
  47. "--moe-runner-backend", "flashinfer_mxfp4",
  48. # required for the MXFP8 route (selects the block-scaled path the hook wraps;
  49. # K=576 projections fall back to CUTLASS per shape)
  50. "--fp8-gemm-backend", "flashinfer_cutlass",
  51. "--mem-fraction-static", "0.80",
  52. "--chunked-prefill-size", "2048",
  53. "--context-length", "524288",
  54. "--max-running-requests", "16",
  55. "--cuda-graph-max-bs-decode", "16",
  56. "--random-seed", "0",
  57. "--enable-decoder-swa-bounded-replay",
  58. "--speculative-algorithm", "DSPARK",
  59. "--speculative-dspark-block-size", "5",
  60. "--tool-call-parser", "deepseekv41",
  61. "--reasoning-parser", "deepseek-v41",
  62. "--watchdog-timeout", "1800",
  63. "--min-free-slots-delay", "1",
  64. ]
  65. # The launcher also appends: --model-path <resolved NAS snapshot>, --nnodes 4,
  66. # --node-rank N, --dist-init-addr <head-ib>:25000, --host 0.0.0.0, --port 30000.
  67. # NOTE: no --default-chat-template-kwargs '{"thinking":true}' — the bench
  68. # harness controls thinking; Aiden's default is for his interactive fleet.
  69. # The per-rank Engram range wrapper, mounted read-only (copied from the
  70. # dsv41-flash-4x-sglang-aiden16 recipe dir; placed at this host path on the
  71. # launch nodes).
  72. [[extra_mounts]]
  73. host = "/home/kilork/aiden4x-launch.sh"
  74. container = "/aiden4x-launch.sh"
  75. read_only = true
  76. # Node-local sparse copy of the Engram tables (staging P2.5, sparse-copy —
  77. # the aiden overlay's engram-local.json contract). Built/verified per serve by
  78. # the [[staging]] block; the wrapper-computed SPARK_ENGRAM_ROWS and the
  79. # manifest agree because sparse_rows.py tiles ranks with the wrapper's
  80. # base+rem formula (the overlay refuses to start unless both are identical).
  81. [[extra_mounts]]
  82. host = "/home/kilork/engram-1017"
  83. container = "/engram-local"
  84. read_only = true
  85. # Staging: sparse-copy packs the aiden contract (engram-local.json manifest +
  86. # sparse shard copies at the original safetensors byte offsets) from the 1017
  87. # snapshot. Ranges use the wrapper's base+rem tiling; first serve packs
  88. # ~95 GiB/node from the NAS, later serves verify sampled row hashes against
  89. # the ledger stored inside the dst tree.
  90. [[staging]]
  91. kind = "sparse-rows"
  92. format = "sparse-copy"
  93. id = "engram"
  94. src = "{{hf}}/hub/models--deepseek-ai--DeepSeek-V4.1-Flash-1017/snapshots/1bae0e1088993b9b82de08f59de5be5a34e42170"
  95. dst = "/home/kilork/engram-1017"
  96. min_free = "55G"
  97. [env]
  98. # Engram row source: the node-local sparse copy staged by [[staging]] above
  99. # (Aiden's measured production config — ~47 GiB of rows on node NVMe). The
  100. # manifest (engram-local.json) carries the per-layer rank ranges;
  101. # SPARK_ENGRAM_ROWS from the wrapper is the cross-check.
  102. SPARK_ENGRAM_DIR = "/engram-local"
  103. SPARK_ENGRAM_MODE = "hostnode"
  104. SPARK_ENGRAM_EARLY = "1"
  105. SPARK_ENGRAM_PREFETCH = "1"
  106. SPARK_PAGE_CACHE_RELEASE = "1"
  107. SPARK_LATE_TAIL_SKIP = "1"
  108. SPARK_LATE_TAIL_SKIP_ALL = "1"
  109. SPARK_SM120_REAL_HEADS = "1"
  110. SPARK_ENGRAM_THREADS = "64"
  111. SPARK_ENGRAM_MAX_IDS = "65536"
  112. SPARK_MXFP8_BACKEND = "b12x"
  113. SPARK_ROCE_AR = "1"
  114. SPARK_ROCE_AR_MAX = "1MB"
  115. SPARK_ROCE_AG_MAX = "16MB"
  116. # b12x RoCE runtime (GID index set by the wrapper from the detected value)
  117. B12X_ROCE_HCA = "rocep1s0f0,roceP2p1s0f0"
  118. B12X_ROCE_SPIN_LIMIT = "300000000"
  119. # image defaults Aiden overrides
  120. SGLANG_ENABLE_DSV41_ENGRAM_HOST_TABLE = "0"
  121. SGLANG_FLASHINFER_MOE_FUSED_FINALIZE = "0"
  122. SGLANG_DSV41_REASONING_EFFORT = "100"
  123. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:False"
  124. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  125. # Aiden's NCCL pins (4x 200G RoCE fabric, 192.168.200.0/24) — [env] wins over
  126. # the config's [nccl."4nodes-switch"] where they differ
  127. NCCL_NET = "IB"
  128. NCCL_IB_DISABLE = "0"
  129. NCCL_IB_HCA = "rocep1s0f0,roceP2p1s0f0"
  130. NCCL_SOCKET_IFNAME = "enp1s0f0np0"
  131. GLOO_SOCKET_IFNAME = "enp1s0f0np0"
  132. NCCL_IB_ROCE_VERSION_NUM = "2"
  133. NCCL_IB_ADDR_FAMILY = "AF_INET"
  134. NCCL_IB_ADDR_RANGE = "192.168.200.0/24"
  135. NCCL_IB_SUBNET_PREFIX_LEN = "24"
  136. NCCL_CROSS_NIC = "1"
  137. NCCL_IB_MERGE_NICS = "0"
  138. NCCL_IB_SUBNET_AWARE_ROUTING = "1"
  139. NCCL_CUMEM_ENABLE = "0"
  140. NCCL_P2P_DISABLE = "1"
  141. NCCL_SHM_DISABLE = "1"
  142. NCCL_BUFFSIZE = "1048576"
  143. NCCL_LL128_BUFFSIZE = "262144"
  144. NCCL_PROTO = "^LL128"
  145. NCCL_MAX_NCHANNELS = "8"