recipe.toml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # DeepSeek-V4-Flash-0731 DSpark — 2× GB10 / DGX Spark, TP=2 over RoCE.
  2. #
  3. # Variant targeting aidendle94's production-3.8 image ("dsv4/apostolic" b12x
  4. # harness). This is the BUG-2026-08-03T204037 bring-up recipe — the two images
  5. # are *different b12x forks*, not a version bump from production-3.75, so the
  6. # launch contract differs:
  7. #
  8. # - production-3.8 is a clean-overlay base (null ENTRYPOINT, CMD sleep
  9. # infinity) whose intended launcher is /usr/local/bin/dsv4-vllm-entrypoint.
  10. # We set that as the recipe entrypoint so the JIT toolchain env
  11. # (DG_JIT_NVCC_COMPILER, NVCC_PREPEND_FLAGS + CCCL include path, CUDAHOSTCXX)
  12. # and the /cache JIT dir layout are active. The 3.75 recipe ran vLLM directly
  13. # because that image was self-contained with everything baked in.
  14. # - VLLM_USE_V2_MODEL_RUNNER is dropped (experimental in this fork; the
  15. # working glm52 recipe does not set it).
  16. # - tiny-decode (VLLM_B12X_TINY_DECODE) is enabled at GMU 0.78 + CHUNK=8
  17. # (the load-time repack needs headroom; it OOM'd at GMU 0.9).
  18. # - /cache is mounted so the wrapper's JIT caches persist across restarts.
  19. engine = "vllm"
  20. name = "DeepSeek V4 Flash DSpark (production-3.8)"
  21. # Local overlay of the production-3.8 base built from
  22. # docker-images/deepseek-v4-flash-dspark38 (root-cause patch for the b12x
  23. # cutlass from_dlpack grad bug that blocked boot; see the Dockerfile).
  24. docker_image = "sparkrun-vllm-ds4-gb10:dspark38"
  25. model = "deepseek-ai/DeepSeek-V4-Flash-0731"
  26. required_nodes = 2
  27. tensor_parallel_size = 2
  28. pipeline_parallel_size = 1
  29. distributed_backend = "mp"
  30. shm_size = "32gb"
  31. # production-3.8 launch contract: the clean-base image must be started via the
  32. # dsv4-vllm-entrypoint wrapper, which sets the JIT toolchain + /cache dirs and
  33. # `exec vllm "$@"`. `serve <recipe-args/auto flags>` land as "$@".
  34. entrypoint = ["/usr/local/bin/dsv4-vllm-entrypoint", "serve"]
  35. args = [
  36. "--kv-cache-dtype", "fp8",
  37. "--block-size", "256",
  38. "--load-format", "auto",
  39. "--max-model-len", "524288",
  40. "--max-num-seqs", "8",
  41. "--max-num-batched-tokens", "8192",
  42. "--max-cudagraph-capture-size", "64",
  43. # 0.78 is the safe GMU ceiling on GB10 (weights ~77.7 GiB of ~119.6 GiB);
  44. # higher boots but dies under traffic. Also leaves headroom for the tiny
  45. # decode kernel's GPU load-time repack.
  46. "--gpu-memory-utilization", "0.78",
  47. "--served-model-name", "deepseek-v4-flash",
  48. # Engine backends — b12x across attention / MoE / linear (this fork's path)
  49. "--attention-backend", "B12X_MLA_SPARSE",
  50. "--moe-backend", "b12x",
  51. "--linear-backend", "b12x",
  52. # Prefix caching
  53. "--enable-prefix-caching",
  54. # Compilation
  55. "--compilation-config", """
  56. '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}'""",
  57. # DSpark speculative decoding — k=5 (DeepSeek-V4-Flash native
  58. # dspark_block_size). draft_sample_method greedy.
  59. "--speculative-config", """
  60. '{"method":"dspark","num_speculative_tokens":5,"draft_sample_method":"greedy"}'""",
  61. # Tokenizer / reasoning
  62. "--tokenizer-mode", "deepseek_v4",
  63. "--tool-call-parser", "deepseek_v4",
  64. "--reasoning-parser", "deepseek_v4",
  65. "--enable-auto-tool-choice",
  66. "--generation-config", "vllm",
  67. "--default-chat-template-kwargs.thinking=true",
  68. "--default-chat-template-kwargs.reasoning_effort=high",
  69. "--disable-custom-all-reduce",
  70. "--trust-remote-code",
  71. ]
  72. # Persistent JIT/compile caches. The wrapper `mkdir -p`s under /cache
  73. # (DG_JIT_CACHE_DIR=/cache/deep_gemm_jit, VLLM_CACHE_ROOT=/cache/vllm,
  74. # TRITON_CACHE_DIR=/cache/triton, etc.), so /cache must be a mounted volume to
  75. # survive restarts. The HF cache is already mounted at /root/.cache/huggingface
  76. # by the launcher.
  77. [[extra_mounts]]
  78. host = "~/.cache/ds4-38-vllm"
  79. container = "/cache"
  80. [env]
  81. # --- b12x fork env family (shared with the proven eugr b12x recipe) ---
  82. VLLM_ATTENTION_BACKEND = "B12X_MLA_SPARSE"
  83. VLLM_USE_B12X_MOE = "1"
  84. VLLM_USE_B12X_MHC = "1"
  85. VLLM_USE_B12X_WO_PROJECTION = "1"
  86. VLLM_USE_B12X_FP8_GEMM = "1"
  87. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  88. VLLM_USE_FLASHINFER_SAMPLER = "1"
  89. VLLM_USE_AOT_COMPILE = "1"
  90. VLLM_USE_MEGA_AOT_ARTIFACT = "0"
  91. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  92. VLLM_MEMORY_PROFILE_INCLUDE_ATTN = "1"
  93. VLLM_PREFIX_CACHE_RETENTION_INTERVAL = "4096"
  94. B12X_MLA_SM120_UNIFIED = "1"
  95. B12X_DENSE_SPLITK_TURBO = "1"
  96. B12X_W4A16_TC_DECODE = "1"
  97. # Tiny A8 decode kernel: DISABLED — its GPU load-time MoE-weight repack, on
  98. # top of the tight host RAM (~32 GiB free) + dual-node 155 GiB load, OOM'd both
  99. # hosts (had to power-cycle via HA). Revisit separately if host RAM headroom is
  100. # available. Keep the CHUNK pin for reference.
  101. # VLLM_B12X_TINY_DECODE = "1"
  102. # VLLM_B12X_TINY_CHUNK = "8"
  103. # --- arch / memory / GPU isolation (operational on the sm121 cluster) ---
  104. CUTE_DSL_ARCH = "sm_121a"
  105. TORCH_CUDA_ARCH_LIST = "12.1a"
  106. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  107. OMP_NUM_THREADS = "4"
  108. CUDA_VISIBLE_DEVICES = "0"
  109. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  110. CUDA_CACHE_MAXSIZE = "4294967296"
  111. # --- offline ---
  112. HF_HUB_OFFLINE = "1"
  113. # --- NCCL overrides (image-agnostic; launcher injects IB/HCA/socket from
  114. # cluster config, these are recipe-level extras) ---
  115. NCCL_P2P_LEVEL = "SYS"
  116. NCCL_CUMEM_ENABLE = "0"
  117. NCCL_IB_TIMEOUT = "24"
  118. NCCL_IB_QPS_PER_CONNECTION = "8"
  119. NCCL_BUFFERSIZE = "16777216"
  120. NCCL_SOCKET_FAMILY = "inet"
  121. VLLM_ENABLE_PCIE_ALLREDUCE = "0"
  122. VLLM_PCIE_ALLREDUCE_BACKEND = "cpp"