recipe.toml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Qwen3.8-Flash-Next (NVFP4, SGLang) — 2× DGX Spark / GB10 (sm_121), TP=2.
  2. #
  3. # Qwen4-architecture preview: 176B total (6B active) GDN + QSA hybrid MoE,
  4. # 512 routed experts (top-10) + shared expert, 51B n-gram "engram" table
  5. # (PLE, offloaded to host RAM), in-checkpoint MTP draft. Text + vision.
  6. # Native 262144 ctx (YaRN to 1M). Always-thinking.
  7. #
  8. # QUANT: NVFP4 (RadixArk), NOT the official FP8. FP8 cannot serve on 2×
  9. # Spark: its MoE weight_block_size=[128,128] + moe_intermediate_size=640
  10. # violates SGLang's (intermediate/tp) % block_n == 0 at tp=2 (sgl-project/
  11. # sglang #21810) — only tp in {1,5} align, and tp=1 can't hold 125B. NVFP4
  12. # is the community-verified 2× Spark path. SGLang's own cookbook lists the
  13. # FP8 quant's supported HW as H200/B200/B300/GB300 — not GB10.
  14. #
  15. # Image: qwen38-flashnext-nvfp4:local — built by the launcher from
  16. # docker-images/qwen38-flashnext-nvfp4/ (base lmsysorg/sglang:qwen38flashnext
  17. # + a SM121 QSA decode kernel fix). The stock day-0 image cannot serve
  18. # qwen4_exp on GB10: QSA's packed varlen decode resolves to flash-attn-4
  19. # CuTe-DSL kernels that fail MLIR compilation on SM121; the overlay swaps in
  20. # a CUDA-graph-safe Triton fallback. Provenance/validation:
  21. # https://github.com/MiaAI-Lab/Qwen3.8-Flash-Next-Dual-DGX-Sparks
  22. #
  23. # Model: RadixArk/Qwen3.8-Flash-Next-NVFP4 (~135 GB)
  24. # https://huggingface.co/RadixArk/Qwen3.8-Flash-Next-NVFP4
  25. #
  26. # REFERENCE:
  27. # https://forums.developer.nvidia.com/t/qwen3-8-flash-next/381228
  28. engine = "sglang"
  29. name = "Qwen3.8-Flash-Next NVFP4 (SGLang, 2× Spark)"
  30. docker_image = "qwen38-flashnext-nvfp4:local"
  31. docker_image_dir = "qwen38-flashnext-nvfp4"
  32. model = "RadixArk/Qwen3.8-Flash-Next-NVFP4"
  33. required_nodes = 2
  34. tensor_parallel_size = 2
  35. pipeline_parallel_size = 1
  36. distributed_backend = "mp"
  37. shm_size = "32gb"
  38. entrypoint = ["python3", "-m", "sglang.launch_server"]
  39. args = [
  40. # Stable served name — quant-agnostic, shared with qwen38-flash-next-fp8 so
  41. # swapping quants never changes what agents/clients pin against.
  42. "--served-model-name", "qwen3.8-flash-next",
  43. "--trust-remote-code",
  44. # NVFP4 (ModelOpt) weights
  45. "--quantization", "modelopt_fp4",
  46. # flashinfer is required on SM120/SM121 (trtllm_mha is SM100-only)
  47. "--attention-backend", "flashinfer",
  48. # page 64 is pinned by SGLang for compressed QSA (full//ratio addressing)
  49. "--page-size", "64",
  50. # GDN (DeltaNet) hybrid state pool
  51. "--mamba-ssm-dtype", "bfloat16",
  52. "--mamba-radix-cache-strategy", "extra_buffer",
  53. "--mamba-track-interval", "64",
  54. # Memory — 0.70 leaves DRAM for the ~26 GB/rank pinned PLE (engram) table
  55. "--mem-fraction-static", "0.70",
  56. "--chunked-prefill-size", "4096",
  57. "--max-running-requests", "16",
  58. "--context-length", "262144",
  59. # NEXTN speculative decoding — draft = the in-checkpoint MTP layer
  60. "--speculative-algorithm", "NEXTN",
  61. "--speculative-num-steps", "3",
  62. "--speculative-eagle-topk", "1",
  63. "--speculative-num-draft-tokens", "4",
  64. # Parsers (auto = resolve from the checkpoint chat template)
  65. "--reasoning-parser", "auto",
  66. "--tool-call-parser", "auto",
  67. "--allow-auto-truncate",
  68. # Observability
  69. "--enable-metrics",
  70. "--enable-cache-report",
  71. # SM121 house rule: prefill CUDA graphs unreliable on GB10
  72. "--disable-prefill-cuda-graph",
  73. # Pin decode-graph batch list (default list OOMs the graph pool on GB10)
  74. "--cuda-graph-bs-decode", "1", "2", "3", "4", "5", "6", "7", "8", "10", "12", "14", "16",
  75. ]
  76. [env]
  77. # Offline — weights must be cached on each node
  78. HF_HUB_OFFLINE = "1"
  79. TRANSFORMERS_OFFLINE = "1"
  80. # Architecture (aarch64 / sm_121a DGX Spark)
  81. TORCH_CUDA_ARCH_LIST = "12.1a"
  82. FLASHINFER_CUDA_ARCH_LIST = "12.1a"
  83. CUTE_DSL_ARCH = "sm_121a"
  84. OMP_NUM_THREADS = "4"