recipe.toml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. # image ships ENTRYPOINT ["vllm","serve"]; our launcher passes the recipe
  41. # entrypoint as CMD words after the image, which would double it. Empty clears.
  42. entrypoint = []
  43. args = [
  44. "--served-model-name", "deepseek-v4-vision",
  45. "--trust-remote-code",
  46. "--distributed-executor-backend", "mp",
  47. "--attention-backend", "B12X_MLA_SPARSE",
  48. "--moe-backend", "b12x",
  49. "--linear-backend", "b12x",
  50. "--kv-cache-dtype", "fp8",
  51. "--block-size", "256",
  52. "--gpu-memory-utilization", "0.80",
  53. "--kv-cache-memory", "12884901888",
  54. "--max-model-len", "393216",
  55. "--max-num-seqs", "8",
  56. "--max-num-batched-tokens", "8192",
  57. "--max-cudagraph-capture-size", "56",
  58. "--compilation-config", """
  59. '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"],"cudagraph_capture_sizes":[1,2,3,4,5,6,7,8]}'""",
  60. "--async-scheduling",
  61. "--no-scheduler-reserve-full-isl",
  62. "--enable-chunked-prefill",
  63. "--enable-prefix-caching",
  64. "--tokenizer-mode", "deepseek_v4",
  65. "--tool-call-parser", "deepseek_v4",
  66. "--enable-auto-tool-choice",
  67. "--reasoning-parser", "deepseek_v4",
  68. "--reasoning-config", """
  69. '{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}'""",
  70. "--default-chat-template-kwargs", """
  71. '{"thinking":false,"reasoning_effort":"low"}'""",
  72. "--speculative-config", """
  73. '{"method":"dspark","num_speculative_tokens":6,"draft_sample_method":"greedy","attention_backend":"B12X_MLA_SPARSE"}'""",
  74. "--disable-chunked-mm-input",
  75. "--limit-mm-per-prompt", """
  76. '{"image":4}'""",
  77. ]
  78. [env]
  79. # aidee runner envs (his guide, minus DCP2-only and fabric knobs)
  80. CUTE_DSL_ARCH = "sm_121a"
  81. VLLM_ENABLE_DSPARK = "1"
  82. VLLM_ENABLE_MTP = "0"
  83. NUM_SPECULATIVE_TOKENS = "6"
  84. DSPARK_DRAFT_SAMPLE_METHOD = "greedy"
  85. DSPARK_SPS_CURVE = "auto"
  86. VLLM_CUDAGRAPH_MODE = "FULL_AND_PIECEWISE"
  87. VISION_MHC = "1"
  88. MAX_CUDAGRAPH_CAPTURE_SIZE = "56"
  89. # proven 2x-lane knobs carried over
  90. VLLM_USE_AOT_COMPILE = "1"
  91. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  92. VLLM_USE_FLASHINFER_SAMPLER = "1"
  93. VLLM_USE_B12X_WO_PROJECTION = "1"
  94. VLLM_USE_B12X_FP8_GEMM = "1"
  95. VLLM_USE_B12X_MOE = "1"
  96. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  97. B12X_MLA_SM120_UNIFIED = "1"
  98. B12X_MOE_FORCE_A8 = "1"
  99. HF_HUB_OFFLINE = "1"
  100. TRANSFORMERS_OFFLINE = "1"
  101. VLLM_NO_USAGE_STATS = "1"
  102. # Weights from per-node NVMe copies; extra_mounts stay AFTER args.
  103. [[extra_mounts]]
  104. host = "~/dsv4vision-hf"
  105. container = "/opt/local-hf"
  106. env = "HF_HOME"