recipe.toml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Qwen3.8-27B (unsloth NVFP4 + DSpark) — 1× DGX Spark / GB10 (sm_121), TP=1.
  2. #
  3. # NVFP4 compressed-tensors quant (22 GB) with a dedicated DSpark draft model
  4. # (RadixArk, 2.6 GB, block_size 7) for speculative decoding. Dense 27B, GQA,
  5. # hybrid DeltaNet+Attention. Text + vision. Unsloth Dynamic V3.0 (preview)
  6. # quant — SOTA quality for NVFP4. vLLM-only (lm_head FP8).
  7. #
  8. # DSpark vs the in-checkpoint MTP head (qwen38-27b-nvfp4-unsloth recipe): the
  9. # draft is 3× cheaper per guess and edits/rewrites much faster, at the cost of
  10. # a 2.6 GB draft + a local arch-patched copy. Benchmark both.
  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 qwen3_5 arch + method "dspark".
  15. #
  16. # Model: unsloth/Qwen3.8-27B-NVFP4
  17. # https://huggingface.co/unsloth/Qwen3.8-27B-NVFP4
  18. #
  19. # PREREQUISITES:
  20. # Weights cached on every node (dgx1 ~/.cache/huggingface → NAS):
  21. # huggingface-cli download unsloth/Qwen3.8-27B-NVFP4
  22. # hfrs download RadixArk/Qwen3.8-27B-DSpark (then cp -aL + patch arch → /home/kilork/dspark-draft)
  23. #
  24. # REFERENCE:
  25. # https://blog.kubesimplify.com/qwen3-8-27b-on-dgx-spark (DSpark section)
  26. engine = "vllm"
  27. name = "Qwen3.8-27B (NVFP4 unsloth + DSpark)"
  28. docker_image = "ghcr.io/timothystewart6/vllm-gb10:v0.27.1-gb10.2"
  29. model = "unsloth/Qwen3.8-27B-NVFP4"
  30. required_nodes = 1
  31. tensor_parallel_size = 1
  32. pipeline_parallel_size = 1
  33. distributed_backend = "mp"
  34. shm_size = "32gb"
  35. entrypoint = ["vllm", "serve"]
  36. args = [
  37. # KV cache & memory
  38. "--kv-cache-dtype", "fp8",
  39. "--max-model-len", "262144",
  40. "--max-num-seqs", "6",
  41. "--max-num-batched-tokens", "16384",
  42. "--gpu-memory-utilization", "0.75",
  43. "--served-model-name", "qwen3.8-27b",
  44. # Engine backends (dense GQA — FlashInfer; NVFP4 route via compressed-tensors)
  45. "--attention-backend", "flashinfer",
  46. # Compilation / perf
  47. "--optimization-level", "3",
  48. "--performance-mode", "throughput",
  49. # Chunked prefill + prefix caching
  50. "--enable-chunked-prefill",
  51. "--enable-prefix-caching",
  52. "--enable-flashinfer-autotune",
  53. # DSpark speculative decoding — dedicated draft model (arch-patched local
  54. # copy of RadixArk/Qwen3.8-27B-DSpark, re-labelled `Qwen3DSparkModel` so
  55. # vLLM routes it to qwen3_dspark not the DeepSeek-V4 path). block_size 7.
  56. # batched-tokens raised to 16384 to fit the draft token slots (warn:
  57. # max_num_scheduled_tokens=8156 at 8192).
  58. "--speculative-config", """
  59. '{"method":"dspark","model":"/dspark-draft","num_speculative_tokens":7}'""",
  60. # Tokenizer / reasoning (Qwen3 family)
  61. "--tool-call-parser", "qwen3_xml",
  62. "--reasoning-parser", "qwen3",
  63. "--enable-auto-tool-choice",
  64. "--generation-config", "auto",
  65. "--default-chat-template-kwargs.preserve_thinking=true",
  66. # Proven generation defaults (thinking mode; Qwen3.8 model-card best
  67. # practices)
  68. "--override-generation-config", """
  69. '{"temperature":1.0,"top_p":0.95,"top_k":20,"min_p":0.0,"presence_penalty":0.0,"repetition_penalty":1.0}'""",
  70. "--trust-remote-code",
  71. ]
  72. # DSpark draft model — arch-patched local copy of RadixArk/Qwen3.8-27B-DSpark.
  73. [[extra_mounts]]
  74. host = "/home/kilork/dspark-draft"
  75. container = "/dspark-draft"
  76. [env]
  77. HF_HUB_OFFLINE = "1"
  78. TORCH_CUDA_ARCH_LIST = "12.1a"
  79. CUTE_DSL_ARCH = "sm_121a"
  80. OMP_NUM_THREADS = "4"
  81. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  82. CUDA_VISIBLE_DEVICES = "0"
  83. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  84. CUDA_CACHE_MAXSIZE = "4294967296"