recipe.toml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Qwen3.8-27B (RadixArk NVFP4 + DFlash2 on SGLang) — 1× DGX Spark / GB10,
  2. # TP=1.
  3. #
  4. # SGLang + DFlash2 block-diffusion speculative decoding. Per the community
  5. # (MiaAI / forum 380350), DFlash2 on NVFP4 ties DSpark on code and *beats it*
  6. # on prose/essay and short-chat once counted right. This is the fork/engine
  7. # the forum's high tok/s numbers (52-61 code single, 87 TP=2) came from — NOT
  8. # the stock DSpark path.
  9. #
  10. # Image: lmsysorg/sglang:qwen38-27b-dflash2-minoverlay — a locally-built overlay
  11. # of the 5 DFlash2 modules onto the cookbook qwen38-27b image. The cookbook
  12. # tag itself predates DFlash2 (upstream merged commit c14312a66 on
  13. # 2026-08-19, after every published tag), so the modules are overlaid.
  14. # The minoverlay modules already bake in the quantized-head selector fix
  15. # (should_apply_lm_head_quant_method) so DFLASH runs the NVFP4 lm_head in
  16. # place — no dense dequant.
  17. #
  18. # Draft: z-lab/Qwen3.8-27B-DFlash2 @ 50307d4 (block-diffusion drafter, 3.6 GB).
  19. #
  20. # Model: RadixArk/Qwen3.8-27B-NVFP4 (modelopt)
  21. #
  22. # PREREQUISITES (on the node):
  23. # hfrs download RadixArk/Qwen3.8-27B-NVFP4
  24. # hfrs download z-lab/Qwen3.8-27B-DFlash2
  25. # docker build the minoverlay image (or use the recipe's docker_image as-is)
  26. #
  27. # REFERENCE:
  28. # https://github.com/MiaAI-Lab/Qwen3.8-27B-SGLang-DGX-Spark (start-dflash.sh)
  29. # https://forums.developer.nvidia.com/t/qwen3-8-27b-on-dual-sparks/380350
  30. engine = "sglang"
  31. name = "Qwen3.8-27B (RadixArk NVFP4, SGLang DFlash2)"
  32. docker_image = "lmsysorg/sglang:qwen38-27b-dflash2-minoverlay"
  33. model = "RadixArk/Qwen3.8-27B-NVFP4"
  34. required_nodes = 1
  35. tensor_parallel_size = 1
  36. pipeline_parallel_size = 1
  37. distributed_backend = "mp"
  38. shm_size = "32gb"
  39. entrypoint = ["python3", "-m", "sglang.launch_server"]
  40. args = [
  41. # Memory — NVFP4 needs 0.90 (0.95 hard-rebooted the box at graph capture)
  42. "--mem-fraction-static", "0.90",
  43. "--max-running-requests", "10",
  44. "--max-mamba-cache-size", "30",
  45. # Attention / KV
  46. "--attention-backend", "flashinfer",
  47. "--kv-cache-dtype", "fp8_e4m3",
  48. # Mamba GDN hybrid — DFLASH requires extra_buffer (not extra_buffer_lazy)
  49. "--mamba-ssm-dtype", "bfloat16",
  50. "--mamba-full-memory-ratio", "4.21",
  51. "--mamba-radix-cache-strategy", "extra_buffer",
  52. # Chunked prefill
  53. "--chunked-prefill-size", "8192",
  54. # DFlash2 block-diffusion speculative decoding
  55. "--speculative-algorithm", "DFLASH",
  56. "--speculative-draft-model-path", "z-lab/Qwen3.8-27B-DFlash2",
  57. "--speculative-draft-model-revision", "50307d4c4cde6860d4eee73e2547cd786fe8e8a4",
  58. "--speculative-num-draft-tokens", "8",
  59. # Tokenizer / reasoning / tool calling (Qwen3 family)
  60. "--reasoning-parser", "qwen3",
  61. "--tool-call-parser", "qwen3_coder",
  62. # Observability
  63. "--enable-metrics",
  64. "--enable-cache-report",
  65. ]
  66. [env]
  67. HF_HUB_OFFLINE = "1"
  68. SGLANG_OPT_MAMBA_SKIP_DECODE_LOCK = "1"
  69. TORCH_CUDA_ARCH_LIST = "12.1a"
  70. CUTE_DSL_ARCH = "sm_121a"
  71. OMP_NUM_THREADS = "4"