recipe.toml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # DeepSeek-V4-Flash-Vision-Exp on 2× GB10 — aidendle94 sparkrun vision image.
  2. #
  3. # aiden's vision guide (https://aidenle.com/recipes/deepseek-v4-flash-vision-4x-dgx-spark/)
  4. # translated to 2× Spark / DCP1 (his "DSpark, DCP1" profile: 73.8-75.2 tok/s at
  5. # TP4/DCP1; on 2x expect roughly half). His production lane ships DCP2 + DSpark
  6. # (66-71 tok/s, 3.5M KV); DCP flags omitted here — DSpark runs fine under DCP1.
  7. #
  8. # Image: dsv4-flash-vision:local (our plugin overlay on aiden's
  9. # production-3.76.1 base — see dsv4-flash-vision/ UPSTREAM.md). Aiden's
  10. # production-3.72-vision tag is the published 4x stack; running it under our
  11. # launcher needs his env-script contract (NODE_RANK/MASTER_ADDR/NCCL_IB_*
  12. # required by /usr/local/bin/deepseek-v4-flash-2x-spark-entrypoint →
  13. # /opt/vllm-src/serve-ds4-flash-spark.sh) — a dedicated integration pass,
  14. # tracked as follow-up. The overlay image carries the equivalent flags:
  15. # draft greedy + FULL_AND_PIECEWISE graphs + capture cap via the envs below.
  16. #
  17. # Weights: deepseek-ai/DeepSeek-V4-Flash-Vision-Exp (cached; ~84 GiB/node at
  18. # TP2 via ~/dsv4vision-hf NVMe copies). Draft heads ship in the checkpoint
  19. # (mtp.*) — no extra download.
  20. #
  21. # DSpark: k=6, greedy draft, acceptance 3.5-3.8 tokens/step. Acceptance is the
  22. # DCP correctness signal; equal DSpark-DCP1 numbers here = draft sees full ctx.
  23. # max-cudagraph-capture-size = seqs × (spec tokens + 1) = 8 × 7 = 56.
  24. #
  25. # VISION_MHC=1 follows aiden's production profile; our plugin lane keeps
  26. # VLLM_USE_B12X_MHC=0 (checkpoint rms_norm_eps 1e-20 vs fused Gram kernel's
  27. # 1e-6 — upstream README). If this boot asserts on the mHC kernel, flip to 0.
  28. #
  29. # Boot markers: vision plugin registered → "Model loading took ~84 GiB" →
  30. # "GPU KV cache size" ≈ 1.25M → "Application startup complete".
  31. engine = "vllm"
  32. name = "DeepSeek V4 Flash Vision-Exp (aiden image, 2x Spark, DSpark-6)"
  33. docker_image = "dsv4-flash-vision:local"
  34. model = "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp"
  35. required_nodes = 2
  36. tensor_parallel_size = 2
  37. pipeline_parallel_size = 1
  38. distributed_backend = "mp"
  39. shm_size = "32gb"
  40. # his image has TWO vllm wheels: dist-packages (plain, NO vision) and the
  41. # compiled stack at /opt/vllm-src/.venv (multimodal-wrapped DeepseekV4). The
  42. # image's own entrypoint script also injects a big env block (B12X_*,
  43. # PCIE_ALLREDUCE, MEGA_AOT, JIT paths) — the flag-relevant subset is in [env]
  44. # below. Point the launcher tail straight at their venv python.
  45. entrypoint = ["/opt/vllm-src/.venv/bin/python", "-m", "vllm.entrypoints.cli.main", "serve"]
  46. args = [
  47. "--served-model-name", "deepseek-v4-vision",
  48. "--trust-remote-code",
  49. "--distributed-executor-backend", "mp",
  50. "--attention-backend", "B12X_MLA_SPARSE",
  51. "--moe-backend", "b12x",
  52. "--linear-backend", "b12x",
  53. "--kv-cache-dtype", "fp8",
  54. "--block-size", "256",
  55. "--gpu-memory-utilization", "0.80",
  56. "--kv-cache-memory", "12884901888",
  57. "--max-model-len", "393216",
  58. "--max-num-seqs", "8",
  59. "--max-num-batched-tokens", "8192",
  60. # capture cap comes from the sizes list (max 8) — the 56 value would need 56 in the list
  61. "--compilation-config", """
  62. '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"],"cudagraph_capture_sizes":[1,2,3,4,5,6,7,8]}'""",
  63. "--async-scheduling",
  64. "--no-scheduler-reserve-full-isl",
  65. "--enable-chunked-prefill",
  66. "--enable-prefix-caching",
  67. "--tokenizer-mode", "deepseek_v4",
  68. "--tool-call-parser", "deepseek_v4",
  69. "--enable-auto-tool-choice",
  70. "--reasoning-parser", "deepseek_v4",
  71. "--reasoning-config", """
  72. '{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}'""",
  73. "--default-chat-template-kwargs", """
  74. '{"thinking":false,"reasoning_effort":"low"}'""",
  75. "--speculative-config", """
  76. '{"method":"dspark","num_speculative_tokens":6,"draft_sample_method":"greedy","attention_backend":"B12X_MLA_SPARSE"}'""",
  77. "--disable-chunked-mm-input",
  78. "--limit-mm-per-prompt", """
  79. '{"image":4}'""",
  80. ]
  81. [env]
  82. # aidee runner envs (his guide, minus DCP2-only and fabric knobs)
  83. CUTE_DSL_ARCH = "sm_121a"
  84. TRITON_PTXAS_PATH = "/usr/local/cuda/bin/ptxas"
  85. DG_JIT_USE_NVRTC = "0"
  86. USE_CUDNN = "1"
  87. VLLM_USE_MEGA_AOT_ARTIFACT = "1"
  88. VLLM_ENABLE_PCIE_ALLREDUCE = "1"
  89. VLLM_PCIE_ALLREDUCE_BACKEND = "b12x"
  90. VLLM_USE_B12X_DENSE_SPLITK_TURBO = "1"
  91. VLLM_USE_B12X_W4A16_TC_DECODE = "1"
  92. VLLM_ENABLE_DSPARK = "1"
  93. VLLM_ENABLE_MTP = "0"
  94. NUM_SPECULATIVE_TOKENS = "6"
  95. DSPARK_DRAFT_SAMPLE_METHOD = "greedy"
  96. DSPARK_SPS_CURVE = "auto"
  97. VLLM_CUDAGRAPH_MODE = "FULL_AND_PIECEWISE"
  98. VISION_MHC = "1"
  99. MAX_CUDAGRAPH_CAPTURE_SIZE = "56"
  100. # proven 2x-lane knobs carried over
  101. VLLM_USE_AOT_COMPILE = "1"
  102. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  103. VLLM_USE_FLASHINFER_SAMPLER = "1"
  104. VLLM_USE_B12X_WO_PROJECTION = "1"
  105. VLLM_USE_B12X_FP8_GEMM = "1"
  106. VLLM_USE_B12X_MOE = "1"
  107. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  108. B12X_MLA_SM120_UNIFIED = "1"
  109. B12X_MOE_FORCE_A8 = "1"
  110. HF_HUB_OFFLINE = "1"
  111. TRANSFORMERS_OFFLINE = "1"
  112. VLLM_NO_USAGE_STATS = "1"
  113. # Weights from per-node NVMe copies; extra_mounts stay AFTER args.
  114. [[extra_mounts]]
  115. host = "~/dsv4vision-hf"
  116. container = "/opt/local-hf"
  117. env = "HF_HOME"