recipe.toml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # DeepSeek-V4-Flash-DSpark — 2× GB10 / DGX Spark, TP=2 over RoCE.
  2. # DSpark speculative decoding on the official DeepSeek-V4-Flash-0731 release
  3. # via the local :fixed overlay on aidendle94's production-3.75 image (see
  4. # docker-images/deepseek-v4-flash-dspark).
  5. #
  6. # Image: sparkrun-vllm-ds4-gb10:fixed
  7. # production-3.75 base (DSpark, b12x MoE, patched NCCL 2.30.4, multi-node
  8. # fixes) + instanttensor for faster model loading.
  9. # Model: deepseek-ai/DeepSeek-V4-Flash-0731 — official release.
  10. # 0731 (and the -DSpark preview) both have dspark_block_size = 5. This image's
  11. # speculator hard-rejects num_speculative_tokens > block_size
  12. # (v1/worker/gpu/spec_decode/dspark/speculator.py, "must be <= dspark_block_size"),
  13. # so k=7 (as suggested by the 0731 model card) FAILS to boot. k=5 is the
  14. # model's native draft block and the correct value here.
  15. #
  16. # Note: this image lineage (vLLM 0.2x with the upstream DSpark speculator) does
  17. # NOT have the shared-expert draft-loader bug reported for the older fork
  18. # (tonyd2wild Patch 4). Its loader already maps mtp.*.shared_experts.w1/w3 into
  19. # gate_up_proj (dspark.py load_weights), so no patch is needed.
  20. #
  21. # Reference: Nvidia Developer Forum — DeepSeek-V4-Flash-0731 recipe
  22. # https://forums.developer.nvidia.com/t/deepseek-v4-flash-0731-dspark-1m-nvfp4-kv-2x-dgx-spark/378824
  23. engine = "vllm"
  24. name = "DeepSeek V4 Flash DSpark (vLLM)"
  25. docker_image = "sparkrun-vllm-ds4-gb10:fixed"
  26. model = "deepseek-ai/DeepSeek-V4-Flash-0731"
  27. required_nodes = 2
  28. tensor_parallel_size = 2
  29. pipeline_parallel_size = 1
  30. distributed_backend = "mp"
  31. shm_size = "32gb"
  32. docker_image_dir = "deepseek-v4-flash-dspark"
  33. entrypoint = ["vllm", "serve"]
  34. args = [
  35. "--kv-cache-dtype", "fp8",
  36. "--block-size", "256",
  37. "--load-format", "auto",
  38. "--max-model-len", "524288",
  39. "--max-num-seqs", "16",
  40. "--max-num-batched-tokens", "16536",
  41. "--max-cudagraph-capture-size", "16",
  42. "--gpu-memory-utilization", "0.84",
  43. "--served-model-name", "deepseek-v4-flash",
  44. # Engine backends
  45. "--attention-backend", "FLASHINFER_MLA_SPARSE_DSV4",
  46. "--moe-backend", "b12x",
  47. # Chunked prefill + prefix caching
  48. "--enable-chunked-prefill",
  49. "--enable-prefix-caching",
  50. "--enable-flashinfer-autotune",
  51. # Compilation
  52. "--compilation-config", """
  53. '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}'""",
  54. # Async scheduling
  55. "--async-scheduling",
  56. "--no-scheduler-reserve-full-isl",
  57. # DSpark speculative decoding — k=5 is DeepSeek-V4-Flash's native
  58. # dspark_block_size (0731 == preview). Do NOT raise to k=7 (0731 model-card
  59. # rec): this image hard-rejects k > block_size at boot. draft_sample_method
  60. # is accepted by the speculative-config parser (no-op on the DSpark path).
  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. # "--default-chat-template-kwargs.temperature=1",
  72. # "--default-chat-template-kwargs.top_p=1",
  73. # Disable custom all-reduce (not needed on GB10 single-NIC)
  74. "--disable-custom-all-reduce",
  75. "--trust-remote-code",
  76. ]
  77. # Persistent compile caches (speed up restarts — see guide §2/§7). The HF
  78. # cache is already mounted at /root/.cache/huggingface by the launcher.
  79. [[extra_mounts]]
  80. host = "~/.cache/vllm-ds4-dspark" # compiled vLLM/attention kernels
  81. container = "/cache"
  82. [[extra_mounts]]
  83. host = "~/.cache/tilelang-ds4" # DSpark speculative-decode kernels
  84. container = "/root/.tilelang"
  85. [env]
  86. # DSpark speculative decoding
  87. VLLM_DSPARK_REPLICATE_MARKOV_W1 = "1"
  88. # b12x MoE (this image's primary path)
  89. VLLM_USE_B12X_MOE = "1"
  90. # VLLM_USE_B12X_MOE = "0" # b12x MoE OFF -> cutlass W4A8 (b12x MoE prefill stalls on GB10)
  91. # b12x suite = REQUIRED by this image
  92. VLLM_USE_B12X_MHC = "1"
  93. VLLM_USE_B12X_WO_PROJECTION = "1"
  94. VLLM_USE_B12X_FP8_GEMM = "1"
  95. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  96. VLLM_USE_V2_MODEL_RUNNER = "1"
  97. VLLM_USE_FLASHINFER_SAMPLER = "1"
  98. VLLM_USE_AOT_COMPILE = "1"
  99. VLLM_USE_MEGA_AOT_ARTIFACT = "0"
  100. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  101. VLLM_MEMORY_PROFILE_INCLUDE_ATTN = "1"
  102. VLLM_PREFIX_CACHE_RETENTION_INTERVAL = "4096"
  103. B12X_MLA_SM120_UNIFIED = "1"
  104. B12X_DENSE_SPLITK_TURBO = "1"
  105. B12X_W4A16_TC_DECODE = "1"
  106. B12X_MHC_MAX_TOKENS = "16384"
  107. # GPU memory management
  108. CUTE_DSL_ARCH = "sm_121a"
  109. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  110. OMP_NUM_THREADS = "4"
  111. # Offline mode
  112. HF_HUB_OFFLINE = "1"
  113. # Compile-time arch hints
  114. TORCH_CUDA_ARCH_LIST = "12.1a"
  115. # NCCL overrides (cluster config ib_hca/socket_ifname used for most; recipe wins last)
  116. NCCL_P2P_LEVEL = "SYS"
  117. NCCL_CUMEM_ENABLE = "0"
  118. NCCL_IB_TIMEOUT = "24"
  119. NCCL_IB_QPS_PER_CONNECTION = "8"
  120. NCCL_BUFFERSIZE = "16777216"
  121. NCCL_SOCKET_FAMILY = "inet"
  122. # PCIe allreduce not needed on GB10 single-NIC
  123. VLLM_ENABLE_PCIE_ALLREDUCE = "0"
  124. VLLM_PCIE_ALLREDUCE_BACKEND = "cpp"
  125. # GPU device isolation (single GPU per node)
  126. CUDA_VISIBLE_DEVICES = "0"
  127. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  128. CUDA_CACHE_MAXSIZE = "4294967296"