recipe.toml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 stream from the shared NAS hub (their kit uses per-node local
  24. # NVMe; if the loader balloons memory like it did on EXL3, flip to
  25. # --load-format instanttensor).
  26. # VLLM_USE_B12X_MHC stays OFF (this checkpoint has rms_norm_eps 1e-20; the
  27. # fused Gram mHC kernel only accepts 1e-6 — upstream README).
  28. #
  29. # Boot markers: "vision" plugin registered line → "Model loading took …"
  30. # (~84 GiB/node) → "GPU KV cache size" ≈ 1.25M tokens → "Application
  31. # startup complete". Vision smoke: image_url content with the
  32. # <|deepseek_image|> placeholder (cap 384 tokens per image).
  33. #
  34. # PREREQUISITES: weights cached on the NAS hub once (168 GB):
  35. # docker run --rm --entrypoint python3 -v /mnt/nas/ai/huggingface:/root/.cache/huggingface \
  36. # glm53-flash-nvfp4-lab:local -c "from huggingface_hub import snapshot_download; \
  37. # snapshot_download('deepseek-ai/DeepSeek-V4-Flash-Vision-Exp')"
  38. engine = "vllm"
  39. name = "DeepSeek V4 Flash Vision-Exp (vLLM, 2x Spark, DSpark-6)"
  40. docker_image = "dsv4-flash-vision:local"
  41. docker_image_dir = "dsv4-flash-vision"
  42. model = "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp"
  43. required_nodes = 2
  44. tensor_parallel_size = 2
  45. pipeline_parallel_size = 1
  46. distributed_backend = "mp"
  47. shm_size = "32gb"
  48. args = [
  49. # Stable served name (quant-agnostic convention for the ds4-vision lane)
  50. "--served-model-name", "deepseek-v4-flash-vision",
  51. "--trust-remote-code",
  52. "--distributed-executor-backend", "mp",
  53. # sfxnz run.sh defaults (verbatim, minus launcher-managed fabric knobs)
  54. "--max-model-len", "1048576",
  55. "--kv-cache-dtype", "fp8",
  56. # their pin: "a 26 GiB community pin" is too big for this UMA leftover
  57. "--kv-cache-memory", "12884901888",
  58. "--gpu-memory-utilization", "0.80",
  59. "--max-num-seqs", "2",
  60. "--max-num-batched-tokens", "8192",
  61. "--block-size", "256",
  62. # Engine backends (B12X GB10 lane)
  63. "--moe-backend", "b12x",
  64. "--linear-backend", "b12x",
  65. "--attention-backend", "B12X_MLA_SPARSE",
  66. # DSpark-6 (k must be divisible by n_predict=3; DSpark-5 is rejected)
  67. "--speculative-config", """
  68. '{"method":"dspark","num_speculative_tokens":6,"draft_sample_method":"probabilistic","attention_backend":"B12X_MLA_SPARSE"}'""",
  69. "--tokenizer-mode", "deepseek_v4",
  70. "--tool-call-parser", "deepseek_v4",
  71. "--enable-auto-tool-choice",
  72. "--reasoning-parser", "deepseek_v4",
  73. "--reasoning-config", """
  74. '{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}'""",
  75. "--default-chat-template-kwargs", """
  76. '{"thinking":false,"reasoning_effort":"low"}'""",
  77. "--limit-mm-per-prompt", """
  78. '{"image":8}'""",
  79. "--enable-prefix-caching",
  80. # If the stock loader balloons passenger anon buffers while streaming
  81. # from the NAS (the EXL3 lesson, 3 kernel kills on a sibling kit),
  82. # flip this on: the overlay ships instanttensor==0.1.9 (no-deps).
  83. # "--load-format", "instanttensor",
  84. ]
  85. [env]
  86. # Vision + engine lane knobs (sfxnz run.sh, verbatim minus fabric)
  87. CUTE_DSL_ARCH = "sm_121a"
  88. VLLM_USE_AOT_COMPILE = "1"
  89. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  90. VLLM_USE_MEGA_AOT_ARTIFACT = "-1"
  91. VLLM_MEMORY_PROFILE_INCLUDE_ATTN = "1"
  92. VLLM_USE_FLASHINFER_SAMPLER = "1"
  93. VLLM_USE_B12X_WO_PROJECTION = "1"
  94. VLLM_USE_B12X_MHC = "0"
  95. VLLM_USE_B12X_FP8_GEMM = "1"
  96. VLLM_USE_B12X_MOE = "1"
  97. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  98. VLLM_USE_V2_MODEL_RUNNER = "1"
  99. B12X_MLA_SM120_UNIFIED = "1"
  100. B12X_MOE_FORCE_A8 = "1"
  101. HF_HUB_OFFLINE = "1"
  102. TRANSFORMERS_OFFLINE = "1"
  103. VLLM_NO_USAGE_STATS = "1"
  104. # Weights from the shared NAS hub; JIT caches persist per node.
  105. # NOTE: extra_mounts stay AFTER args (TOML table headers would swallow the
  106. # args array otherwise).
  107. [[extra_mounts]]
  108. host = "/mnt/nas/ai/huggingface"
  109. container = "/mnt/nas/ai/huggingface"
  110. env = "HF_HOME"
  111. [[extra_mounts]]
  112. host = "~/.cache/dsv4vision-jit/triton"
  113. container = "/root/.triton"
  114. [[extra_mounts]]
  115. host = "~/.cache/dsv4vision-jit/flashinfer"
  116. container = "/root/.cache/flashinfer"
  117. [[extra_mounts]]
  118. host = "~/.cache/dsv4vision-jit/vllm"
  119. container = "/root/.cache/vllm"