recipe.toml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 dropped for first bring-up — it is
  17. # an opt-in experimental kernel whose GPU load-time repack OOMs.
  18. # - /cache is mounted so the wrapper's JIT caches persist across restarts.
  19. #
  20. # The known-open question is the DeepGEMM `t.dim() == N` assertion
  21. # (csrc/utils/layout.hpp:39), which fires during MoE scale packing on this
  22. # fork regardless of --moe-backend. This recipe is the repro for that crash;
  23. # see specs/bugs/BUG-2026-08-03T204037-production-3.8-image-update-failures.md.
  24. engine = "vllm"
  25. name = "DeepSeek V4 Flash DSpark (production-3.8)"
  26. # Local overlay of the production-3.8 base built from
  27. # docker-images/deepseek-v4-flash-dspark38 (root-cause patch for the b12x
  28. # cutlass from_dlpack grad bug that blocked boot; see the Dockerfile).
  29. docker_image = "sparkrun-vllm-ds4-gb10:dspark38"
  30. model = "deepseek-ai/DeepSeek-V4-Flash-0731"
  31. required_nodes = 2
  32. tensor_parallel_size = 2
  33. pipeline_parallel_size = 1
  34. distributed_backend = "mp"
  35. shm_size = "32gb"
  36. # production-3.8 launch contract: the clean-base image must be started via the
  37. # dsv4-vllm-entrypoint wrapper, which sets the JIT toolchain + /cache dirs and
  38. # `exec vllm "$@"`. `serve <recipe-args/auto flags>` land as "$@".
  39. entrypoint = ["/usr/local/bin/dsv4-vllm-entrypoint", "serve"]
  40. args = [
  41. "--kv-cache-dtype", "fp8",
  42. "--block-size", "256",
  43. "--load-format", "auto",
  44. "--max-model-len", "524288",
  45. "--max-num-seqs", "8",
  46. "--max-num-batched-tokens", "8192",
  47. "--max-cudagraph-capture-size", "64",
  48. "--gpu-memory-utilization", "0.84",
  49. "--served-model-name", "deepseek-v4-flash",
  50. # Engine backends — b12x across attention / MoE / linear (this fork's path)
  51. "--attention-backend", "B12X_MLA_SPARSE",
  52. "--moe-backend", "b12x",
  53. "--linear-backend", "b12x",
  54. # Prefix caching
  55. "--enable-prefix-caching",
  56. # Compilation
  57. "--compilation-config", """
  58. '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}'""",
  59. # DSpark speculative decoding — k=5 (DeepSeek-V4-Flash native
  60. # dspark_block_size). draft_sample_method greedy.
  61. "--speculative-config", """
  62. '{"method":"dspark","num_speculative_tokens":5,"draft_sample_method":"greedy"}'""",
  63. # Tokenizer / reasoning
  64. "--tokenizer-mode", "deepseek_v4",
  65. "--tool-call-parser", "deepseek_v4",
  66. "--reasoning-parser", "deepseek_v4",
  67. "--enable-auto-tool-choice",
  68. "--generation-config", "vllm",
  69. "--default-chat-template-kwargs.thinking=true",
  70. "--default-chat-template-kwargs.reasoning_effort=high",
  71. "--disable-custom-all-reduce",
  72. "--trust-remote-code",
  73. ]
  74. # Persistent JIT/compile caches. The wrapper `mkdir -p`s under /cache
  75. # (DG_JIT_CACHE_DIR=/cache/deep_gemm_jit, VLLM_CACHE_ROOT=/cache/vllm,
  76. # TRITON_CACHE_DIR=/cache/triton, etc.), so /cache must be a mounted volume to
  77. # survive restarts. The HF cache is already mounted at /root/.cache/huggingface
  78. # by the launcher.
  79. [[extra_mounts]]
  80. host = "~/.cache/ds4-38-vllm"
  81. container = "/cache"
  82. [env]
  83. # --- b12x fork env family (shared with the proven eugr b12x recipe) ---
  84. VLLM_ATTENTION_BACKEND = "B12X_MLA_SPARSE"
  85. VLLM_USE_B12X_MOE = "1"
  86. VLLM_USE_B12X_MHC = "1"
  87. VLLM_USE_B12X_WO_PROJECTION = "1"
  88. VLLM_USE_B12X_FP8_GEMM = "1"
  89. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  90. VLLM_USE_FLASHINFER_SAMPLER = "1"
  91. VLLM_USE_AOT_COMPILE = "1"
  92. VLLM_USE_MEGA_AOT_ARTIFACT = "0"
  93. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  94. VLLM_MEMORY_PROFILE_INCLUDE_ATTN = "1"
  95. VLLM_PREFIX_CACHE_RETENTION_INTERVAL = "4096"
  96. B12X_MLA_SM120_UNIFIED = "1"
  97. B12X_DENSE_SPLITK_TURBO = "1"
  98. B12X_W4A16_TC_DECODE = "1"
  99. B12X_MHC_MAX_TOKENS = "16384"
  100. # --- arch / memory / GPU isolation (operational on the sm121 cluster) ---
  101. CUTE_DSL_ARCH = "sm_121a"
  102. TORCH_CUDA_ARCH_LIST = "12.1a"
  103. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  104. OMP_NUM_THREADS = "4"
  105. CUDA_VISIBLE_DEVICES = "0"
  106. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  107. CUDA_CACHE_MAXSIZE = "4294967296"
  108. # --- offline ---
  109. HF_HUB_OFFLINE = "1"
  110. # --- NCCL overrides (image-agnostic; launcher injects IB/HCA/socket from
  111. # cluster config, these are recipe-level extras) ---
  112. NCCL_P2P_LEVEL = "SYS"
  113. NCCL_CUMEM_ENABLE = "0"
  114. NCCL_IB_TIMEOUT = "24"
  115. NCCL_IB_QPS_PER_CONNECTION = "8"
  116. NCCL_BUFFERSIZE = "16777216"
  117. NCCL_SOCKET_FAMILY = "inet"
  118. VLLM_ENABLE_PCIE_ALLREDUCE = "0"
  119. VLLM_PCIE_ALLREDUCE_BACKEND = "cpp"