recipe.toml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # GLM-5.2 QuantTrio Int4-Int8Mix — 4× DGX Spark / GB10 (sm_121), TP=4.
  2. #
  3. # Image: sparkrun-vllm-ds4-gb10:glm52
  4. # Built from docker-images/glm52-int4-int8/Dockerfile, which overlays
  5. # sparkrun-vllm-ds4-gb10:fixed with an entrypoint wrapper that unsets
  6. # the baked VLLM_PREFIX_CACHE_RETENTION_INTERVAL before calling the
  7. # original /opt/nvidia/nvidia_entrypoint.sh.
  8. #
  9. # Model: QuantTrio/GLM-5.2-Int4-Int8Mix (mixed Int4/Int8, 10% expert-pruned)
  10. # → https://huggingface.co/QuantTrio/GLM-5.2-Int4-Int8Mix
  11. # Includes in-checkpoint MTP draft model.
  12. #
  13. # PREREQUISITES:
  14. # - Weights cached on every node:
  15. # huggingface-cli download QuantTrio/GLM-5.2-Int4-Int8Mix
  16. #
  17. # REFERENCE:
  18. # https://forums.developer.nvidia.com/t/glm-5-2-int4-int8-on-8x-gb10-1200-t-s-prefill-33-54-t-s-avg-decode-generic-coding-structured/376831
  19. # https://github.com/ciprianveg/gb10-glm-5.2
  20. engine = "vllm"
  21. name = "GLM-5.2 Int4-Int8Mix (vLLM, DS4 image)"
  22. docker_image = "sparkrun-vllm-ds4-gb10:glm52"
  23. model = "QuantTrio/GLM-5.2-Int4-Int8Mix"
  24. port = 8210
  25. required_nodes = 4
  26. tensor_parallel_size = 4
  27. pipeline_parallel_size = 1
  28. distributed_backend = "mp"
  29. shm_size = "64gb"
  30. docker_image_dir = "glm52-int4-int8"
  31. entrypoint = ["vllm", "serve"]
  32. args = [
  33. # KV cache & memory
  34. "--kv-cache-dtype", "fp8",
  35. "--max-model-len", "150000",
  36. "--max-num-seqs", "1",
  37. "--max-num-batched-tokens", "4096",
  38. "--gpu-memory-utilization", "0.91",
  39. # Engine backends
  40. "--attention-backend", "B12X_MLA_SPARSE",
  41. "--moe-backend", "b12x",
  42. # Compilation
  43. "--compilation-config", """
  44. '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}'""",
  45. # Chunked prefill + prefix caching
  46. "--enable-chunked-prefill",
  47. "--enable-prefix-caching",
  48. "--enable-flashinfer-autotune",
  49. # MTP speculative decoding (in-checkpoint draft model)
  50. # "--speculative-config", """
  51. #'{"method":"mtp","num_speculative_tokens":4,"moe_backend":"b12x","draft_sample_method":"probabilistic"}'""",
  52. # Tokenizer / reasoning (GLM-5.2 family)
  53. "--tool-call-parser", "glm47",
  54. "--reasoning-parser", "glm45",
  55. "--enable-auto-tool-choice",
  56. "--trust-remote-code",
  57. "--served-model-name", "glm52",
  58. ]
  59. [env]
  60. # b12x suite (image requires this)
  61. VLLM_USE_B12X_MOE = "1"
  62. VLLM_USE_B12X_MHC = "1"
  63. VLLM_USE_B12X_WO_PROJECTION = "1"
  64. VLLM_USE_B12X_FP8_GEMM = "1"
  65. VLLM_USE_B12X_SPARSE_INDEXER = "1"
  66. VLLM_USE_V2_MODEL_RUNNER = "1"
  67. VLLM_USE_FLASHINFER_SAMPLER = "1"
  68. VLLM_USE_AOT_COMPILE = "1"
  69. VLLM_USE_MEGA_AOT_ARTIFACT = "0"
  70. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  71. VLLM_MEMORY_PROFILE_INCLUDE_ATTN = "1"
  72. B12X_MLA_SM120_UNIFIED = "1"
  73. B12X_DENSE_SPLITK_TURBO = "1"
  74. B12X_W4A16_TC_DECODE = "1"
  75. B12X_MHC_MAX_TOKENS = "16384"
  76. # GLM-5.2 support flags
  77. VLLM_ALLOW_LONG_MAX_MODEL_LEN = "1"
  78. VLLM_SPARSE_INDEXER_MAX_LOGITS_MB = "256"
  79. # Timeout safety net for cold boot (cudagraph + JIT)
  80. VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS = "1800"
  81. # Offline mode — weights must be cached on each node
  82. HF_HUB_OFFLINE = "1"
  83. # Architecture
  84. TORCH_CUDA_ARCH_LIST = "12.1a"
  85. CUTE_DSL_ARCH = "sm_121a"
  86. OMP_NUM_THREADS = "4"
  87. # GPU memory management
  88. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  89. # NCCL overrides
  90. NCCL_CROSS_NIC = "1"
  91. NCCL_CUMEM_ENABLE = "0"
  92. NCCL_IGNORE_CPU_AFFINITY = "1"
  93. NCCL_DEBUG = "WARN"
  94. # PCIe allreduce not needed on GB10 single-NIC
  95. VLLM_ENABLE_PCIE_ALLREDUCE = "0"
  96. VLLM_PCIE_ALLREDUCE_BACKEND = "cpp"
  97. # GPU device isolation
  98. CUDA_VISIBLE_DEVICES = "0"
  99. CUDA_DEVICE_ORDER = "PCI_BUS_ID"
  100. CUDA_CACHE_MAXSIZE = "4294967296"