sglang 0.4.6.post5__py3-none-any.whl → 0.4.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sglang/bench_offline_throughput.py +10 -4
- sglang/bench_one_batch_server.py +67 -11
- sglang/bench_serving.py +85 -74
- sglang/lang/backend/runtime_endpoint.py +24 -1
- sglang/profiler.py +167 -0
- sglang/srt/_custom_ops.py +34 -0
- sglang/srt/configs/internvl.py +8 -12
- sglang/srt/configs/model_config.py +27 -1
- sglang/srt/constrained/base_grammar_backend.py +5 -2
- sglang/srt/constrained/llguidance_backend.py +9 -8
- sglang/srt/constrained/outlines_backend.py +5 -4
- sglang/srt/constrained/xgrammar_backend.py +18 -18
- sglang/srt/conversation.py +46 -8
- sglang/srt/custom_op.py +38 -3
- sglang/srt/debug_utils.py +74 -0
- sglang/srt/disaggregation/common/__init__.py +1 -0
- sglang/srt/disaggregation/common/conn.py +407 -0
- sglang/srt/disaggregation/decode.py +67 -3
- sglang/srt/disaggregation/fake/conn.py +1 -0
- sglang/srt/disaggregation/kv_events.py +60 -5
- sglang/srt/disaggregation/launch_lb.py +140 -0
- sglang/srt/disaggregation/mini_lb.py +29 -48
- sglang/srt/disaggregation/mooncake/conn.py +432 -140
- sglang/srt/disaggregation/mooncake/transfer_engine.py +32 -16
- sglang/srt/disaggregation/nixl/conn.py +124 -432
- sglang/srt/disaggregation/prefill.py +2 -0
- sglang/srt/disaggregation/utils.py +38 -1
- sglang/srt/distributed/device_communicators/pymscclpp.py +315 -0
- sglang/srt/distributed/parallel_state.py +52 -5
- sglang/srt/entrypoints/EngineBase.py +6 -0
- sglang/srt/entrypoints/engine.py +102 -5
- sglang/srt/entrypoints/http_server.py +15 -2
- sglang/srt/function_call/base_format_detector.py +138 -86
- sglang/srt/function_call/deepseekv3_detector.py +54 -6
- sglang/srt/function_call/ebnf_composer.py +33 -19
- sglang/srt/function_call/function_call_parser.py +27 -0
- sglang/srt/function_call/llama32_detector.py +33 -14
- sglang/srt/function_call/mistral_detector.py +73 -26
- sglang/srt/function_call/pythonic_detector.py +86 -20
- sglang/srt/function_call/qwen25_detector.py +64 -10
- sglang/srt/function_call/utils.py +17 -0
- sglang/srt/hf_transformers_utils.py +4 -0
- sglang/srt/layers/attention/aiter_backend.py +488 -123
- sglang/srt/layers/attention/base_attn_backend.py +4 -0
- sglang/srt/layers/attention/cutlass_mla_backend.py +2 -19
- sglang/srt/layers/attention/flashattention_backend.py +103 -18
- sglang/srt/layers/attention/flashinfer_backend.py +45 -1
- sglang/srt/layers/attention/flashinfer_mla_backend.py +37 -1
- sglang/srt/layers/attention/intel_amx_backend.py +128 -0
- sglang/srt/layers/attention/tbo_backend.py +232 -0
- sglang/srt/layers/attention/torch_native_backend.py +3 -0
- sglang/srt/layers/attention/triton_backend.py +244 -5
- sglang/srt/layers/attention/triton_ops/extend_attention.py +12 -4
- sglang/srt/layers/communicator.py +260 -194
- sglang/srt/layers/dp_attention.py +6 -5
- sglang/srt/layers/layernorm.py +30 -19
- sglang/srt/layers/moe/cutlass_moe.py +170 -7
- sglang/srt/layers/moe/cutlass_moe_params.py +169 -0
- sglang/srt/layers/moe/ep_moe/kernels.py +27 -6
- sglang/srt/layers/moe/ep_moe/layer.py +94 -40
- sglang/srt/layers/moe/ep_moe/token_dispatcher.py +13 -8
- sglang/srt/layers/moe/fused_moe_native.py +4 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_3_1/E=257,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_3_1/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/fused_moe.py +220 -25
- sglang/srt/layers/moe/fused_moe_triton/layer.py +34 -4
- sglang/srt/layers/moe/topk.py +44 -18
- sglang/srt/layers/multimodal.py +3 -3
- sglang/srt/layers/quantization/__init__.py +3 -2
- sglang/srt/layers/quantization/blockwise_int8.py +3 -0
- sglang/srt/layers/quantization/compressed_tensors/compressed_tensors_moe.py +5 -0
- sglang/srt/layers/quantization/deep_gemm.py +55 -56
- sglang/srt/layers/quantization/fp8.py +28 -23
- sglang/srt/layers/quantization/fp8_kernel.py +118 -66
- sglang/srt/layers/quantization/fp8_utils.py +165 -49
- sglang/srt/layers/quantization/modelopt_quant.py +334 -7
- sglang/srt/layers/quantization/moe_wna16.py +3 -0
- sglang/srt/layers/quantization/w8a8_fp8.py +3 -0
- sglang/srt/layers/quantization/w8a8_int8.py +3 -0
- sglang/srt/layers/rotary_embedding.py +6 -12
- sglang/srt/layers/sampler.py +80 -79
- sglang/srt/layers/utils.py +6 -0
- sglang/srt/lora/layers.py +12 -15
- sglang/srt/lora/lora.py +49 -5
- sglang/srt/lora/lora_manager.py +19 -5
- sglang/srt/lora/mem_pool.py +24 -16
- sglang/srt/lora/utils.py +17 -13
- sglang/srt/managers/data_parallel_controller.py +13 -5
- sglang/srt/managers/eplb_algorithms/__init__.py +63 -0
- sglang/srt/managers/eplb_algorithms/deepseek.py +223 -0
- sglang/srt/managers/{deepseek_eplb.py → eplb_algorithms/deepseek_vec.py} +5 -7
- sglang/srt/managers/eplb_manager.py +55 -14
- sglang/srt/managers/expert_distribution.py +220 -46
- sglang/srt/managers/expert_location.py +110 -56
- sglang/srt/managers/expert_location_dispatch.py +23 -6
- sglang/srt/managers/io_struct.py +15 -4
- sglang/srt/managers/mm_utils.py +88 -38
- sglang/srt/managers/multimodal_processors/base_processor.py +188 -16
- sglang/srt/managers/multimodal_processors/gemma3.py +4 -31
- sglang/srt/managers/multimodal_processors/internvl.py +4 -0
- sglang/srt/managers/multimodal_processors/kimi_vl.py +15 -34
- sglang/srt/managers/multimodal_processors/minicpm.py +2 -1
- sglang/srt/managers/multimodal_processors/phi4mm.py +87 -0
- sglang/srt/managers/multimodal_processors/qwen_vl.py +22 -64
- sglang/srt/managers/schedule_batch.py +140 -38
- sglang/srt/managers/scheduler.py +305 -112
- sglang/srt/managers/tokenizer_manager.py +134 -17
- sglang/srt/managers/utils.py +0 -4
- sglang/srt/metrics/collector.py +9 -0
- sglang/srt/model_executor/cuda_graph_runner.py +72 -61
- sglang/srt/model_executor/expert_location_updater.py +157 -22
- sglang/srt/model_executor/forward_batch_info.py +38 -17
- sglang/srt/model_executor/model_runner.py +96 -56
- sglang/srt/model_loader/utils.py +67 -1
- sglang/srt/models/deepseek_nextn.py +1 -1
- sglang/srt/models/deepseek_v2.py +609 -234
- sglang/srt/models/gemma3_causal.py +7 -0
- sglang/srt/models/gemma3_mm.py +19 -14
- sglang/srt/models/idefics2.py +342 -0
- sglang/srt/models/kimi_vl.py +4 -4
- sglang/srt/models/llama.py +1 -1
- sglang/srt/models/minicpmo.py +2 -5
- sglang/srt/models/minicpmv.py +3 -295
- sglang/srt/models/phi4mm.py +512 -0
- sglang/srt/models/qwen2.py +38 -9
- sglang/srt/models/qwen2_5_vl.py +3 -9
- sglang/srt/models/qwen2_eagle.py +4 -1
- sglang/srt/models/qwen2_moe.py +58 -191
- sglang/srt/models/qwen2_vl.py +3 -9
- sglang/srt/models/qwen3.py +41 -10
- sglang/srt/models/qwen3_moe.py +230 -191
- sglang/srt/models/registry.py +9 -1
- sglang/srt/models/transformers.py +291 -0
- sglang/srt/openai_api/adapter.py +86 -24
- sglang/srt/openai_api/protocol.py +31 -2
- sglang/srt/openai_api/utils.py +172 -0
- sglang/srt/operations.py +37 -2
- sglang/srt/operations_strategy.py +200 -24
- sglang/srt/sampling/sampling_batch_info.py +13 -1
- sglang/srt/sampling/sampling_params.py +2 -1
- sglang/srt/server_args.py +114 -27
- sglang/srt/speculative/build_eagle_tree.py +8 -8
- sglang/srt/speculative/eagle_draft_cuda_graph_runner.py +8 -11
- sglang/srt/speculative/eagle_draft_extend_cuda_graph_runner.py +253 -0
- sglang/srt/speculative/eagle_utils.py +51 -91
- sglang/srt/speculative/eagle_worker.py +101 -21
- sglang/srt/two_batch_overlap.py +635 -0
- sglang/srt/utils.py +129 -7
- sglang/test/runners.py +16 -7
- sglang/test/send_one.py +4 -0
- sglang/test/test_cutlass_moe.py +3 -3
- sglang/test/test_fp4_moe.py +248 -0
- sglang/test/test_utils.py +79 -6
- sglang/version.py +1 -1
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/METADATA +14 -11
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/RECORD +318 -291
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/WHEEL +1 -1
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=144,N=512,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=144,N=512,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1024,device_name=NVIDIA_H200.json → triton_3_1_0/E=16,N=1024,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=20,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=20,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=24,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=24,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H20,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H20,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_L20,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_L20,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_L40S,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_L40S,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=64,N=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=64,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_L40S.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_L40S.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=96,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=96,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_2_0/E=264,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=272,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=288,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=288,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/licenses/LICENSE +0 -0
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,74 @@
|
|
1
|
+
import os
|
2
|
+
import time
|
3
|
+
from pathlib import Path
|
4
|
+
|
5
|
+
import torch
|
6
|
+
|
7
|
+
from sglang.srt.utils import get_bool_env_var
|
8
|
+
|
9
|
+
|
10
|
+
class _Dumper:
|
11
|
+
"""Utility to dump tensors, which can be useful when comparison checking models.
|
12
|
+
|
13
|
+
Example usage:
|
14
|
+
debug_utils.dumper.dump("layer_start_hidden_states", hidden_states, layer_id=self.layer_id)
|
15
|
+
"""
|
16
|
+
|
17
|
+
def __init__(self):
|
18
|
+
self._enable = get_bool_env_var("SGLANG_DUMPER_ENABLE", "true")
|
19
|
+
self._base_dir = Path(os.environ.get("SGLANG_DUMPER_DIR", "/tmp"))
|
20
|
+
self._enable_write_file = get_bool_env_var("SGLANG_DUMPER_WRITE_FILE", "1")
|
21
|
+
self._partial_name = str(time.time())
|
22
|
+
self.forward_pass_id = None
|
23
|
+
|
24
|
+
def dump(self, name, value, **kwargs):
|
25
|
+
if not self._enable:
|
26
|
+
return
|
27
|
+
|
28
|
+
from sglang.srt.distributed import get_tensor_model_parallel_rank
|
29
|
+
|
30
|
+
rank = get_tensor_model_parallel_rank()
|
31
|
+
full_kwargs = dict(
|
32
|
+
forward_pass_id=self.forward_pass_id,
|
33
|
+
name=name,
|
34
|
+
**kwargs,
|
35
|
+
)
|
36
|
+
full_filename = "___".join(f"{k}={v}" for k, v in full_kwargs.items()) + ".pt"
|
37
|
+
path = (
|
38
|
+
self._base_dir / f"sglang_dump_{self._partial_name}_{rank}" / full_filename
|
39
|
+
)
|
40
|
+
|
41
|
+
sample_value = self._get_sample_value(name, value)
|
42
|
+
|
43
|
+
print(
|
44
|
+
f"[{rank}, {time.time()}] {path} "
|
45
|
+
f"type={type(value)} "
|
46
|
+
f"shape={value.shape if isinstance(value, torch.Tensor) else None} "
|
47
|
+
f"dtype={value.dtype if isinstance(value, torch.Tensor) else None} "
|
48
|
+
f"sample_value={sample_value}"
|
49
|
+
)
|
50
|
+
|
51
|
+
if self._enable_write_file:
|
52
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
53
|
+
torch.save(value, str(path))
|
54
|
+
|
55
|
+
def _get_sample_value(self, name, value):
|
56
|
+
if value is None:
|
57
|
+
return None
|
58
|
+
|
59
|
+
if isinstance(value, tuple):
|
60
|
+
return [self._get_sample_value(name, x) for x in value]
|
61
|
+
|
62
|
+
if not isinstance(value, torch.Tensor):
|
63
|
+
return None
|
64
|
+
|
65
|
+
if value.numel() < 200:
|
66
|
+
return value
|
67
|
+
|
68
|
+
slices = [
|
69
|
+
slice(0, 5) if dim_size > 200 else slice(None) for dim_size in value.shape
|
70
|
+
]
|
71
|
+
return value[tuple(slices)]
|
72
|
+
|
73
|
+
|
74
|
+
dumper = _Dumper()
|
@@ -0,0 +1 @@
|
|
1
|
+
from .conn import CommonKVBootstrapServer, CommonKVManager, CommonKVReceiver
|
@@ -0,0 +1,407 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
import asyncio
|
4
|
+
import logging
|
5
|
+
import socket
|
6
|
+
import threading
|
7
|
+
from functools import cache
|
8
|
+
from typing import Dict, List, Optional, Tuple, Union
|
9
|
+
|
10
|
+
import numpy as np
|
11
|
+
import numpy.typing as npt
|
12
|
+
import requests
|
13
|
+
import zmq
|
14
|
+
from aiohttp import web
|
15
|
+
|
16
|
+
from sglang.srt.disaggregation.base.conn import (
|
17
|
+
BaseKVBootstrapServer,
|
18
|
+
BaseKVManager,
|
19
|
+
BaseKVReceiver,
|
20
|
+
BaseKVSender,
|
21
|
+
KVArgs,
|
22
|
+
KVPoll,
|
23
|
+
)
|
24
|
+
from sglang.srt.disaggregation.utils import DisaggregationMode
|
25
|
+
from sglang.srt.server_args import ServerArgs
|
26
|
+
from sglang.srt.utils import get_free_port, get_ip, get_local_ip_by_remote
|
27
|
+
|
28
|
+
logger = logging.getLogger(__name__)
|
29
|
+
|
30
|
+
|
31
|
+
class CommonKVManager(BaseKVManager):
|
32
|
+
def __init__(
|
33
|
+
self,
|
34
|
+
args: KVArgs,
|
35
|
+
disaggregation_mode: DisaggregationMode,
|
36
|
+
server_args: ServerArgs,
|
37
|
+
is_mla_backend: Optional[bool] = False,
|
38
|
+
):
|
39
|
+
self.kv_args = args
|
40
|
+
self.is_mla_backend = is_mla_backend
|
41
|
+
self.disaggregation_mode = disaggregation_mode
|
42
|
+
# for p/d multi node infer
|
43
|
+
self.bootstrap_port = server_args.disaggregation_bootstrap_port
|
44
|
+
self.dist_init_addr = server_args.dist_init_addr
|
45
|
+
self.tp_size = server_args.tp_size
|
46
|
+
self.dp_size = server_args.dp_size
|
47
|
+
self.enable_dp_attention = server_args.enable_dp_attention
|
48
|
+
if not server_args.enable_dp_attention and server_args.dp_size != 1:
|
49
|
+
raise ValueError(
|
50
|
+
"If dp_attention is not enabled, dp size must be 1 in disaggregation mode."
|
51
|
+
)
|
52
|
+
|
53
|
+
self.rank_port = get_free_port()
|
54
|
+
if self.disaggregation_mode == DisaggregationMode.PREFILL:
|
55
|
+
self._register_to_bootstrap()
|
56
|
+
elif self.disaggregation_mode == DisaggregationMode.DECODE:
|
57
|
+
self.connection_pool: Dict[str, Dict[str, Union[str, int]]] = {}
|
58
|
+
self.prefill_tp_size_table: Dict[str, int] = {}
|
59
|
+
self.prefill_dp_size_table: Dict[str, int] = {}
|
60
|
+
else:
|
61
|
+
raise ValueError(
|
62
|
+
f"Unsupported DisaggregationMode: {self.disaggregation_mode}"
|
63
|
+
)
|
64
|
+
|
65
|
+
def _register_to_bootstrap(self):
|
66
|
+
"""Register KVSender to bootstrap server via HTTP POST."""
|
67
|
+
if self.dist_init_addr:
|
68
|
+
ip_address = socket.gethostbyname(self.dist_init_addr.split(":")[0])
|
69
|
+
else:
|
70
|
+
ip_address = get_ip()
|
71
|
+
|
72
|
+
bootstrap_server_url = f"{ip_address}:{self.bootstrap_port}"
|
73
|
+
url = f"http://{bootstrap_server_url}/route"
|
74
|
+
payload = {
|
75
|
+
"role": "Prefill",
|
76
|
+
"tp_size": self.tp_size,
|
77
|
+
"dp_size": self.dp_size,
|
78
|
+
"rank_ip": get_local_ip_by_remote(),
|
79
|
+
"rank_port": self.rank_port,
|
80
|
+
"engine_rank": self.kv_args.engine_rank,
|
81
|
+
}
|
82
|
+
|
83
|
+
try:
|
84
|
+
response = requests.put(url, json=payload)
|
85
|
+
if response.status_code == 200:
|
86
|
+
logger.debug("Prefill successfully registered to bootstrap server.")
|
87
|
+
else:
|
88
|
+
logger.error(
|
89
|
+
f"Prefill Failed to connect to bootstrap server: {response.status_code}, {response.text}"
|
90
|
+
)
|
91
|
+
except Exception as e:
|
92
|
+
logger.error(f"Prefill Failed to register to bootstrap server: {e}")
|
93
|
+
|
94
|
+
@cache
|
95
|
+
def _connect(self, endpoint: str):
|
96
|
+
socket = zmq.Context().socket(zmq.PUSH)
|
97
|
+
socket.connect(endpoint)
|
98
|
+
return socket
|
99
|
+
|
100
|
+
|
101
|
+
class CommonKVReceiver(BaseKVReceiver):
|
102
|
+
_ctx = zmq.Context()
|
103
|
+
_socket_cache = {}
|
104
|
+
_socket_locks = {}
|
105
|
+
_global_lock = threading.Lock()
|
106
|
+
|
107
|
+
def __init__(
|
108
|
+
self,
|
109
|
+
mgr: BaseKVManager,
|
110
|
+
bootstrap_addr: str,
|
111
|
+
bootstrap_room: Optional[int] = None,
|
112
|
+
data_parallel_rank: Optional[int] = None,
|
113
|
+
):
|
114
|
+
self.bootstrap_room = bootstrap_room
|
115
|
+
self.bootstrap_addr = bootstrap_addr
|
116
|
+
self.kv_mgr = mgr
|
117
|
+
self.data_parallel_rank = data_parallel_rank
|
118
|
+
|
119
|
+
if self.bootstrap_addr not in self.kv_mgr.prefill_dp_size_table:
|
120
|
+
self.prefill_tp_size, self.prefill_dp_size = (
|
121
|
+
self._get_prefill_dp_size_from_server()
|
122
|
+
)
|
123
|
+
if self.prefill_tp_size is None or self.prefill_dp_size is None:
|
124
|
+
logger.error(
|
125
|
+
f"Could not fetch prefill parallel info for bootstrap_addr: {self.bootstrap_addr}"
|
126
|
+
)
|
127
|
+
else:
|
128
|
+
self.kv_mgr.prefill_tp_size_table[self.bootstrap_addr] = (
|
129
|
+
self.prefill_tp_size
|
130
|
+
)
|
131
|
+
self.kv_mgr.prefill_dp_size_table[self.bootstrap_addr] = (
|
132
|
+
self.prefill_dp_size
|
133
|
+
)
|
134
|
+
else:
|
135
|
+
self.prefill_tp_size = self.kv_mgr.prefill_tp_size_table[
|
136
|
+
self.bootstrap_addr
|
137
|
+
]
|
138
|
+
self.prefill_dp_size = self.kv_mgr.prefill_dp_size_table[
|
139
|
+
self.bootstrap_addr
|
140
|
+
]
|
141
|
+
|
142
|
+
# Currently, we don't allow prefill instance and decode instance to
|
143
|
+
# have different TP sizes per DP rank, except for models using MLA.
|
144
|
+
local_tp_size_per_dp_rank = self.kv_mgr.tp_size // self.kv_mgr.dp_size
|
145
|
+
prefill_tp_size_per_dp_rank = self.prefill_tp_size // self.prefill_dp_size
|
146
|
+
if local_tp_size_per_dp_rank == prefill_tp_size_per_dp_rank:
|
147
|
+
self.target_tp_rank = (
|
148
|
+
self.kv_mgr.kv_args.engine_rank % local_tp_size_per_dp_rank
|
149
|
+
)
|
150
|
+
self.required_dst_info_num = 1
|
151
|
+
self.target_tp_ranks = [self.target_tp_rank]
|
152
|
+
elif local_tp_size_per_dp_rank > prefill_tp_size_per_dp_rank:
|
153
|
+
assert (
|
154
|
+
self.kv_mgr.is_mla_backend
|
155
|
+
), "PD with different TP sizes per DP rank is not yet supported for non-MLA models"
|
156
|
+
self.target_tp_rank = (
|
157
|
+
self.kv_mgr.kv_args.engine_rank % local_tp_size_per_dp_rank
|
158
|
+
) // (local_tp_size_per_dp_rank // prefill_tp_size_per_dp_rank)
|
159
|
+
self.required_dst_info_num = (
|
160
|
+
local_tp_size_per_dp_rank // prefill_tp_size_per_dp_rank
|
161
|
+
)
|
162
|
+
self.target_tp_ranks = [self.target_tp_rank]
|
163
|
+
else:
|
164
|
+
assert (
|
165
|
+
self.kv_mgr.is_mla_backend
|
166
|
+
), "PD with different TP sizes per DP rank is not yet supported for non-MLA models"
|
167
|
+
|
168
|
+
# For non-MLA models, one decode rank needs to retrieve KVCache from multiple prefill ranks for non MLA models;
|
169
|
+
self.target_tp_ranks = [
|
170
|
+
rank
|
171
|
+
for rank in range(
|
172
|
+
(self.kv_mgr.kv_args.engine_rank % local_tp_size_per_dp_rank)
|
173
|
+
* (prefill_tp_size_per_dp_rank // local_tp_size_per_dp_rank),
|
174
|
+
(self.kv_mgr.kv_args.engine_rank % local_tp_size_per_dp_rank + 1)
|
175
|
+
* (prefill_tp_size_per_dp_rank // local_tp_size_per_dp_rank),
|
176
|
+
)
|
177
|
+
]
|
178
|
+
|
179
|
+
# For MLA models, we can retrieve KVCache from only one prefill rank, but we still need to maintain
|
180
|
+
# multiple connections in the connection pool and have to send dummy requests to other prefill ranks,
|
181
|
+
# or the KVPoll will never be set correctly
|
182
|
+
self.target_tp_rank = self.target_tp_ranks[0]
|
183
|
+
self.required_dst_info_num = 1
|
184
|
+
|
185
|
+
if self.data_parallel_rank is not None:
|
186
|
+
logger.debug(f"Targeting DP rank: {self.data_parallel_rank}")
|
187
|
+
self.target_dp_group = self.data_parallel_rank
|
188
|
+
else:
|
189
|
+
self.target_dp_group = bootstrap_room % self.prefill_dp_size
|
190
|
+
|
191
|
+
# NOTE: key distinguished by bootstrap_addr, target_dp_group, and target_tp_rank
|
192
|
+
bootstrap_key = (
|
193
|
+
f"{self.bootstrap_addr}_{self.target_dp_group}_{self.target_tp_rank}"
|
194
|
+
)
|
195
|
+
|
196
|
+
if bootstrap_key not in self.kv_mgr.connection_pool:
|
197
|
+
bootstrap_infos = []
|
198
|
+
for target_tp_rank in self.target_tp_ranks:
|
199
|
+
bootstrap_info = self._get_bootstrap_info_from_server(
|
200
|
+
target_tp_rank,
|
201
|
+
self.target_dp_group,
|
202
|
+
)
|
203
|
+
if bootstrap_info is not None:
|
204
|
+
# NOTE: only support MLA for now: select one prefill rank as real rank
|
205
|
+
bootstrap_info["is_dummy"] = not bool(
|
206
|
+
target_tp_rank == self.target_tp_rank
|
207
|
+
or self.target_tp_rank is None
|
208
|
+
)
|
209
|
+
bootstrap_infos.append(bootstrap_info)
|
210
|
+
else:
|
211
|
+
logger.error(
|
212
|
+
f"Could not fetch bootstrap info for engine rank: {self.kv_mgr.kv_args.engine_rank} and target_dp_group: {self.target_dp_group}"
|
213
|
+
)
|
214
|
+
self.bootstrap_infos = bootstrap_infos
|
215
|
+
|
216
|
+
if len(self.bootstrap_infos) == 0:
|
217
|
+
logger.error(
|
218
|
+
f"Could not fetch bootstrap info for engine rank: {self.kv_mgr.kv_args.engine_rank}"
|
219
|
+
)
|
220
|
+
else:
|
221
|
+
self.kv_mgr.connection_pool[bootstrap_key] = self.bootstrap_infos
|
222
|
+
# Register kv_args only once to prefill KVManager according to the info fetched from the bootstrap server
|
223
|
+
self._register_kv_args()
|
224
|
+
else:
|
225
|
+
self.bootstrap_infos = self.kv_mgr.connection_pool[bootstrap_key]
|
226
|
+
|
227
|
+
assert len(self.bootstrap_infos) > 0
|
228
|
+
|
229
|
+
def _get_bootstrap_info_from_server(self, engine_rank, target_dp_group):
|
230
|
+
"""Fetch the bootstrap info from the bootstrap server."""
|
231
|
+
try:
|
232
|
+
url = f"http://{self.bootstrap_addr}/route?engine_rank={engine_rank}&target_dp_group={target_dp_group}"
|
233
|
+
response = requests.get(url)
|
234
|
+
if response.status_code == 200:
|
235
|
+
bootstrap_info = response.json()
|
236
|
+
return bootstrap_info
|
237
|
+
else:
|
238
|
+
logger.error(
|
239
|
+
f"Failed to get prefill server info: {response.status_code}, {response.text}"
|
240
|
+
)
|
241
|
+
return None
|
242
|
+
except Exception as e:
|
243
|
+
logger.error(f"Error fetching prefill info from bootstrap: {e}")
|
244
|
+
return None
|
245
|
+
|
246
|
+
def _get_prefill_dp_size_from_server(self) -> int:
|
247
|
+
"""Fetch the prefill parallel info from the bootstrap server."""
|
248
|
+
try:
|
249
|
+
url = f"http://{self.bootstrap_addr}/route?engine_rank={-1}&target_dp_group={-1}"
|
250
|
+
response = requests.get(url)
|
251
|
+
if response.status_code == 200:
|
252
|
+
prefill_parallel_info = response.json()
|
253
|
+
return int(prefill_parallel_info["prefill_tp_size"]), int(
|
254
|
+
prefill_parallel_info["prefill_dp_size"]
|
255
|
+
)
|
256
|
+
else:
|
257
|
+
logger.error(
|
258
|
+
f"Failed to get prefill parallel info: {response.status_code}, {response.text}"
|
259
|
+
)
|
260
|
+
return None
|
261
|
+
except Exception as e:
|
262
|
+
logger.error(f"Error fetching prefill parallel info from bootstrap: {e}")
|
263
|
+
return None
|
264
|
+
|
265
|
+
@classmethod
|
266
|
+
def _connect(cls, endpoint: str):
|
267
|
+
with cls._global_lock:
|
268
|
+
if endpoint not in cls._socket_cache:
|
269
|
+
sock = cls._ctx.socket(zmq.PUSH)
|
270
|
+
sock.connect(endpoint)
|
271
|
+
cls._socket_cache[endpoint] = sock
|
272
|
+
cls._socket_locks[endpoint] = threading.Lock()
|
273
|
+
return cls._socket_cache[endpoint], cls._socket_locks[endpoint]
|
274
|
+
|
275
|
+
def _register_kv_args(self):
|
276
|
+
pass
|
277
|
+
|
278
|
+
def failure_exception(self):
|
279
|
+
raise Exception("Fake KVReceiver Exception")
|
280
|
+
|
281
|
+
|
282
|
+
class CommonKVBootstrapServer(BaseKVBootstrapServer):
|
283
|
+
def __init__(self, port: int):
|
284
|
+
self.port = port
|
285
|
+
self.app = web.Application()
|
286
|
+
self.store = dict()
|
287
|
+
self.lock = asyncio.Lock()
|
288
|
+
self._setup_routes()
|
289
|
+
self.tp_size = None
|
290
|
+
self.dp_size = None
|
291
|
+
self.tp_size_per_dp_rank = None
|
292
|
+
self.prefill_port_table: Dict[int, Dict[int, Dict[str, Union[str, int]]]] = {}
|
293
|
+
|
294
|
+
# Start bootstrap server
|
295
|
+
self.thread = threading.Thread(target=self._run_server, daemon=True)
|
296
|
+
self.run()
|
297
|
+
|
298
|
+
def run(self):
|
299
|
+
self.thread.start()
|
300
|
+
|
301
|
+
def _setup_routes(self):
|
302
|
+
self.app.router.add_route("*", "/route", self._handle_route)
|
303
|
+
|
304
|
+
async def _handle_route(self, request: web.Request):
|
305
|
+
method = request.method
|
306
|
+
if method == "PUT":
|
307
|
+
return await self._handle_route_put(request)
|
308
|
+
elif method == "GET":
|
309
|
+
return await self._handle_route_get(request)
|
310
|
+
else:
|
311
|
+
return web.Response(
|
312
|
+
text="Method not allowed", status=405, content_type="application/json"
|
313
|
+
)
|
314
|
+
|
315
|
+
async def _handle_route_put(self, request: web.Request):
|
316
|
+
data = await request.json()
|
317
|
+
role = data["role"]
|
318
|
+
tp_size = data["tp_size"]
|
319
|
+
dp_size = data["dp_size"]
|
320
|
+
rank_ip = data["rank_ip"]
|
321
|
+
rank_port = int(data["rank_port"])
|
322
|
+
engine_rank = int(data["engine_rank"])
|
323
|
+
|
324
|
+
if self.tp_size is None:
|
325
|
+
self.tp_size = tp_size
|
326
|
+
|
327
|
+
if self.dp_size is None:
|
328
|
+
self.dp_size = dp_size
|
329
|
+
|
330
|
+
tp_size_per_dp_rank = tp_size // dp_size
|
331
|
+
if self.tp_size_per_dp_rank == None:
|
332
|
+
self.tp_size_per_dp_rank = tp_size_per_dp_rank
|
333
|
+
|
334
|
+
# Add lock to make sure thread-safe
|
335
|
+
if role == "Prefill":
|
336
|
+
dp_group = engine_rank // tp_size_per_dp_rank
|
337
|
+
tp_rank_in_dp_group = engine_rank % tp_size_per_dp_rank
|
338
|
+
|
339
|
+
async with self.lock:
|
340
|
+
if dp_group not in self.prefill_port_table:
|
341
|
+
self.prefill_port_table[dp_group] = {}
|
342
|
+
|
343
|
+
self.prefill_port_table[dp_group][tp_rank_in_dp_group] = {
|
344
|
+
"rank_ip": rank_ip,
|
345
|
+
"rank_port": rank_port,
|
346
|
+
}
|
347
|
+
logger.debug(
|
348
|
+
f"Register Prefill bootstrap: {engine_rank} with rank_ip: {rank_ip} and rank_port: {rank_port}"
|
349
|
+
)
|
350
|
+
|
351
|
+
return web.Response(text="OK", status=200)
|
352
|
+
|
353
|
+
async def _handle_route_get(self, request: web.Request):
|
354
|
+
engine_rank = request.query.get("engine_rank")
|
355
|
+
target_dp_group = request.query.get("target_dp_group")
|
356
|
+
if not engine_rank or not target_dp_group:
|
357
|
+
return web.Response(text="Missing inputs for bootstrap server.", status=400)
|
358
|
+
|
359
|
+
# Currently we use engine_rank == -1 and target_dp_group == -1 to sync dp size
|
360
|
+
if int(engine_rank) == -1 and int(target_dp_group) == -1:
|
361
|
+
prefill_parallel_info = {
|
362
|
+
"prefill_tp_size": self.tp_size,
|
363
|
+
"prefill_dp_size": self.dp_size,
|
364
|
+
}
|
365
|
+
return web.json_response(prefill_parallel_info, status=200)
|
366
|
+
|
367
|
+
# Find corresponding prefill info
|
368
|
+
async with self.lock:
|
369
|
+
bootstrap_info = self.prefill_port_table[int(target_dp_group)][
|
370
|
+
int(engine_rank)
|
371
|
+
]
|
372
|
+
|
373
|
+
if bootstrap_info is not None:
|
374
|
+
return web.json_response(bootstrap_info, status=200)
|
375
|
+
else:
|
376
|
+
return web.Response(text="Bootstrap info not Found", status=404)
|
377
|
+
|
378
|
+
def _run_server(self):
|
379
|
+
try:
|
380
|
+
# Event Loop
|
381
|
+
self._loop = asyncio.new_event_loop()
|
382
|
+
asyncio.set_event_loop(self._loop)
|
383
|
+
|
384
|
+
self._runner = web.AppRunner(self.app)
|
385
|
+
self._loop.run_until_complete(self._runner.setup())
|
386
|
+
|
387
|
+
site = web.TCPSite(self._runner, port=self.port)
|
388
|
+
self._loop.run_until_complete(site.start())
|
389
|
+
self._loop.run_forever()
|
390
|
+
except Exception as e:
|
391
|
+
logger.error(f"Server error: {str(e)}")
|
392
|
+
finally:
|
393
|
+
# Cleanup
|
394
|
+
self._loop.run_until_complete(self._runner.cleanup())
|
395
|
+
self._loop.close()
|
396
|
+
|
397
|
+
def close(self):
|
398
|
+
"""Shutdown"""
|
399
|
+
if self._loop is not None and self._loop.is_running():
|
400
|
+
self._loop.call_soon_threadsafe(self._loop.stop)
|
401
|
+
logger.info("Stopping server loop...")
|
402
|
+
|
403
|
+
if self.thread.is_alive():
|
404
|
+
self.thread.join(timeout=2)
|
405
|
+
logger.info("Server thread stopped")
|
406
|
+
|
407
|
+
def poll(self) -> KVPoll: ...
|
@@ -25,7 +25,7 @@ import os
|
|
25
25
|
from collections import deque
|
26
26
|
from dataclasses import dataclass
|
27
27
|
from http import HTTPStatus
|
28
|
-
from typing import TYPE_CHECKING, List, Optional, Tuple
|
28
|
+
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
|
29
29
|
|
30
30
|
import numpy as np
|
31
31
|
import torch
|
@@ -49,6 +49,7 @@ from sglang.srt.managers.schedule_batch import FINISH_ABORT, ScheduleBatch
|
|
49
49
|
from sglang.srt.mem_cache.base_prefix_cache import BasePrefixCache
|
50
50
|
from sglang.srt.mem_cache.memory_pool import ReqToTokenPool, TokenToKVPoolAllocator
|
51
51
|
from sglang.srt.model_executor.forward_batch_info import ForwardMode
|
52
|
+
from sglang.srt.torch_memory_saver_adapter import TorchMemorySaverAdapter
|
52
53
|
|
53
54
|
logger = logging.getLogger(__name__)
|
54
55
|
|
@@ -57,6 +58,67 @@ if TYPE_CHECKING:
|
|
57
58
|
from sglang.srt.managers.scheduler import Scheduler
|
58
59
|
|
59
60
|
|
61
|
+
class DecodeReqToTokenPool:
|
62
|
+
"""
|
63
|
+
The difference of DecodeReqToTokenPool and ReqToTokenPool is that
|
64
|
+
DecodeReqToTokenPool subscribes memory for pre-allocated requests.
|
65
|
+
|
66
|
+
In ReqToTokenPool, if `--max-running-requests` is 8,
|
67
|
+
#pre-allocated + #transfer + #running <= 8, but there are in fact more memory can carry pre-allocated requests.
|
68
|
+
|
69
|
+
In DecodeReqToTokenPool, if `--max-running-requests` is 8,
|
70
|
+
#running <= 8, #pre-allocated + #transfer <= pre_alloc_size, so we can use the free memory to pre-allocate requests to unblock prefill.
|
71
|
+
"""
|
72
|
+
|
73
|
+
def __init__(
|
74
|
+
self,
|
75
|
+
size: int,
|
76
|
+
max_context_len: int,
|
77
|
+
device: str,
|
78
|
+
enable_memory_saver: bool,
|
79
|
+
pre_alloc_size: int,
|
80
|
+
):
|
81
|
+
memory_saver_adapter = TorchMemorySaverAdapter.create(
|
82
|
+
enable=enable_memory_saver
|
83
|
+
)
|
84
|
+
|
85
|
+
self.size = size
|
86
|
+
self.max_context_len = max_context_len
|
87
|
+
self.device = device
|
88
|
+
self.pre_alloc_size = pre_alloc_size
|
89
|
+
with memory_saver_adapter.region():
|
90
|
+
self.req_to_token = torch.zeros(
|
91
|
+
(size + pre_alloc_size, max_context_len),
|
92
|
+
dtype=torch.int32,
|
93
|
+
device=device,
|
94
|
+
)
|
95
|
+
|
96
|
+
self.free_slots = list(range(size + pre_alloc_size))
|
97
|
+
|
98
|
+
def write(self, indices, values):
|
99
|
+
self.req_to_token[indices] = values
|
100
|
+
|
101
|
+
def available_size(self):
|
102
|
+
return len(self.free_slots)
|
103
|
+
|
104
|
+
def alloc(self, need_size: int) -> List[int]:
|
105
|
+
if need_size > len(self.free_slots):
|
106
|
+
return None
|
107
|
+
|
108
|
+
select_index = self.free_slots[:need_size]
|
109
|
+
self.free_slots = self.free_slots[need_size:]
|
110
|
+
return select_index
|
111
|
+
|
112
|
+
def free(self, free_index: Union[int, List[int]]):
|
113
|
+
if isinstance(free_index, (int,)):
|
114
|
+
self.free_slots.append(free_index)
|
115
|
+
else:
|
116
|
+
self.free_slots.extend(free_index)
|
117
|
+
|
118
|
+
def clear(self):
|
119
|
+
self.free_slots = list(range(self.size + self.pre_alloc_size))
|
120
|
+
|
121
|
+
|
60
122
|
@dataclass
|
61
123
|
class DecodeRequest:
|
62
124
|
req: Req
|
@@ -156,6 +218,7 @@ class DecodePreallocQueue:
|
|
156
218
|
mgr=self.kv_manager,
|
157
219
|
bootstrap_addr=f"{req.bootstrap_host}:{req.bootstrap_port}",
|
158
220
|
bootstrap_room=req.bootstrap_room,
|
221
|
+
data_parallel_rank=req.data_parallel_rank,
|
159
222
|
)
|
160
223
|
self.queue.append(DecodeRequest(req=req, kv_receiver=kv_receiver))
|
161
224
|
|
@@ -361,7 +424,7 @@ class DecodeTransferQueue:
|
|
361
424
|
indices_to_remove = set()
|
362
425
|
for i, (decode_req, poll) in enumerate(zip(self.queue, polls)):
|
363
426
|
if poll == KVPoll.Failed:
|
364
|
-
error_message = f"Decode transfer failed for request {decode_req.req.rid=} {decode_req.req.bootstrap_room=}"
|
427
|
+
error_message = f"Decode transfer failed for request rank={self.scheduler.tp_rank} {decode_req.req.rid=} {decode_req.req.bootstrap_room=}"
|
365
428
|
try:
|
366
429
|
decode_req.kv_receiver.failure_exception()
|
367
430
|
except Exception as e:
|
@@ -409,7 +472,8 @@ class DecodeTransferQueue:
|
|
409
472
|
: decode_req.req.top_logprobs_num
|
410
473
|
].tolist()
|
411
474
|
)
|
412
|
-
|
475
|
+
if hasattr(decode_req.kv_receiver, "clear"):
|
476
|
+
decode_req.kv_receiver.clear()
|
413
477
|
transferred_reqs.append(decode_req.req)
|
414
478
|
indices_to_remove.add(i)
|
415
479
|
elif poll in [
|