diff --git a/docs/cards/logos/reflection.png b/docs/cards/logos/reflection.png new file mode 100644 index 0000000000..9a690f2b02 Binary files /dev/null and b/docs/cards/logos/reflection.png differ diff --git a/docs/cookbook/autoregressive/Reflection/Beam-1_0.mdx b/docs/cookbook/autoregressive/Reflection/Beam-1_0.mdx new file mode 100644 index 0000000000..274829dbf4 --- /dev/null +++ b/docs/cookbook/autoregressive/Reflection/Beam-1_0.mdx @@ -0,0 +1,61 @@ +--- +title: Beam 1.0 +description: "Deploy Reflection Beam 1.0 with SGLang on B300, GB300, and H200: NVFP4, FP8, and BF16 recipes for low latency and high throughput." +tag: NEW +--- + +## Deployment + + + + + +```bash Command +docker pull lmsysorg/sglang:beam +``` + +For host setup, see [Install SGLang with Docker](/docs/get-started/install#method-3-using-docker). + + + +Select your hardware, strategy, and quantization to generate the Docker command. + +- **Low-Latency** uses TP with the [DFlash2 drafter](https://huggingface.co/reflection/Beam-1.0-501B-A23B-DFlash2) at block size 8. +- **High-Throughput** disables DFlash2. H200 BF16 uses TP8 with an automatic static memory fraction; the other recipes use TP + DPA. Blackwell NVFP4 also enables EP and FlashInfer MegaMoE. + +import { Deployment } from "/src/snippets/_deployment.jsx"; +import { config } from "/src/snippets/configs/reflection/beam-1.0.jsx"; +import { benchmarks } from "/src/snippets/configs/reflection/beam-1.0-benchmarks.jsx"; + + + +Each GSM8K score covers all 1,319 test problems; the benchmark notes identify the evaluation harness. + +NVFP4 requires B300 or GB300. **GB300 BF16 uses two four-GPU nodes**: set the head-node address and node rank in **Env**, then run the command on both nodes with rank 0 on the head and rank 1 on the peer. + +## TPU Support + +Beam 1.0 has day-0 TPU support through SGLang-TorchTPU, a native PyTorch backend for LLM, VLM, and diffusion model inference on TPUs. It combines TPU acceleration with SGLang features such as RadixAttention and HiCache to enable cost-efficient, production-ready serving for agentic workloads. + +TPU recipes for Beam 1.0 and access to SGLang-TorchTPU will be available soon. Sign up through this [Google Form](https://docs.google.com/forms/d/e/1FAIpQLSe2Y8hzyU3KGB2StA-0huulrVsq79A0tSxcBQwjj8vlhLhYuQ/viewform?usp=publish-editor) to receive the latest updates. + +## Usage + +All recipes serve the model as `beam` on port 30000. For GB300 BF16, connect to the head node. + + + +```python Example +from openai import OpenAI + +client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY") +response = client.chat.completions.create( + model="beam", + messages=[{"role": "user", "content": "Explain tensor parallelism briefly."}], +) +message = response.choices[0].message +print("Reasoning:", message.reasoning_content) +print("Answer:", message.content) +``` + + diff --git a/docs/cookbook/autoregressive/intro.mdx b/docs/cookbook/autoregressive/intro.mdx index f15963ca77..096a386135 100644 --- a/docs/cookbook/autoregressive/intro.mdx +++ b/docs/cookbook/autoregressive/intro.mdx @@ -7,6 +7,12 @@ metatags: --- + sel.hw === "h200", + disableReason: "The NVFP4 recipe requires Blackwell; use FP8 or BF16 on H200.", + }, + { id: "fp8", label: "FP8" }, + { id: "bf16", label: "BF16" }, + ], + }, + ], + modelNames: { + nvfp4: "reflection/Beam-1.0-501B-A23B-NVFP4", + fp8: "reflection/Beam-1.0-501B-A23B-FP8", + bf16: "reflection/Beam-1.0-501B-A23B", + }, + placeholders: { + HOST_IP: { target: "command", label: "Bind host", default: "0.0.0.0" }, + PORT: { target: "command", label: "Bind port", default: "30000" }, + NODE0_IP: { target: "command", label: "Head node IP", default: "" }, + NODE_RANK: { target: "command", label: "This node rank", default: "" }, + CURL_HOST: { target: "curl", label: "Server host", default: "localhost" }, + CURL_PORT: { target: "curl", label: "Server port", default: "30000" }, + }, + curl: `curl http://{{CURL_HOST}}:{{CURL_PORT}}/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"beam","messages":[{"role":"user","content":"Hello"}]}'`, + dockerImages: { + b300: "lmsysorg/sglang:beam", + gb300: "lmsysorg/sglang:beam", + h200: "lmsysorg/sglang:beam", + }, + github: { + cookbookModel: "reflection/Beam-1.0-501B-A23B", + }, + cells: [ + { + "match": { + "hw": "b300", + "strategy": "low-latency", + "quant": "nvfp4" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "b300", + "strategy": "low-latency", + "quant": "fp8" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "b300", + "strategy": "low-latency", + "quant": "bf16" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "b300", + "strategy": "high-throughput", + "quant": "nvfp4" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attn-dp-size 4", + "--enable-dp-lm-head", + "--ep-size 4", + "--quantization modelopt_fp4", + "--moe-a2a-backend flashinfer_megamoe", + "--moe-runner-backend flashinfer_megamoe", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "b300", + "strategy": "high-throughput", + "quant": "fp8" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attn-dp-size 4", + "--enable-dp-lm-head", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "b300", + "strategy": "high-throughput", + "quant": "bf16" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attn-dp-size 8", + "--enable-dp-lm-head", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "gb300", + "strategy": "low-latency", + "quant": "nvfp4" + }, + "nnodes": 1, + "verified": true, + "env": [ + "NCCL_MNNVL_ENABLE=1", + "NCCL_CUMEM_ENABLE=1", + "NCCL_NVLS_ENABLE=1" + ], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "gb300", + "strategy": "low-latency", + "quant": "fp8" + }, + "nnodes": 1, + "verified": true, + "env": [ + "NCCL_MNNVL_ENABLE=1", + "NCCL_CUMEM_ENABLE=1", + "NCCL_NVLS_ENABLE=1" + ], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "gb300", + "strategy": "low-latency", + "quant": "bf16" + }, + "nnodes": 2, + "verified": true, + "env": [ + "NCCL_MNNVL_ENABLE=1", + "NCCL_CUMEM_ENABLE=1", + "NCCL_NVLS_ENABLE=1" + ], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "gb300", + "strategy": "high-throughput", + "quant": "nvfp4" + }, + "nnodes": 1, + "verified": true, + "env": [ + "NCCL_MNNVL_ENABLE=1", + "NCCL_CUMEM_ENABLE=1", + "NCCL_NVLS_ENABLE=1" + ], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attn-dp-size 4", + "--enable-dp-lm-head", + "--ep-size 4", + "--quantization modelopt_fp4", + "--moe-a2a-backend flashinfer_megamoe", + "--moe-runner-backend flashinfer_megamoe", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "gb300", + "strategy": "high-throughput", + "quant": "fp8" + }, + "nnodes": 1, + "verified": true, + "env": [ + "NCCL_MNNVL_ENABLE=1", + "NCCL_CUMEM_ENABLE=1", + "NCCL_NVLS_ENABLE=1" + ], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 4", + "--attn-dp-size 4", + "--enable-dp-lm-head", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "gb300", + "strategy": "high-throughput", + "quant": "bf16" + }, + "nnodes": 2, + "verified": true, + "env": [ + "NCCL_MNNVL_ENABLE=1", + "NCCL_CUMEM_ENABLE=1", + "NCCL_NVLS_ENABLE=1" + ], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attn-dp-size 8", + "--enable-dp-lm-head", + "--attention-backend trtllm_mha", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "h200", + "strategy": "low-latency", + "quant": "fp8" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attention-backend fa3", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "h200", + "strategy": "low-latency", + "quant": "bf16" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attention-backend fa3", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.90", + "--enable-unified-memory", + "--speculative-algorithm DFLASH", + "--speculative-draft-model-path reflection/Beam-1.0-501B-A23B-DFlash2", + "--speculative-dflash-block-size 8", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "h200", + "strategy": "high-throughput", + "quant": "fp8" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attn-dp-size 8", + "--enable-dp-lm-head", + "--attention-backend fa3", + "--page-size 64", + "--context-length 1048576", + "--mem-fraction-static 0.85", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + }, + { + "match": { + "hw": "h200", + "strategy": "high-throughput", + "quant": "bf16" + }, + "nnodes": 1, + "verified": true, + "env": [], + "flags": [ + "--model-path {{MODEL_NAME}}", + "--served-model-name beam", + "--tp 8", + "--attention-backend fa3", + "--page-size 64", + "--context-length 1048576", + "--enable-unified-memory", + "--tool-call-parser beam", + "--reasoning-parser beam", + "--host {{HOST_IP}}", + "--port {{PORT}}" + ] + } + ] +};