recipe.toml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # DeepSeek-V4-Flash-Vision-Exp — 2× GB10 / DGX Spark, TP=2 (vision lane).
  2. #
  3. # Model: deepseek-ai/DeepSeek-V4-Flash-Vision-Exp (MIT) — DeepSeek's first
  4. # multimodal V4: 284B total / 13B active MoE, experts MXFP4, attention FP8,
  5. # 32-layer ViT (~0.47B BF16) + aligner, native ctx 1,048,576; 43+3 MoE
  6. # layers, DFlash attention, index_topk 512, fp8 block [128,128].
  7. # Day-0 vision support lives in a vLLM PLUGIN (dsv4_vision) subclassing
  8. # DeepseekV4ForCausalLM so DSpark speculative still works; the plugin is
  9. # baked into our overlay image (docker-images/dsv4-flash-vision/, see its
  10. # UPSTREAM.md for provenance and the sfxnz repo @7a958128b84a).
  11. #
  12. # Image: dsv4-flash-vision:local — built from eugr/spark-vllm-b12x:latest
  13. # (digest sha256:7dc02f162929943ba2e14514066ed2a04bb7e9ed3592d4eb460ebcbb1f8376bd)
  14. # by default; the aidendle94/sparkrun-vllm-ds4-gb10:production-3.76.1 base
  15. # (sha256:39cda85c28a8795dc20a274fdabfece66f329d1e21c3f4552a7e75061ea8696a)
  16. # is the comparison variant for the same plugin (fork A/B).
  17. #
  18. # Model revision: 86f746b36186f0e567729a5c06a8c918caba82a9 (sfxnz pin).
  19. #
  20. # DEVIATIONS from the sfxnz run.sh defaults — all forced by our launcher:
  21. # * no --host/--port/--nnodes/--node-rank/--master-* (launcher fabric),
  22. # * no NCCL/* / IFACE / HCA env (launcher resolves; RoCE on sw fabric),
  23. # * weights from per-node local NVMe copies (`~/dsv4vision-hf`, 167 GiB
  24. # each on dgx3/dgx4 — rsync'd from the NAS hub 2026-09-01); shard load
  25. # drops from ~7 min (NAS) to well under a minute. Fallback: re-add the
  26. # `[[extra_mounts]] host = "/mnt/nas/ai/huggingface" … env = "HF_HOME"`
  27. # block below to stream from the NAS hub again.
  28. # VLLM_USE_B12X_MHC stays OFF (this checkpoint has rms_norm_eps 1e-20; the
  29. # fused Gram mHC kernel only accepts 1e-6 — upstream README).
  30. #
  31. # Boot markers: "vision" plugin registered line → "Model loading took …"
  32. # (~84 GiB/node) → "GPU KV cache size" ≈ 1.25M tokens → "Application
  33. # startup complete". Vision smoke: image_url content with the
  34. # <|deepseek_image|> placeholder (cap 384 tokens per image).
  35. #
  36. # PREREQUISITES: weights cached on the NAS hub once (168 GB):
  37. # docker run --rm --entrypoint python3 -v /mnt/nas/ai/huggingface:/root/.cache/huggingface \
  38. # glm53-flash-nvfp4-lab:local -c "from huggingface_hub import snapshot_download; \
  39. # snapshot_download('deepseek-ai/DeepSeek-V4-Flash-Vision-Exp')"
  40. engine = "vllm"
  41. name = "DeepSeek V4 Flash Vision-Exp (vLLM, 2x Spark, DSpark-6)"
  42. docker_image = "dsv4-flash-vision:local"
  43. docker_image_dir = "dsv4-flash-vision"
  44. model = "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp"
  45. required_nodes = 2
  46. tensor_parallel_size = 2
  47. pipeline_parallel_size = 1
  48. distributed_backend = "mp"
  49. shm_size = "32gb"
  50. args = [
  51. # Stable served name (quant-agnostic convention for the ds4-vision lane)
  52. "--served-model-name", "deepseek-v4-flash-vision",
  53. "--trust-remote-code",
  54. "--distributed-executor-backend", "mp",
  55. # sfxnz run.sh defaults (verbatim, minus launcher-managed fabric knobs)
  56. "--max-model-len", "1048576",
  57. "--kv-cache-dtype", "fp8",
  58. # their pin: "a 26 GiB community pin" is too big for this UMA leftover
  59. "--kv-cache-memory", "12884901888",
  60. "--gpu-memory-utilization", "0.80",
  61. "--max-num-seqs", "2",
  62. "--max-num-batched-tokens", "8192",
  63. "--block-size", "256",
  64. # Engine backends (B12X GB10 lane)
  65. "--moe-backend", "b12x",
  66. "--linear-backend", "b12x",
  67. "--attention-backend", "B12X_MLA_SPARSE",
  68. # DSpark-6 (k must be divisible by n_predict=3; DSpark-5 is rejected)
  69. "--speculative-config", """
  70. '{"method":"dspark","num_speculative_tokens":6,"draft_sample_method":"probabilistic","attention_backend":"B12X_MLA_SPARSE"}'""",
  71. "--tokenizer-mode", "deepseek_v4",
  72. "--tool-call-parser", "deepseek_v4",
  73. "--enable-auto-tool-choice",
  74. "--reasoning-parser", "deepseek_v4",
  75. "--reasoning-config", """
  76. '{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}'""",
  77. "--default-chat-template-kwargs", """
  78. '{"thinking":false,"reasoning_effort":"low"}'""",
  79. "--limit-mm-per-prompt", """
  80. '{"image":8}'""",
  81. "--enable-prefix-caching",
  82. # If the stock loader balloons passenger anon buffers while streaming
  83. # from the NAS (the EXL3 lesson, 3 kernel kills on a sibling kit),
  84. # flip this on: the overlay ships instanttensor==0.1.9 (no-deps).
  85. # "--load-format", "instanttensor",
  86. ]
  87. [env]
  88. # Vision + engine lane knobs (sfxnz run.sh, verbatim minus fabric)
  89. CUTE_DSL_ARCH = "sm_121a"
  90. # AOT compile stays ON for the text-only lane (verified). The experimental
  91. # VLLM_DSV4_MM=1 mode traces its embed path with a 2-D dummy and then rejects
  92. # the hc-stream 3-D form ("wrong number of dimensions3 for op: input") —
  93. # flip this to "0" when testing that mode.
  94. VLLM_USE_AOT_COMPILE = "1"
  95. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  96. VLLM_USE_MEGA_AOT_ARTIFACT = "-1"
  97. VLLM_MEMORY_PROFILE_INCLUDE_ATTN = "1"
  98. VLLM_USE_FLASHINFER_SAMPLER = "1"
  99. VLLM_USE_B12X_WO_PROJECTION = "1"
  100. VLLM_USE_B12X_MHC = "0"
  101. VLLM_USE_B12X_FP8_GEMM = "1"
  102. VLLM_USE_B12X_MOE = "1"
  103. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  104. VLLM_USE_V2_MODEL_RUNNER = "1"
  105. B12X_MLA_SM120_UNIFIED = "1"
  106. B12X_MOE_FORCE_A8 = "1"
  107. HF_HUB_OFFLINE = "1"
  108. TRANSFORMERS_OFFLINE = "1"
  109. VLLM_NO_USAGE_STATS = "1"
  110. # Weights from the shared NAS hub; JIT caches persist per node.
  111. # NOTE: extra_mounts stay AFTER args (TOML table headers would swallow the
  112. # args array otherwise).
  113. [[extra_mounts]]
  114. host = "~/dsv4vision-hf"
  115. container = "/opt/local-hf"
  116. env = "HF_HOME"
  117. # Weights from the shared NAS hub; JIT caches persist per node.
  118. # NOTE: extra_mounts stay AFTER args (TOML table headers would swallow the
  119. # args array otherwise).
  120. # [[extra_mounts]]
  121. # host = "/mnt/nas/ai/huggingface"
  122. # container = "/mnt/nas/ai/huggingface"
  123. # env = "HF_HOME"
  124. [[extra_mounts]]
  125. host = "~/.cache/dsv4vision-jit/triton"
  126. container = "/root/.triton"
  127. [[extra_mounts]]
  128. host = "~/.cache/dsv4vision-jit/flashinfer"
  129. container = "/root/.cache/flashinfer"
  130. [[extra_mounts]]
  131. host = "~/.cache/dsv4vision-jit/vllm"
  132. container = "/root/.cache/vllm"