recipe.toml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # DeepSeek-V4-Flash-DSpark — 2× GB10 / DGX Spark, TP=2 over RoCE.
  2. # Uses the DSpark speculative decoding method with aidendle94's production-3.7 image.
  3. #
  4. # Image: aidendle94/sparkrun-vllm-ds4-gb10:production-3.7
  5. # Latest GB10-native image with DSpark support, b12x MoE, and multi-node fixes.
  6. # Model: deepseek-ai/DeepSeek-V4-Flash-DSpark
  7. # The DSpark variant tuned for speculative decoding on DGX Spark.
  8. #
  9. # Reference: Nvidia Developer Forum — DeepSeek-V4-Flash-DSpark recipe
  10. # https://forums.developer.nvidia.com/t/recipe-deepseek-v4-flash-dspark-on-dgx-spark/340994
  11. engine = "vllm"
  12. name = "DeepSeek V4 Flash DSpark (vLLM)"
  13. docker_image = "sparkrun-vllm-ds4-gb10:fixed"
  14. model = "deepseek-ai/DeepSeek-V4-Flash-DSpark"
  15. required_nodes = 2
  16. tensor_parallel_size = 2
  17. pipeline_parallel_size = 1
  18. distributed_backend = "mp"
  19. shm_size = "32gb"
  20. docker_image_dir = "deepseek-v4-flash-dspark"
  21. entrypoint = ["vllm", "serve"]
  22. args = [
  23. "--kv-cache-dtype", "fp8",
  24. "--block-size", "256",
  25. "--load-format", "auto",
  26. "--max-model-len", "524288",
  27. "--max-num-seqs", "16",
  28. "--max-num-batched-tokens", "16536",
  29. "--max-cudagraph-capture-size", "16",
  30. "--gpu-memory-utilization", "0.84",
  31. "--served-model-name", "deepseek-v4-flash", "default",
  32. # Engine backends
  33. "--attention-backend", "FLASHINFER_MLA_SPARSE_DSV4",
  34. "--moe-backend", "b12x",
  35. # Chunked prefill + prefix caching
  36. "--enable-chunked-prefill",
  37. "--enable-prefix-caching",
  38. "--enable-flashinfer-autotune",
  39. # Compilation
  40. "--compilation-config", """
  41. '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}'""",
  42. # Async scheduling
  43. "--async-scheduling",
  44. "--no-scheduler-reserve-full-isl",
  45. # DSpark speculative decoding
  46. "--speculative-config", """
  47. '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'""",
  48. # Tokenizer / reasoning
  49. "--tokenizer-mode", "deepseek_v4",
  50. "--tool-call-parser", "deepseek_v4",
  51. "--reasoning-parser", "deepseek_v4",
  52. "--enable-auto-tool-choice",
  53. "--generation-config", "vllm",
  54. "--default-chat-template-kwargs.thinking=true",
  55. "--default-chat-template-kwargs.reasoning_effort=high",
  56. #"--default-chat-template-kwargs.temperature=0.95",
  57. #"--default-chat-template-kwargs.top_p=0.40",
  58. # Disable custom all-reduce (not needed on GB10 single-NIC)
  59. "--disable-custom-all-reduce",
  60. "--trust-remote-code",
  61. ]
  62. [env]
  63. # DSpark speculative decoding
  64. VLLM_DSPARK_REPLICATE_MARKOV_W1 = "1"
  65. # b12x MoE (this image's primary path)
  66. VLLM_USE_B12X_MOE = "1"
  67. # VLLM_USE_B12X_MOE = "0" # b12x MoE OFF -> cutlass W4A8 (b12x MoE prefill stalls on GB10)
  68. # b12x suite = REQUIRED by this image
  69. VLLM_USE_B12X_MHC = "1"
  70. VLLM_USE_B12X_WO_PROJECTION = "1"
  71. VLLM_USE_B12X_FP8_GEMM = "1"
  72. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  73. VLLM_USE_V2_MODEL_RUNNER = "1"
  74. VLLM_USE_FLASHINFER_SAMPLER = "1"
  75. VLLM_USE_AOT_COMPILE = "1"
  76. VLLM_USE_MEGA_AOT_ARTIFACT = "0"
  77. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  78. VLLM_MEMORY_PROFILE_INCLUDE_ATTN = "1"
  79. VLLM_PREFIX_CACHE_RETENTION_INTERVAL = "4096"
  80. B12X_MLA_SM120_UNIFIED = "1"
  81. B12X_DENSE_SPLITK_TURBO = "1"
  82. B12X_W4A16_TC_DECODE = "1"
  83. B12X_MHC_MAX_TOKENS = "16384"
  84. # GPU memory management
  85. CUTE_DSL_ARCH = "sm_121a"
  86. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  87. OMP_NUM_THREADS = "4"
  88. # Offline mode
  89. HF_HUB_OFFLINE = "1"
  90. # Compile-time arch hints
  91. TORCH_CUDA_ARCH_LIST = "12.1a"
  92. # NCCL overrides (cluster config ib_hca/socket_ifname used for most; recipe wins last)
  93. NCCL_P2P_LEVEL = "2"
  94. NCCL_CUMEM_ENABLE = "0"
  95. NCCL_IB_TIMEOUT = "24"
  96. NCCL_IB_QPS_PER_CONNECTION = "8"
  97. NCCL_BUFFERSIZE = "16777216"
  98. NCCL_SOCKET_FAMILY = "inet"
  99. # PCIe allreduce not needed on GB10 single-NIC
  100. VLLM_ENABLE_PCIE_ALLREDUCE = "0"
  101. VLLM_PCIE_ALLREDUCE_BACKEND = "cpp"
  102. # GPU device isolation (single GPU per node)
  103. CUDA_VISIBLE_DEVICES = "0"
  104. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  105. CUDA_CACHE_MAXSIZE = "4294967296"