sglang 0.4.6.post4__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 +16 -10
- sglang/bench_one_batch.py +5 -4
- sglang/bench_one_batch_server.py +86 -22
- sglang/bench_serving.py +197 -110
- sglang/compile_deep_gemm.py +4 -4
- 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 +66 -29
- 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 +47 -9
- 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 +187 -134
- sglang/srt/disaggregation/decode_schedule_batch_mixin.py +142 -0
- sglang/srt/disaggregation/fake/conn.py +4 -13
- sglang/srt/disaggregation/kv_events.py +412 -0
- sglang/srt/disaggregation/launch_lb.py +140 -0
- sglang/srt/disaggregation/mini_lb.py +84 -70
- sglang/srt/disaggregation/mooncake/conn.py +441 -140
- sglang/srt/disaggregation/mooncake/transfer_engine.py +31 -14
- sglang/srt/disaggregation/nixl/conn.py +124 -442
- sglang/srt/disaggregation/prefill.py +128 -44
- sglang/srt/disaggregation/utils.py +154 -6
- sglang/srt/distributed/device_communicators/pymscclpp.py +315 -0
- sglang/srt/distributed/parallel_state.py +52 -5
- sglang/srt/distributed/utils.py +3 -3
- sglang/srt/entrypoints/EngineBase.py +11 -0
- sglang/srt/entrypoints/engine.py +129 -12
- sglang/srt/entrypoints/http_server.py +21 -6
- sglang/srt/entrypoints/http_server_engine.py +5 -2
- sglang/srt/function_call/base_format_detector.py +302 -0
- sglang/srt/function_call/core_types.py +34 -0
- sglang/srt/function_call/deepseekv3_detector.py +205 -0
- sglang/srt/function_call/ebnf_composer.py +248 -0
- sglang/srt/function_call/function_call_parser.py +202 -0
- sglang/srt/function_call/llama32_detector.py +93 -0
- sglang/srt/function_call/mistral_detector.py +131 -0
- sglang/srt/function_call/pythonic_detector.py +229 -0
- sglang/srt/function_call/qwen25_detector.py +121 -0
- sglang/srt/function_call/utils.py +52 -0
- sglang/srt/hf_transformers_utils.py +50 -7
- sglang/srt/layers/attention/aiter_backend.py +878 -0
- 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 +166 -35
- sglang/srt/layers/attention/flashinfer_backend.py +45 -1
- sglang/srt/layers/attention/flashinfer_mla_backend.py +45 -5
- sglang/srt/layers/attention/flashmla_backend.py +340 -78
- 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 +247 -5
- sglang/srt/layers/attention/triton_ops/extend_attention.py +12 -4
- sglang/srt/layers/attention/utils.py +2 -2
- sglang/srt/layers/attention/vision.py +1 -1
- sglang/srt/layers/communicator.py +517 -0
- sglang/srt/layers/dp_attention.py +6 -15
- sglang/srt/layers/layernorm.py +30 -19
- sglang/srt/layers/moe/cutlass_moe.py +370 -0
- sglang/srt/layers/moe/cutlass_moe_params.py +169 -0
- sglang/srt/layers/moe/ep_moe/kernels.py +60 -17
- sglang/srt/layers/moe/ep_moe/layer.py +195 -87
- sglang/srt/layers/moe/ep_moe/token_dispatcher.py +88 -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 +48 -4
- sglang/srt/layers/moe/topk.py +107 -24
- sglang/srt/layers/multimodal.py +70 -0
- sglang/srt/layers/quantization/__init__.py +10 -4
- 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 +60 -59
- sglang/srt/layers/quantization/fp8.py +113 -18
- sglang/srt/layers/quantization/fp8_kernel.py +118 -66
- sglang/srt/layers/quantization/fp8_utils.py +165 -43
- sglang/srt/layers/quantization/gptq.py +298 -6
- sglang/srt/layers/quantization/int8_kernel.py +18 -5
- sglang/srt/layers/quantization/modelopt_quant.py +334 -7
- sglang/srt/layers/quantization/moe_wna16.py +3 -0
- sglang/srt/layers/quantization/qoq.py +244 -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 +20 -8
- 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/eplb_algorithms/deepseek_vec.py +276 -0
- sglang/srt/managers/eplb_manager.py +96 -0
- sglang/srt/managers/expert_distribution.py +878 -56
- sglang/srt/managers/expert_location.py +448 -0
- sglang/srt/managers/expert_location_dispatch.py +108 -0
- sglang/srt/managers/io_struct.py +29 -5
- sglang/srt/managers/mm_utils.py +355 -151
- sglang/srt/managers/multimodal_processors/base_processor.py +299 -42
- sglang/srt/managers/multimodal_processors/deepseek_vl_v2.py +6 -1
- sglang/srt/managers/multimodal_processors/gemma3.py +15 -17
- sglang/srt/managers/multimodal_processors/internvl.py +18 -5
- sglang/srt/managers/multimodal_processors/janus_pro.py +7 -1
- sglang/srt/managers/multimodal_processors/kimi_vl.py +14 -32
- sglang/srt/managers/multimodal_processors/llava.py +3 -3
- sglang/srt/managers/multimodal_processors/minicpm.py +27 -32
- sglang/srt/managers/multimodal_processors/mllama4.py +6 -0
- sglang/srt/managers/multimodal_processors/phi4mm.py +87 -0
- sglang/srt/managers/multimodal_processors/pixtral.py +9 -9
- sglang/srt/managers/multimodal_processors/qwen_vl.py +35 -35
- sglang/srt/managers/schedule_batch.py +185 -55
- sglang/srt/managers/schedule_policy.py +4 -5
- sglang/srt/managers/scheduler.py +389 -154
- sglang/srt/managers/session_controller.py +1 -1
- sglang/srt/managers/tokenizer_manager.py +231 -39
- sglang/srt/managers/utils.py +0 -4
- sglang/srt/mem_cache/base_prefix_cache.py +3 -0
- sglang/srt/mem_cache/chunk_cache.py +3 -1
- sglang/srt/mem_cache/hiradix_cache.py +4 -4
- sglang/srt/mem_cache/memory_pool.py +74 -52
- sglang/srt/mem_cache/multimodal_cache.py +45 -0
- sglang/srt/mem_cache/radix_cache.py +58 -5
- sglang/srt/metrics/collector.py +11 -2
- sglang/srt/mm_utils.py +10 -0
- sglang/srt/model_executor/cuda_graph_runner.py +87 -65
- sglang/srt/model_executor/expert_location_updater.py +557 -0
- sglang/srt/model_executor/forward_batch_info.py +39 -14
- sglang/srt/model_executor/model_runner.py +231 -101
- sglang/srt/model_loader/loader.py +10 -6
- sglang/srt/model_loader/utils.py +67 -1
- sglang/srt/models/clip.py +5 -1
- sglang/srt/models/deepseek_nextn.py +1 -1
- sglang/srt/models/deepseek_v2.py +732 -403
- sglang/srt/models/exaone.py +8 -3
- sglang/srt/models/gemma3_causal.py +7 -0
- sglang/srt/models/gemma3_mm.py +75 -33
- 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/llama4.py +10 -2
- sglang/srt/models/llava.py +26 -18
- sglang/srt/models/mimo_mtp.py +220 -0
- sglang/srt/models/minicpmo.py +7 -17
- sglang/srt/models/minicpmv.py +3 -295
- sglang/srt/models/mistral.py +71 -1
- sglang/srt/models/mllama.py +3 -3
- sglang/srt/models/phi4mm.py +512 -0
- sglang/srt/models/qwen2.py +133 -35
- sglang/srt/models/qwen2_5_vl.py +5 -3
- sglang/srt/models/qwen2_eagle.py +4 -1
- sglang/srt/models/qwen2_moe.py +206 -69
- sglang/srt/models/qwen2_vl.py +3 -3
- sglang/srt/models/qwen3.py +92 -19
- sglang/srt/models/qwen3_moe.py +457 -55
- sglang/srt/models/registry.py +9 -1
- sglang/srt/models/siglip.py +294 -0
- sglang/srt/models/transformers.py +291 -0
- sglang/srt/openai_api/adapter.py +114 -40
- sglang/srt/openai_api/protocol.py +37 -2
- sglang/srt/openai_api/utils.py +172 -0
- sglang/srt/operations.py +189 -0
- sglang/srt/operations_strategy.py +207 -0
- sglang/srt/sampling/sampling_batch_info.py +13 -1
- sglang/srt/sampling/sampling_params.py +2 -1
- sglang/srt/server_args.py +235 -38
- 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 +181 -90
- sglang/srt/speculative/eagle_worker.py +146 -21
- sglang/srt/two_batch_overlap.py +635 -0
- sglang/srt/utils.py +197 -19
- sglang/test/runners.py +16 -7
- sglang/test/send_one.py +4 -0
- sglang/test/test_cutlass_moe.py +278 -0
- sglang/test/test_fp4_moe.py +248 -0
- sglang/test/test_utils.py +81 -42
- sglang/utils.py +2 -2
- sglang/version.py +1 -1
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/METADATA +31 -19
- sglang-0.4.7.dist-info/RECORD +699 -0
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/WHEEL +1 -1
- sglang/srt/function_call_parser.py +0 -858
- sglang/srt/platforms/interface.py +0 -371
- sglang-0.4.6.post4.dist-info/RECORD +0 -646
- /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/srt/models/{xiaomi_mimo.py → mimo.py} +0 -0
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/licenses/LICENSE +0 -0
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/top_level.txt +0 -0
sglang/srt/conversation.py
CHANGED
@@ -21,6 +21,7 @@ from enum import IntEnum, auto
|
|
21
21
|
from typing import Callable, Dict, List, Optional, Tuple, Union
|
22
22
|
|
23
23
|
from sglang.srt.openai_api.protocol import ChatCompletionRequest
|
24
|
+
from sglang.srt.utils import read_system_prompt_from_file
|
24
25
|
|
25
26
|
|
26
27
|
class SeparatorStyle(IntEnum):
|
@@ -561,14 +562,11 @@ def generate_chat_conv(
|
|
561
562
|
if content.type == "image_url":
|
562
563
|
num_image_url += 1
|
563
564
|
conv.modalities.append(content.modalities)
|
564
|
-
|
565
|
-
image_token
|
566
|
-
|
567
|
-
image_token
|
568
|
-
|
569
|
-
if conv.name != "qwen2-vl"
|
570
|
-
else conv.image_token
|
571
|
-
)
|
565
|
+
image_token = (
|
566
|
+
conv.image_token + "\n"
|
567
|
+
if conv.name != "qwen2-vl"
|
568
|
+
else conv.image_token
|
569
|
+
)
|
572
570
|
add_token_as_needed: bool = (
|
573
571
|
conv.name in _MODELS_REQUIRING_MODALITY_SUPPLEMENT
|
574
572
|
)
|
@@ -648,6 +646,20 @@ register_conv_template(
|
|
648
646
|
)
|
649
647
|
)
|
650
648
|
|
649
|
+
register_conv_template(
|
650
|
+
Conversation(
|
651
|
+
name="devstral",
|
652
|
+
system_template="[SYSTEM_PROMPT]\n{system_message}\n[/SYSTEM_PROMPT]\n\n",
|
653
|
+
system_message=read_system_prompt_from_file("mistralai/Devstral-Small-2505"),
|
654
|
+
roles=("[INST]", "[/INST]"),
|
655
|
+
sep_style=SeparatorStyle.LLAMA2,
|
656
|
+
sep=" ",
|
657
|
+
sep2=" </s><s>",
|
658
|
+
stop_str=["[INST]", "[/INST]", "[SYSTEM_PROMPT]", "[/SYSTEM_PROMPT]"],
|
659
|
+
image_token="[IMG]",
|
660
|
+
)
|
661
|
+
)
|
662
|
+
|
651
663
|
# reference: https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct/blob/main/chat_template.json
|
652
664
|
register_conv_template(
|
653
665
|
Conversation(
|
@@ -661,6 +673,20 @@ register_conv_template(
|
|
661
673
|
)
|
662
674
|
)
|
663
675
|
|
676
|
+
# TODO (lifuhuang): Refactor BaseMultimodalProcessor to support the default image token "<|image_{index}|>" in the future.
|
677
|
+
register_conv_template(
|
678
|
+
Conversation(
|
679
|
+
name="phi-4-mm",
|
680
|
+
system_message="",
|
681
|
+
system_template="{system_message}",
|
682
|
+
roles=("<|user|>", "<|assistant|>"),
|
683
|
+
sep_style=SeparatorStyle.NO_COLON_SINGLE,
|
684
|
+
sep="<|end|>",
|
685
|
+
stop_str="<|end|>",
|
686
|
+
image_token="<|endoftext10|>",
|
687
|
+
)
|
688
|
+
)
|
689
|
+
|
664
690
|
register_conv_template(
|
665
691
|
Conversation(
|
666
692
|
name="chatml",
|
@@ -781,7 +807,7 @@ register_conv_template(
|
|
781
807
|
Conversation(
|
782
808
|
name="gemma-it",
|
783
809
|
system_message="You are a helpful assistant.",
|
784
|
-
system_template="<start_of_turn>user{system_message}\n\n",
|
810
|
+
system_template="<start_of_turn>user\n{system_message}\n\n",
|
785
811
|
roles=("<start_of_turn>user\n", "<start_of_turn>model\n"),
|
786
812
|
sep="<end_of_turn>\n",
|
787
813
|
sep_style=SeparatorStyle.GEMMA3,
|
@@ -945,3 +971,15 @@ def match_openbmb_minicpm(model_path: str):
|
|
945
971
|
def match_moonshot_kimivl(model_path: str):
|
946
972
|
if re.search(r"kimi.*vl", model_path, re.IGNORECASE):
|
947
973
|
return "kimi-vl"
|
974
|
+
|
975
|
+
|
976
|
+
@register_conv_template_matching_function
|
977
|
+
def match_devstral(model_path: str):
|
978
|
+
if re.search(r"devstral", model_path, re.IGNORECASE):
|
979
|
+
return "devstral"
|
980
|
+
|
981
|
+
|
982
|
+
@register_conv_template_matching_function
|
983
|
+
def match_phi_4_mm(model_path: str):
|
984
|
+
if "phi-4-multimodal" in model_path.lower():
|
985
|
+
return "phi-4-mm"
|
sglang/srt/custom_op.py
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
from typing import Optional
|
2
|
-
|
3
|
-
import torch
|
4
1
|
from torch import nn
|
5
2
|
|
6
3
|
from sglang.srt.utils import is_cuda, is_hip
|
@@ -14,6 +11,44 @@ class CustomOp(nn.Module):
|
|
14
11
|
super().__init__()
|
15
12
|
self._forward_method = self.dispatch_forward()
|
16
13
|
|
14
|
+
# States for torch.compile
|
15
|
+
self._original_forward_method = None
|
16
|
+
self.is_torch_compile = False
|
17
|
+
|
18
|
+
def enter_torch_compile(self, num_tokens: int):
|
19
|
+
# Skip if Op is already entered compile mode.
|
20
|
+
# NOTE(alcanderian): Some Ops(for example RotaryEmbedding) will be reused
|
21
|
+
# among layers and `enter_torch_compile` will be called many times.
|
22
|
+
# We should prevent `self._original_forward_method` from being overridden when
|
23
|
+
# it is not the first time `enter_torch_compile` called.
|
24
|
+
if self.is_torch_compile:
|
25
|
+
return
|
26
|
+
|
27
|
+
self._original_forward_method = self._forward_method
|
28
|
+
# NOTE: Temporarily workaround MoE
|
29
|
+
if "FusedMoE" in self.__class__.__name__:
|
30
|
+
if num_tokens == 1:
|
31
|
+
from sglang.srt.layers.moe.fused_moe_native import (
|
32
|
+
fused_moe_forward_native,
|
33
|
+
)
|
34
|
+
|
35
|
+
# The performance of torch.compile on this layer is not always good when bs > 1,
|
36
|
+
# so we decide to only use torch.compile when bs =1
|
37
|
+
self._forward_method = fused_moe_forward_native
|
38
|
+
else:
|
39
|
+
self._forward_method = self.forward_native
|
40
|
+
self.is_torch_compile = True
|
41
|
+
|
42
|
+
def leave_torch_compile(self):
|
43
|
+
# Skip if Op is already exited compile mode.
|
44
|
+
if not self.is_torch_compile:
|
45
|
+
return
|
46
|
+
|
47
|
+
self._forward_method = self._original_forward_method
|
48
|
+
self._original_forward_method = None
|
49
|
+
self.is_torch_compile = False
|
50
|
+
|
51
|
+
# Please do not override this method, because `self._forward_method` can change when in torch compile mode
|
17
52
|
def forward(self, *args, **kwargs):
|
18
53
|
return self._forward_method(*args, **kwargs)
|
19
54
|
|
@@ -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: ...
|