recipe.toml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # GLM-5.3-Flash EXL3 4bpw + DFlash2 on the Entrpi community image — 2× DGX
  2. # Spark, TP=2.
  3. #
  4. # NOT our lab stack: a fully different serving lane — 4-bit EXL3/TR3 fused
  5. # trellis MoE kernels (fork: Entrpi/vllm-glm-5.3-flash-spark, branch
  6. # glm53-on-infernal) with DFlash2 block-diffusion speculative decoding,
  7. # CUDA graphs (their validated default), 524k context over a packed-fp8
  8. # KV pool (~1.43M tokens). Upstream reference + numbers:
  9. # https://github.com/Entrpi/glm-5.3-flash-exl3-2x-spark
  10. # Image provenance: docs/BUILD.md in that repo. Image manifest digest
  11. # (arm64-only, checked via `docker manifest inspect`):
  12. # ghcr.io/entrpi/glm-5.3-flash-exl3-2x-spark:v1-dflash2
  13. # sha256:284142c5833cbfd540ad42bb8f32cb340451db05a3b84029eaebae54579e9135
  14. #
  15. # Model: brandonmusic/GLM-5.3-Flash-tr3-4bpw (EXL3/TR3 uniform-K4, ~176 GiB,
  16. # KLD parity with official FP8). Drafter: incoai/GLM-5.3-Flash-DFlash2
  17. # (CC BY-NC-ND 4.0 — non-commercial; keep to research/personal use).
  18. # DFlash2 drafter already cached site-wide; the EXL3 weights must be
  19. # downloaded once into the NAS hub (see PREREQUISITES).
  20. #
  21. # Flag provenance: parsed verbatim from the upstream
  22. # scripts/launch-glm53-vllm-tp2.sh defaults (validated production config).
  23. # DEVIATIONS from their kit — all forced by our launcher/fabric:
  24. # * no NCCL/*, master-addr/port, drop-caches ritual: the launcher handles
  25. # rendezvous + the [nccl.ds4] table + drop_caches (same ritual upstream).
  26. # * no --skip-mm-profiling... included; port = launcher 30000 convention
  27. # (their kit serves 8000; adjust --port if you must expose 8000).
  28. # * their hotfix-overlay hooks (glm53-hotfix etc.) are not used — this is
  29. # the shipped image as-is; re-add if tracking their issue tracker.
  30. # * weights stream from the NAS hub via HF_HOME (their kit prefers local
  31. # NVMe per box; NFS mode exists upstream too). First load is slow;
  32. # JIT caches persist per node (see extra_mounts).
  33. #
  34. # Boot markers (engine log): "Model loading took ~88 GiB"-scale BEFORE any
  35. # EXL3 trellis lines → "GPU KV cache size" ≈ 1.4M tokens (fp8_e4m3 @524k)
  36. # → "Application startup complete". A "Setting attention block size to
  37. # 4608" line is expected (fp8 KV auto-bump, documented upstream).
  38. #
  39. # PREREQUISITES: weights cached on the NAS hub once:
  40. # docker run --rm --entrypoint python3 -v /mnt/nas/ai/huggingface:/root/.cache/huggingface \
  41. # glm53-flash-nvfp4-lab:local -c "from huggingface_hub import snapshot_download; \
  42. # snapshot_download('brandonmusic/GLM-5.3-Flash-tr3-4bpw')"
  43. # (DFlash2: already in the NAS hub.)
  44. engine = "vllm"
  45. name = "GLM-5.3-Flash EXL3-4bpw + DFlash2 (Entrpi image, 2x Spark, TP=2)"
  46. docker_image = "ghcr.io/entrpi/glm-5.3-flash-exl3-2x-spark:v1-dflash2"
  47. model = "brandonmusic/GLM-5.3-Flash-tr3-4bpw"
  48. required_nodes = 2
  49. tensor_parallel_size = 2
  50. pipeline_parallel_size = 1
  51. distributed_backend = "mp"
  52. shm_size = "32gb"
  53. args = [
  54. # Stable served name — quant-agnostic (shared across glm53 quants)
  55. "--served-model-name", "glm53",
  56. "--trust-remote-code",
  57. # EXL3 fused trellis MoE (fork-baked kernels)
  58. "--quantization", "exl3",
  59. "--distributed-executor-backend", "mp",
  60. # Their validated defaults; 0.88+ risks unified-memory swap on GB10
  61. "--gpu-memory-utilization", "0.85",
  62. "--max-model-len", "524288",
  63. "--max-num-seqs", "4",
  64. # vLLM auto-bumps to 4608 under fp8 KV (KDA state page parity)
  65. "--block-size", "2304",
  66. "--mm-processor-cache-gb", "0.5",
  67. "--max-num-batched-tokens", "8192",
  68. "--kv-cache-dtype", "fp8_e4m3",
  69. # 1,435,070-token pool at 524k fp8; do NOT raise (2.26 GiB floor @13.4e9)
  70. "--kv-cache-memory", "12400000000",
  71. # Drafter by hub id (resolved from the mounted NAS HF_HOME like the
  72. # target model; 7 = trained block size 8 minus the bonus token)
  73. "--speculative-config", """
  74. '{"method":"dflash","model":"incoai/GLM-5.3-Flash-DFlash2","num_speculative_tokens":7}'""",
  75. # required at 524288 on GB10 unified memory (upstream default SKIP_MM_PROFILING=1)
  76. "--skip-mm-profiling",
  77. "--tool-call-parser", "glm47",
  78. "--enable-auto-tool-choice",
  79. "--reasoning-parser", "glm45",
  80. "--default-chat-template-kwargs", """
  81. '{"enable_thinking": false}'""",
  82. ]
  83. [env]
  84. HF_HUB_OFFLINE = "1"
  85. TRANSFORMERS_OFFLINE = "1"
  86. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  87. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  88. TORCH_CUDA_ARCH_LIST = "12.1a"
  89. FLASHINFER_CUDA_ARCH_LIST = "12.1a"
  90. FLASHINFER_DISABLE_VERSION_CHECK = "1"
  91. VLLM_NO_USAGE_STATS = "1"
  92. # Weights + drafter both resolve out of the site NAS hub (offline mode).
  93. # NOTE: [[extra_mounts]] must stay AFTER args — a table header would
  94. # swallow the args array into it (TOML).
  95. [[extra_mounts]]
  96. host = "/mnt/nas/ai/huggingface"
  97. container = "/mnt/nas/ai/huggingface"
  98. env = "HF_HOME"
  99. # Long-lived JIT caches (upstream mounts $CACHE_HOST_PATH per layer);
  100. # hash-keyed so stale entries are inert, and first-boot compiles persist.
  101. [[extra_mounts]]
  102. host = "~/.cache/glm53-exl3-jit/triton"
  103. container = "/root/.triton"
  104. [[extra_mounts]]
  105. host = "~/.cache/glm53-exl3-jit/flashinfer"
  106. container = "/root/.cache/flashinfer"
  107. [[extra_mounts]]
  108. host = "~/.cache/glm53-exl3-jit/vllm"
  109. container = "/root/.cache/vllm"