recipe.toml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # DeepSeek-V4.1-Flash (552B MoE, MXFP4 experts, Engram-on-disk) — 4x DGX Spark.
  2. #
  3. # Image: dsv41-flash:local (docker-images/dsv41-flash/ — tonyd2wild overlay
  4. # chain as clone-at-pin build: vllm dsv41-feat@e47aa780 + sm121
  5. # _C_stable_libtorch + FlashInfer 0.7.0rc1 + 7 boot-10 patches baked in,
  6. # MIT provenance).
  7. #
  8. # Model: deepseek-ai/DeepSeek-V4.1-Flash (476 GB on the NFS HF cache,
  9. # refs/main). The two 203 GB FP8 Engram n-gram tables are NEVER loaded into
  10. # HBM — the baked engram.py patch keeps them on disk (DSV41_ENGRAM_DISK=1)
  11. # and reads rows on demand. Node-local sparse copies of each rank's rows
  12. # (48 GB, engram-local.json) accelerate decode once created (DSV41_ENGRAM_DIR
  13. # below, added after the copies exist — first boot reads straight from NFS).
  14. #
  15. # Config mirrors their boot-10 serving setup (launch/dsv41-tp4.sh) with
  16. # local deviations:
  17. # CUDA graphs FULL_AND_PIECEWISE + exact DSpark capture sizes (no padded
  18. # rows — padded speculative batches hang SM120 sparse MLA, FlashInfer
  19. # #5015), DSpark k=5 with the checkpoint's own draft layers, tools +
  20. # vision on.
  21. # * GMU 0.85 (their 0.80): the ~1M indexer prefill buffer (~5.2 GiB)
  22. # needs the extra budget; KV pool grows ~6 GiB over 300K.
  23. # * 1M ctx (their boot7-go proof: 1,078,380-token pool at gmu 0.80/eager;
  24. # at graphs + gmu 0.85 the pool has headroom). Note: their top-k fix
  25. # was validated at row widths up to 300K — the full 1M-wide decode is
  26. # unproven territory even for them; watch long prompts.
  27. # * thinking ON + reasoning_effort=max by default (request can override
  28. # via chat_template_kwargs), served as "deepseek-v4-flash" (gateway
  29. # alias, no config churn).
  30. engine = "vllm"
  31. name = "DeepSeek-V4.1-Flash MXFP4 (dsv41 img, 4x, DSpark k=5, Engram-on-disk)"
  32. docker_image = "dsv41-flash:local"
  33. docker_image_dir = "dsv41-flash"
  34. model = "deepseek-ai/DeepSeek-V4.1-Flash"
  35. required_nodes = 4
  36. tensor_parallel_size = 4
  37. pipeline_parallel_size = 1
  38. distributed_backend = "mp"
  39. shm_size = "32gb"
  40. # NO recipe entrypoint: the base image bakes ENTRYPOINT ["vllm","serve"]
  41. # (vllm/vllm-openai), so the launcher's CMD (model + flags) completes it.
  42. args = [
  43. # Stable gateway alias — clients/gateways keep the DeepSeek-V4-Flash
  44. # model name; no per-deployment config churn.
  45. "--served-model-name", "deepseek-v4-flash",
  46. "--trust-remote-code",
  47. "--distributed-executor-backend", "mp",
  48. "--gpu-memory-utilization", "0.85",
  49. "--max-model-len", "1048576",
  50. "--max-num-seqs", "8",
  51. "--max-num-batched-tokens", "8192",
  52. # boot-4 fix: the V4 indexer backend refuses the smallest-listed block
  53. "--block-size", "128",
  54. # boot-10: exact capture sizes for DSpark k=5, SEQS=8 (multiples of 5
  55. # and 6 up to 48 — every decode batch gets an exact FULL graph, no padding)
  56. "--compilation-config", """
  57. '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[5,6,10,12,15,18,20,24,25,30,35,36,40,42,48]}'""",
  58. "--speculative-config", """
  59. '{"method":"dspark","num_speculative_tokens":5,"draft_sample_method":"probabilistic","rejection_sample_method":"block","enable_adaptive_verification":false}'""",
  60. "--tool-call-parser", "deepseek_v41",
  61. "--enable-auto-tool-choice",
  62. "--reasoning-parser", "deepseek_v41",
  63. "--default-chat-template-kwargs", """
  64. '{"thinking": true, "reasoning_effort": "max"}'""",
  65. ]
  66. [env]
  67. HF_HUB_OFFLINE = "1"
  68. # Engram tables stay on disk (the baked engram.py patch); 32 parallel row
  69. # reads, 16 MB chunks (their launch defaults)
  70. DSV41_ENGRAM_DISK = "1"
  71. DSV41_ENGRAM_DISK_THREADS = "32"
  72. DSV41_ENGRAM_DISK_CHUNK = "16"
  73. # Node-local sparse Engram copy (per-rank row ranges from the first boot's
  74. # "Engram DISK mode" log lines; built with tools/engram_local.py, verified
  75. # byte-for-byte). NVMe instead of NFS for the 23.6 GiB/rank tables.
  76. DSV41_ENGRAM_LOCAL = "1"
  77. DSV41_ENGRAM_DIR = "/engram-local"
  78. # CUDA graphs: the Engram rows are staged in prepare_inputs (baked
  79. # model_state.py prestage patch) so the whole decode step is capturable
  80. VLLM_USE_BREAKABLE_CUDAGRAPH = "1"
  81. VLLM_HAS_FLASHINFER_CUBIN = "1"
  82. VLLM_USE_RUST_FRONTEND = "0"
  83. # runtime JIT wedge countermeasure (their boot-3 lesson): kernels are
  84. # prebuilt in the image, but any residual JIT must not OOM the box
  85. MAX_JOBS = "2"
  86. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  87. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  88. TORCH_CUDA_ARCH_LIST = "12.1a"
  89. FLASHINFER_CUDA_ARCH_LIST = "12.1a"
  90. OMP_NUM_THREADS = "2"
  91. # Per-node sparse Engram copy (model-00047/00048 shards + engram-local.json)
  92. [[extra_mounts]]
  93. host = "/var/tmp/engram-local/DeepSeek-V4.1-Flash"
  94. container = "/engram-local"
  95. read_only = true
  96. # JIT caches persist per-node (self-namespace by engine version key; the
  97. # image prebakes the flashinfer 0.7.0rc1 SM120 kernels, first boots re-JIT
  98. # the rest)
  99. [[extra_mounts]]
  100. host = "~/sm121-cache/jit-121f/flashinfer"
  101. container = "/root/.cache/flashinfer"
  102. [[extra_mounts]]
  103. host = "~/sm121-cache/jit-121f/torchinductor"
  104. container = "/root/.cache/torchinductor"
  105. [[extra_mounts]]
  106. host = "~/sm121-cache/jit-121f/vllm"
  107. container = "/root/.cache/vllm"