recipe.toml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Qwen3.8-27B (RedHatAI NVFP4 + MTP) — 1× DGX Spark / GB10 (sm_121), TP=1.
  2. #
  3. # NVFP4 compressed-tensors quant (22 GB) with a separate MTP draft in
  4. # `model_mtp.safetensors`. Dense 27B, GQA, hybrid DeltaNet+Attention. Text +
  5. # vision. The vLLM-only quant (lm_head FP8) — SGLang can't load it.
  6. #
  7. # Two nearly-identical NVFP4 builds are available:
  8. # RedHatAI/Qwen3.8-27B-NVFP4 (this recipe)
  9. # unsloth/Qwen3.8-27B-NVFP4 (qwen38-27b-nvfp4-unsloth recipe)
  10. # Speed/quality are close; benchmark both in the experiment.
  11. #
  12. # Image: ghcr.io/timothystewart6/vllm-gb10:v0.27.1-gb10.2
  13. # vLLM 0.27.1, torch 2.13+cuda130, FlashInfer built from source,
  14. # instanttensor. Stock vLLM — supports the qwen3_5 arch + MTP.
  15. #
  16. # Model: RedHatAI/Qwen3.8-27B-NVFP4
  17. # https://huggingface.co/RedHatAI/Qwen3.8-27B-NVFP4
  18. #
  19. # PREREQUISITES:
  20. # Weights cached on every node (dgx1 ~/.cache/huggingface → NAS):
  21. # huggingface-cli download RedHatAI/Qwen3.8-27B-NVFP4
  22. #
  23. # REFERENCE:
  24. # https://forums.developer.nvidia.com/t/qwen3-8-27b-on-dual-sparks/380350
  25. # https://forums.developer.nvidia.com/t/qwen3-8-27b-nvfp4-on-a-single-dgx-spark-up-to-1m-context-vllm-mtp-measurements/380244
  26. # https://forums.developer.nvidia.com/t/qwen3-8-27b-mixedint4-autoround-optimized-for-a-single-dgx-spark/380248
  27. engine = "vllm"
  28. name = "Qwen3.8-27B (NVFP4, RedHatAI)"
  29. docker_image = "ghcr.io/timothystewart6/vllm-gb10:v0.27.1-gb10.2"
  30. model = "RedHatAI/Qwen3.8-27B-NVFP4"
  31. required_nodes = 1
  32. tensor_parallel_size = 1
  33. pipeline_parallel_size = 1
  34. distributed_backend = "mp"
  35. shm_size = "32gb"
  36. entrypoint = ["vllm", "serve"]
  37. args = [
  38. # KV cache & memory
  39. "--kv-cache-dtype", "fp8",
  40. "--max-model-len", "262144",
  41. "--max-num-seqs", "6",
  42. "--max-num-batched-tokens", "8192",
  43. "--gpu-memory-utilization", "0.75",
  44. "--served-model-name", "qwen3.8-27b",
  45. # Engine backends (dense GQA — FlashInfer; NVFP4 route via compressed-tensors)
  46. "--attention-backend", "flashinfer",
  47. # Compilation / perf
  48. "--optimization-level", "3",
  49. "--performance-mode", "throughput",
  50. # Chunked prefill + prefix caching
  51. "--enable-chunked-prefill",
  52. "--enable-prefix-caching",
  53. "--enable-flashinfer-autotune",
  54. # MTP speculative decoding (in-checkpoint draft, model_mtp.safetensors)
  55. "--speculative-config", """
  56. '{"method":"mtp","num_speculative_tokens":5}'""",
  57. # Tokenizer / reasoning (Qwen3 family)
  58. "--tool-call-parser", "qwen3_xml",
  59. "--reasoning-parser", "qwen3",
  60. "--enable-auto-tool-choice",
  61. "--generation-config", "auto",
  62. "--default-chat-template-kwargs.preserve_thinking=true",
  63. # Proven generation defaults (thinking mode; Qwen3.8 model-card best
  64. # practices)
  65. "--override-generation-config", """
  66. '{"temperature":1.0,"top_p":0.95,"top_k":20,"min_p":0.0,"presence_penalty":0.0,"repetition_penalty":1.0}'""",
  67. "--trust-remote-code",
  68. ]
  69. [env]
  70. HF_HUB_OFFLINE = "1"
  71. TORCH_CUDA_ARCH_LIST = "12.1a"
  72. CUTE_DSL_ARCH = "sm_121a"
  73. OMP_NUM_THREADS = "4"
  74. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  75. CUDA_VISIBLE_DEVICES = "0"
  76. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  77. CUDA_CACHE_MAXSIZE = "4294967296"