recipe.toml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # MiMo-V2.6-Flash-RL (Xiaomi, ~310B total / 12B-active MoE, fp8 attention +
  2. # MXFP4 experts, 1M native context, image+video+audio input) on 2x DGX Spark
  3. # with SGLang + DFlash speculative decoding.
  4. #
  5. # SGLang variant of forum thread 383968 (tonyd2wild's proven vLLM 2x recipe:
  6. # 45.6/155.8 t/s, 1.87M-token fp8 KV pool, 300K ctx, code 70.5 t/s). The
  7. # vLLM recipe needed 4 drop-in patches; the biggest (fused fp8 QKV stored
  8. # pre-sharded for TP4) is already handled natively by SGLang's MiMo-V2
  9. # loader (same approach as vllm#57508 — the provenance of the 8x Pro recipe
  10. # working on this image family), so we run the stock a14 image.
  11. #
  12. # Image: docker-images/mimo26-spark (a14) — same build as the 8x Pro recipe:
  13. # SGLang 06008c17 base + 12 patches (MiMo-V2 day-0, DFlash, RoCEnante, FP8
  14. # tiles) + b12x. The FP8 tile tables are tuned for MiMo's per-rank shapes —
  15. # at TP2 the shapes differ from TP8; stock fallbacks apply if a tile misses.
  16. #
  17. # Model: XiaomiMiMo/MiMo-V2.6-Flash-RL @ 5711b268 (166 GB; staged to local
  18. # NVMe on dgx1+dgx2 at ~/hf-local, which both nodes' ~/.cache/huggingface
  19. # symlinks point at — serve WITHOUT --hf-cache). The dflash/ subfolder
  20. # carries the DFlash draft weights — wired as a {{dflash}} path ref.
  21. #
  22. # KV math: 83 GB weights/rank, GMU 0.85 of 128 GB → ~25 GB/rank for the pool.
  23. # Measured at first boot (2026-09-26): pool 340,736 tokens, smoke + tool call
  24. # + needle 132K (needles at 50%/75%) all pass; code C1 71-79 tok/s (vLLM
  25. # reference: 70.5). Needle prefill ~1.5K t/s (vLLM: 937 at 127K).
  26. engine = "sglang"
  27. name = "MiMo-V2.6-Flash-RL (SGLang DFlash, 2x Spark TP2)"
  28. docker_image = "mimo26-spark:a15"
  29. docker_image_dir = "mimo26-spark"
  30. model = "XiaomiMiMo/MiMo-V2.6-Flash-RL"
  31. parent_model = "XiaomiMiMo/MiMo-V2.6-Flash-RL"
  32. port = 30000
  33. required_nodes = 2
  34. tensor_parallel_size = 2
  35. distributed_backend = "mp"
  36. shm_size = "16gb"
  37. entrypoint = ["python3", "-m", "sglang.launch_server"]
  38. args = [
  39. "--trust-remote-code",
  40. "--served-model-name", "mimo-v2.6-flash",
  41. # Attention / MoE backends (a13/a14 profile, same as the 8x Pro recipe)
  42. "--attention-backend", "triton",
  43. "--prefill-attention-backend", "fa4",
  44. "--mm-attention-backend", "triton_attn",
  45. "--enable-multimodal",
  46. "--moe-runner-backend", "marlin",
  47. "--moe-a2a-backend", "none",
  48. # Memory / scheduling (128 GB unified per node)
  49. "--mem-fraction-static", "0.85",
  50. # Model is natively 1M; the measured pool at GMU 0.85 is 340,736 tokens
  51. # (2x TP2: 83 GB weights/rank leaves ~25 GB/rank; 39/48 SWA layers keep it
  52. # large in tokens). 320K fits a single long request with headroom; a
  53. # 524K request is pool-infeasible on 2x (the 8x Pro lane runs 512K).
  54. "--context-length", "327680",
  55. "--max-running-requests", "8",
  56. "--chunked-prefill-size", "8192",
  57. "--page-size", "64",
  58. # MiMo hybrid SWA attention
  59. "--swa-full-tokens-ratio", "0.1",
  60. # Reasoning / tool parsers
  61. "--reasoning-parser", "mimo",
  62. "--tool-call-parser", "mimo",
  63. # DFlash speculative decoding (draft weights ship inside the model repo)
  64. "--speculative-algorithm", "DFLASH",
  65. "--speculative-draft-model-path", "{{dflash}}",
  66. "--speculative-num-draft-tokens", "8",
  67. # CUDA graphs
  68. "--cuda-graph-max-bs-decode", "8",
  69. "--disable-prefill-cuda-graph",
  70. # Unified memory: page cache from weight loading competes with the KV pool
  71. "--weight-loader-drop-cache-after-load",
  72. # Observability
  73. "--enable-metrics",
  74. "--enable-cache-report",
  75. "--watchdog-timeout", "1800",
  76. ]
  77. # DFlash draft weights: a subfolder of the main model repo, resolved per node
  78. # (table header — all bare keys above).
  79. [[extra_mounts]]
  80. repo = "XiaomiMiMo/MiMo-V2.6-Flash-RL"
  81. subfolder = "dflash"
  82. container = "dflash"
  83. # JIT/compile cache (verified against the live container, 2026-09-28): SGLang
  84. # keeps everything under /root/.cache/sglang — triton .so (~35 hash dirs),
  85. # inductor (aotautograd/ev/fxgraph), nv/, flashinfer .cache. Bind it to a
  86. # node-local NVMe dir so boots reuse compiled artifacts instead of redoing
  87. # JIT; keys are content/hash based, so mixing images/lanes on one dir is
  88. # safe (and switching 2x<->4x reuses the other's cache). b12x-roce does not
  89. # materialize on TP<8 — nothing else to mount.
  90. [[extra_mounts]]
  91. host = "~/.cache/mimo26-jit/sglang"
  92. container = "/root/.cache/sglang"
  93. [env]
  94. # NOTE: SGLANG8_ROCE_ALLREDUCE is deliberately NOT set — the RoCEnante
  95. # one-shot all-reduce overlay in the a14 image hard-requires the TP8 Gloo
  96. # exchange group ("SG17 RoCEnante requires the TP8 Gloo exchange group"),
  97. # so on TP2 we fall back to stock NCCL over the DAC link.
  98. # a13/a14 tuning switches
  99. MIMO26_FP8_OPROJ = "1"
  100. MIMO26_FP8_DRAFT = "1"
  101. MIMO26_DFLASH_ADAPTIVE = "1"
  102. # NCCL extras from the reference deployment (HCAs/ifname from [nccl."2nodes-dac"])
  103. NCCL_CUMEM_ENABLE = "0"
  104. NCCL_NVLS_ENABLE = "0"
  105. NCCL_PROTO = "^LL128"
  106. NCCL_BUFFSIZE = "1048576"
  107. NCCL_LL128_BUFFSIZE = "262144"
  108. NCCL_MAX_NCHANNELS = "8"
  109. NCCL_DEBUG = "WARN"