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
@@ -0,0 +1,448 @@
|
|
1
|
+
# Copyright 2023-2024 SGLang Team
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
# you may not use this file except in compliance with the License.
|
4
|
+
# You may obtain a copy of the License at
|
5
|
+
#
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
#
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
# See the License for the specific language governing permissions and
|
12
|
+
# limitations under the License.
|
13
|
+
# ==============================================================================
|
14
|
+
import json
|
15
|
+
import logging
|
16
|
+
import random
|
17
|
+
from dataclasses import dataclass
|
18
|
+
from pathlib import Path
|
19
|
+
from typing import List, Optional
|
20
|
+
|
21
|
+
import torch
|
22
|
+
import torch.distributed
|
23
|
+
import torch.nn.functional as F
|
24
|
+
|
25
|
+
from sglang.srt.configs.model_config import ModelConfig
|
26
|
+
from sglang.srt.managers import eplb_algorithms
|
27
|
+
from sglang.srt.model_loader import get_model_architecture
|
28
|
+
from sglang.srt.server_args import ServerArgs
|
29
|
+
|
30
|
+
logger = logging.getLogger(__name__)
|
31
|
+
|
32
|
+
|
33
|
+
@dataclass
|
34
|
+
class ExpertLocationMetadata:
|
35
|
+
physical_to_logical_map: torch.Tensor # (layers, num_physical_experts)
|
36
|
+
physical_to_logical_map_cpu: torch.Tensor
|
37
|
+
logical_to_all_physical_map: torch.Tensor # (layers, num_logical_experts, X)
|
38
|
+
logical_to_all_physical_map_num_valid: torch.Tensor # (layers, num_logical_experts)
|
39
|
+
# (layers, num_logical_experts)
|
40
|
+
logical_to_rank_dispatch_physical_map: Optional[torch.Tensor]
|
41
|
+
|
42
|
+
# -------------------------------- properties ------------------------------------
|
43
|
+
|
44
|
+
@property
|
45
|
+
def num_layers(self) -> int:
|
46
|
+
return self.physical_to_logical_map.shape[0]
|
47
|
+
|
48
|
+
@property
|
49
|
+
def num_physical_experts(self) -> int:
|
50
|
+
return self.physical_to_logical_map.shape[1]
|
51
|
+
|
52
|
+
@property
|
53
|
+
def num_local_physical_experts(self) -> int:
|
54
|
+
ans, remainder = divmod(self.num_physical_experts, self.ep_size)
|
55
|
+
assert remainder == 0
|
56
|
+
return ans
|
57
|
+
|
58
|
+
@property
|
59
|
+
def num_logical_experts(self) -> int:
|
60
|
+
return self.logical_to_all_physical_map.shape[1]
|
61
|
+
|
62
|
+
@property
|
63
|
+
def ep_size(self):
|
64
|
+
# TODO change when EP size != world size
|
65
|
+
return torch.distributed.get_world_size()
|
66
|
+
|
67
|
+
def __post_init__(self):
|
68
|
+
num_layers_0, num_physical_experts_0 = self.physical_to_logical_map.shape
|
69
|
+
num_layers_1, num_logical_experts_0, num_physical_experts_1 = (
|
70
|
+
self.logical_to_all_physical_map.shape
|
71
|
+
)
|
72
|
+
num_layers_2, num_logical_experts_1 = (
|
73
|
+
self.logical_to_all_physical_map_num_valid.shape
|
74
|
+
)
|
75
|
+
assert num_layers_0 == num_layers_1 == num_layers_2
|
76
|
+
assert num_logical_experts_0 == num_logical_experts_1
|
77
|
+
assert num_physical_experts_0 == num_physical_experts_1
|
78
|
+
|
79
|
+
# -------------------------------- construction ------------------------------------
|
80
|
+
|
81
|
+
@staticmethod
|
82
|
+
def init_trivial(server_args: ServerArgs, model_config: ModelConfig):
|
83
|
+
"""Trivial location - logical expert i corresponds to physical expert i"""
|
84
|
+
common = ExpertLocationMetadata._init_common(server_args, model_config)
|
85
|
+
num_physical_experts = common["num_physical_experts"]
|
86
|
+
model_config_for_expert_location = common["model_config_for_expert_location"]
|
87
|
+
num_layers = model_config_for_expert_location.num_layers
|
88
|
+
num_logical_experts = model_config_for_expert_location.num_logical_experts
|
89
|
+
|
90
|
+
physical_to_logical_map = (
|
91
|
+
torch.arange(0, num_physical_experts).repeat(num_layers, 1)
|
92
|
+
% num_logical_experts
|
93
|
+
)
|
94
|
+
|
95
|
+
return ExpertLocationMetadata.init_by_mapping(
|
96
|
+
server_args,
|
97
|
+
model_config,
|
98
|
+
physical_to_logical_map=physical_to_logical_map,
|
99
|
+
)
|
100
|
+
|
101
|
+
@staticmethod
|
102
|
+
def init_by_mapping(
|
103
|
+
server_args: ServerArgs,
|
104
|
+
model_config: ModelConfig,
|
105
|
+
physical_to_logical_map,
|
106
|
+
):
|
107
|
+
if not isinstance(physical_to_logical_map, torch.Tensor):
|
108
|
+
physical_to_logical_map = torch.tensor(physical_to_logical_map)
|
109
|
+
physical_to_logical_map = physical_to_logical_map.to(server_args.device)
|
110
|
+
|
111
|
+
common = ExpertLocationMetadata._init_common(server_args, model_config)
|
112
|
+
model_config_for_expert_location = common["model_config_for_expert_location"]
|
113
|
+
logical_to_all_physical_map = _compute_logical_to_all_physical_map(
|
114
|
+
physical_to_logical_map,
|
115
|
+
num_logical_experts=model_config_for_expert_location.num_logical_experts,
|
116
|
+
)
|
117
|
+
|
118
|
+
return ExpertLocationMetadata._init_raw(
|
119
|
+
server_args=server_args,
|
120
|
+
ep_size=common["ep_size"],
|
121
|
+
physical_to_logical_map=physical_to_logical_map,
|
122
|
+
logical_to_all_physical_map=logical_to_all_physical_map,
|
123
|
+
)
|
124
|
+
|
125
|
+
@staticmethod
|
126
|
+
def init_by_eplb(
|
127
|
+
server_args: ServerArgs, model_config: ModelConfig, logical_count: torch.Tensor
|
128
|
+
):
|
129
|
+
if not isinstance(logical_count, torch.Tensor):
|
130
|
+
logical_count = torch.tensor(logical_count)
|
131
|
+
if len(logical_count.shape) == 2:
|
132
|
+
logical_count = logical_count.unsqueeze(0)
|
133
|
+
logical_count = logical_count.to(server_args.device)
|
134
|
+
|
135
|
+
common = ExpertLocationMetadata._init_common(server_args, model_config)
|
136
|
+
model_config_for_expert_location = common["model_config_for_expert_location"]
|
137
|
+
num_physical_experts = common["num_physical_experts"]
|
138
|
+
num_groups = model_config_for_expert_location.num_groups
|
139
|
+
num_nodes = server_args.nnodes
|
140
|
+
|
141
|
+
physical_to_logical_map, logical_to_all_physical_map, expert_count = (
|
142
|
+
eplb_algorithms.rebalance_experts(
|
143
|
+
tokens_per_expert=logical_count,
|
144
|
+
num_physical_experts=num_physical_experts,
|
145
|
+
num_local_physical_experts=num_physical_experts // common["ep_size"],
|
146
|
+
num_groups=num_groups,
|
147
|
+
num_nodes=num_nodes,
|
148
|
+
algorithm=eplb_algorithms.compute_algorithm(
|
149
|
+
raw_algorithm=server_args.eplb_algorithm,
|
150
|
+
num_groups=num_groups,
|
151
|
+
num_nodes=num_nodes,
|
152
|
+
),
|
153
|
+
)
|
154
|
+
)
|
155
|
+
|
156
|
+
return ExpertLocationMetadata._init_raw(
|
157
|
+
server_args=server_args,
|
158
|
+
ep_size=common["ep_size"],
|
159
|
+
physical_to_logical_map=physical_to_logical_map.to(server_args.device),
|
160
|
+
logical_to_all_physical_map=logical_to_all_physical_map.to(
|
161
|
+
server_args.device
|
162
|
+
),
|
163
|
+
)
|
164
|
+
|
165
|
+
@staticmethod
|
166
|
+
def _init_common(server_args: ServerArgs, model_config: ModelConfig):
|
167
|
+
model_config_for_expert_location = (
|
168
|
+
ModelConfigForExpertLocation.from_model_config(model_config)
|
169
|
+
)
|
170
|
+
|
171
|
+
num_physical_experts = (
|
172
|
+
model_config_for_expert_location.num_logical_experts
|
173
|
+
+ server_args.ep_num_redundant_experts
|
174
|
+
)
|
175
|
+
ep_size = server_args.ep_size
|
176
|
+
assert num_physical_experts % ep_size == 0
|
177
|
+
num_local_physical_experts = num_physical_experts // ep_size
|
178
|
+
|
179
|
+
return dict(
|
180
|
+
model_config_for_expert_location=model_config_for_expert_location,
|
181
|
+
num_physical_experts=num_physical_experts,
|
182
|
+
num_local_physical_experts=num_local_physical_experts,
|
183
|
+
ep_size=ep_size,
|
184
|
+
)
|
185
|
+
|
186
|
+
@staticmethod
|
187
|
+
def _init_raw(
|
188
|
+
server_args: ServerArgs,
|
189
|
+
ep_size: int,
|
190
|
+
physical_to_logical_map: torch.Tensor,
|
191
|
+
logical_to_all_physical_map: torch.Tensor,
|
192
|
+
):
|
193
|
+
_, num_physical_experts = physical_to_logical_map.shape
|
194
|
+
|
195
|
+
logical_to_all_physical_map_padded = F.pad(
|
196
|
+
logical_to_all_physical_map,
|
197
|
+
(0, num_physical_experts - logical_to_all_physical_map.shape[-1]),
|
198
|
+
value=-1,
|
199
|
+
)
|
200
|
+
|
201
|
+
logical_to_all_physical_map_num_valid = torch.count_nonzero(
|
202
|
+
logical_to_all_physical_map != -1, dim=-1
|
203
|
+
)
|
204
|
+
|
205
|
+
return ExpertLocationMetadata(
|
206
|
+
physical_to_logical_map=physical_to_logical_map,
|
207
|
+
physical_to_logical_map_cpu=physical_to_logical_map.cpu(),
|
208
|
+
logical_to_all_physical_map=logical_to_all_physical_map_padded,
|
209
|
+
logical_to_all_physical_map_num_valid=logical_to_all_physical_map_num_valid,
|
210
|
+
logical_to_rank_dispatch_physical_map=(
|
211
|
+
compute_logical_to_rank_dispatch_physical_map(
|
212
|
+
logical_to_all_physical_map=logical_to_all_physical_map,
|
213
|
+
num_gpus=ep_size,
|
214
|
+
num_physical_experts=num_physical_experts,
|
215
|
+
# TODO improve when we have real EP rank
|
216
|
+
ep_rank=torch.distributed.get_rank() % ep_size,
|
217
|
+
)
|
218
|
+
if server_args.ep_dispatch_algorithm == "static"
|
219
|
+
else None
|
220
|
+
),
|
221
|
+
)
|
222
|
+
|
223
|
+
# -------------------------------- mutation ------------------------------------
|
224
|
+
|
225
|
+
def update(
|
226
|
+
self,
|
227
|
+
other: "ExpertLocationMetadata",
|
228
|
+
update_layer_ids: List[int],
|
229
|
+
):
|
230
|
+
for field in [
|
231
|
+
"ep_size",
|
232
|
+
]:
|
233
|
+
assert getattr(self, field) == getattr(other, field)
|
234
|
+
|
235
|
+
for field in [
|
236
|
+
"physical_to_logical_map",
|
237
|
+
"physical_to_logical_map_cpu",
|
238
|
+
"logical_to_all_physical_map",
|
239
|
+
"logical_to_all_physical_map_num_valid",
|
240
|
+
"logical_to_rank_dispatch_physical_map",
|
241
|
+
]:
|
242
|
+
other_field = getattr(other, field)
|
243
|
+
self_field = getattr(self, field)
|
244
|
+
assert (other_field is not None) == (self_field is not None)
|
245
|
+
if self_field is not None:
|
246
|
+
mask_update = torch.tensor(
|
247
|
+
[i in update_layer_ids for i in range(self.num_layers)]
|
248
|
+
)
|
249
|
+
mask_update = mask_update.view(*([-1] + [1] * (self_field.dim() - 1)))
|
250
|
+
mask_update = mask_update.to(self_field.device, non_blocking=True)
|
251
|
+
self_field[...] = torch.where(mask_update, other_field, self_field)
|
252
|
+
|
253
|
+
# -------------------------------- usage ------------------------------------
|
254
|
+
|
255
|
+
def logical_to_all_physical(
|
256
|
+
self, layer_id: int, logical_expert_id: int
|
257
|
+
) -> List[int]:
|
258
|
+
return [
|
259
|
+
physical_expert_id
|
260
|
+
for physical_expert_id in self.logical_to_all_physical_map[
|
261
|
+
layer_id, logical_expert_id
|
262
|
+
].tolist()
|
263
|
+
if physical_expert_id != -1
|
264
|
+
]
|
265
|
+
|
266
|
+
|
267
|
+
_global_expert_location_metadata: Optional[ExpertLocationMetadata] = None
|
268
|
+
|
269
|
+
|
270
|
+
def get_global_expert_location_metadata():
|
271
|
+
return _global_expert_location_metadata
|
272
|
+
|
273
|
+
|
274
|
+
def set_global_expert_location_metadata(value):
|
275
|
+
global _global_expert_location_metadata
|
276
|
+
assert _global_expert_location_metadata is None
|
277
|
+
_global_expert_location_metadata = value
|
278
|
+
|
279
|
+
|
280
|
+
def _compute_logical_to_all_physical_map(
|
281
|
+
physical_to_logical_map: torch.Tensor, num_logical_experts: int
|
282
|
+
):
|
283
|
+
# This is rarely called, so we use for loops for maximum clarity
|
284
|
+
|
285
|
+
num_layers, num_physical_experts = physical_to_logical_map.shape
|
286
|
+
|
287
|
+
logical_to_all_physical_map = [
|
288
|
+
[[] for _ in range(num_logical_experts)] for _ in range(num_layers)
|
289
|
+
]
|
290
|
+
for layer_id in range(num_layers):
|
291
|
+
for physical_expert_id in range(num_physical_experts):
|
292
|
+
logical_expert_id = physical_to_logical_map[
|
293
|
+
layer_id, physical_expert_id
|
294
|
+
].item()
|
295
|
+
logical_to_all_physical_map[layer_id][logical_expert_id].append(
|
296
|
+
physical_expert_id
|
297
|
+
)
|
298
|
+
|
299
|
+
logical_to_all_physical_map = _pad_nested_array(
|
300
|
+
logical_to_all_physical_map, pad_value=-1
|
301
|
+
)
|
302
|
+
|
303
|
+
return torch.tensor(
|
304
|
+
logical_to_all_physical_map, device=physical_to_logical_map.device
|
305
|
+
)
|
306
|
+
|
307
|
+
|
308
|
+
def _pad_nested_array(arr, pad_value):
|
309
|
+
max_len = max(len(inner) for outer in arr for inner in outer)
|
310
|
+
padded = [
|
311
|
+
[inner + [pad_value] * (max_len - len(inner)) for inner in outer]
|
312
|
+
for outer in arr
|
313
|
+
]
|
314
|
+
return padded
|
315
|
+
|
316
|
+
|
317
|
+
# TODO optimize performance (rewrite and/or run in separate process with overlap)
|
318
|
+
def compute_logical_to_rank_dispatch_physical_map(
|
319
|
+
logical_to_all_physical_map: torch.Tensor,
|
320
|
+
num_gpus: int,
|
321
|
+
num_physical_experts: int,
|
322
|
+
ep_rank: int,
|
323
|
+
seed: int = 42,
|
324
|
+
):
|
325
|
+
r = random.Random(seed)
|
326
|
+
|
327
|
+
num_local_physical_experts = num_physical_experts // num_gpus
|
328
|
+
num_layers, num_logical_experts, _ = logical_to_all_physical_map.shape
|
329
|
+
dtype = logical_to_all_physical_map.dtype
|
330
|
+
|
331
|
+
logical_to_rank_dispatch_physical_map = torch.full(
|
332
|
+
size=(num_gpus, num_layers, num_logical_experts),
|
333
|
+
fill_value=-1,
|
334
|
+
dtype=dtype,
|
335
|
+
)
|
336
|
+
|
337
|
+
for layer_id in range(num_layers):
|
338
|
+
for logical_expert_id in range(num_logical_experts):
|
339
|
+
candidate_physical_expert_ids = _logical_to_all_physical_raw(
|
340
|
+
logical_to_all_physical_map, layer_id, logical_expert_id
|
341
|
+
)
|
342
|
+
output_partial = logical_to_rank_dispatch_physical_map[
|
343
|
+
:, layer_id, logical_expert_id
|
344
|
+
]
|
345
|
+
|
346
|
+
for gpu_id in range(num_gpus):
|
347
|
+
same_gpu_physical_expert_ids = [
|
348
|
+
physical_expert_id
|
349
|
+
for physical_expert_id in candidate_physical_expert_ids
|
350
|
+
if _compute_gpu_id_of_physical_expert(
|
351
|
+
physical_expert_id, num_local_physical_experts
|
352
|
+
)
|
353
|
+
== gpu_id
|
354
|
+
]
|
355
|
+
if len(same_gpu_physical_expert_ids) > 0:
|
356
|
+
output_partial[gpu_id] = same_gpu_physical_expert_ids[0]
|
357
|
+
|
358
|
+
num_remain = torch.sum(output_partial == -1).item()
|
359
|
+
output_partial[output_partial == -1] = torch.tensor(
|
360
|
+
_fair_choices(candidate_physical_expert_ids, k=num_remain, r=r),
|
361
|
+
dtype=dtype,
|
362
|
+
)
|
363
|
+
|
364
|
+
assert torch.all(logical_to_rank_dispatch_physical_map != -1)
|
365
|
+
|
366
|
+
device = logical_to_all_physical_map.device
|
367
|
+
return logical_to_rank_dispatch_physical_map[ep_rank, :, :].to(device)
|
368
|
+
|
369
|
+
|
370
|
+
def _logical_to_all_physical_raw(
|
371
|
+
logical_to_all_physical_map, layer_id: int, logical_expert_id: int
|
372
|
+
) -> List[int]:
|
373
|
+
return [
|
374
|
+
physical_expert_id
|
375
|
+
for physical_expert_id in logical_to_all_physical_map[
|
376
|
+
layer_id, logical_expert_id
|
377
|
+
].tolist()
|
378
|
+
if physical_expert_id != -1
|
379
|
+
]
|
380
|
+
|
381
|
+
|
382
|
+
def _compute_gpu_id_of_physical_expert(
|
383
|
+
physical_expert_id: int, num_local_physical_experts: int
|
384
|
+
) -> int:
|
385
|
+
return physical_expert_id // num_local_physical_experts
|
386
|
+
|
387
|
+
|
388
|
+
def _fair_choices(arr: List, k: int, r: random.Random) -> List:
|
389
|
+
quotient, remainder = divmod(k, len(arr))
|
390
|
+
ans = arr * quotient + r.sample(arr, k=remainder)
|
391
|
+
r.shuffle(ans)
|
392
|
+
return ans
|
393
|
+
|
394
|
+
|
395
|
+
@dataclass
|
396
|
+
class ModelConfigForExpertLocation:
|
397
|
+
num_layers: int
|
398
|
+
num_logical_experts: int
|
399
|
+
num_groups: Optional[int] = None
|
400
|
+
|
401
|
+
@staticmethod
|
402
|
+
def init_dummy():
|
403
|
+
return ModelConfigForExpertLocation(num_layers=1, num_logical_experts=1)
|
404
|
+
|
405
|
+
@staticmethod
|
406
|
+
def from_model_config(model_config: ModelConfig):
|
407
|
+
model_class, _ = get_model_architecture(model_config)
|
408
|
+
if hasattr(model_class, "get_model_config_for_expert_location"):
|
409
|
+
return model_class.get_model_config_for_expert_location(
|
410
|
+
model_config.hf_config
|
411
|
+
)
|
412
|
+
else:
|
413
|
+
return ModelConfigForExpertLocation.init_dummy()
|
414
|
+
|
415
|
+
|
416
|
+
def compute_initial_expert_location_metadata(
|
417
|
+
server_args: ServerArgs, model_config: ModelConfig
|
418
|
+
) -> ExpertLocationMetadata:
|
419
|
+
data = server_args.init_expert_location
|
420
|
+
if data == "trivial":
|
421
|
+
return ExpertLocationMetadata.init_trivial(server_args, model_config)
|
422
|
+
|
423
|
+
# TODO unify with the utils function
|
424
|
+
if data.endswith(".pt"):
|
425
|
+
data_dict = torch.load(data, weights_only=True)
|
426
|
+
elif data.endswith(".json"):
|
427
|
+
data_dict = json.loads(Path(data).read_text())
|
428
|
+
else:
|
429
|
+
data_dict = json.loads(data)
|
430
|
+
|
431
|
+
if "physical_to_logical_map" in data_dict:
|
432
|
+
logger.info(
|
433
|
+
"init_expert_location from init_by_mapping using ServerArgs.init_expert_location"
|
434
|
+
)
|
435
|
+
return ExpertLocationMetadata.init_by_mapping(
|
436
|
+
server_args, model_config, **data_dict
|
437
|
+
)
|
438
|
+
elif "logical_count" in data_dict:
|
439
|
+
logger.info(
|
440
|
+
"init_expert_location from init_by_eplb using ServerArgs.init_expert_location"
|
441
|
+
)
|
442
|
+
return ExpertLocationMetadata.init_by_eplb(
|
443
|
+
server_args, model_config, logical_count=data_dict["logical_count"]
|
444
|
+
)
|
445
|
+
else:
|
446
|
+
raise NotImplementedError(
|
447
|
+
f"Unknown init_expert_location format ({list(data_dict.keys())=})"
|
448
|
+
)
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# Copyright 2023-2025 SGLang Team
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
# you may not use this file except in compliance with the License.
|
4
|
+
# You may obtain a copy of the License at
|
5
|
+
#
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
#
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
# See the License for the specific language governing permissions and
|
12
|
+
# limitations under the License.
|
13
|
+
# ==============================================================================
|
14
|
+
|
15
|
+
from dataclasses import dataclass
|
16
|
+
from typing import Literal, Optional
|
17
|
+
|
18
|
+
import torch
|
19
|
+
|
20
|
+
from sglang.srt.managers.expert_location import get_global_expert_location_metadata
|
21
|
+
from sglang.srt.managers.schedule_batch import global_server_args_dict
|
22
|
+
|
23
|
+
|
24
|
+
@dataclass
|
25
|
+
class ExpertLocationDispatchInfo:
|
26
|
+
ep_dispatch_algorithm: Literal["static", "random"]
|
27
|
+
# (num_logical_experts,)
|
28
|
+
partial_logical_to_rank_dispatch_physical_map: Optional[torch.Tensor]
|
29
|
+
# (num_logical_experts, X)
|
30
|
+
partial_logical_to_all_physical_map: torch.Tensor
|
31
|
+
# (num_logical_experts,)
|
32
|
+
partial_logical_to_all_physical_map_num_valid: torch.Tensor
|
33
|
+
num_physical_experts: int
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def init_new(cls, layer_id: int):
|
37
|
+
ep_dispatch_algorithm = global_server_args_dict["ep_dispatch_algorithm"]
|
38
|
+
expert_location_metadata = get_global_expert_location_metadata()
|
39
|
+
|
40
|
+
if ep_dispatch_algorithm is None:
|
41
|
+
return None
|
42
|
+
|
43
|
+
return cls(
|
44
|
+
ep_dispatch_algorithm=ep_dispatch_algorithm,
|
45
|
+
partial_logical_to_rank_dispatch_physical_map=(
|
46
|
+
expert_location_metadata.logical_to_rank_dispatch_physical_map[
|
47
|
+
layer_id, :
|
48
|
+
]
|
49
|
+
if expert_location_metadata.logical_to_rank_dispatch_physical_map
|
50
|
+
is not None
|
51
|
+
else None
|
52
|
+
),
|
53
|
+
partial_logical_to_all_physical_map=expert_location_metadata.logical_to_all_physical_map[
|
54
|
+
layer_id, :
|
55
|
+
],
|
56
|
+
partial_logical_to_all_physical_map_num_valid=expert_location_metadata.logical_to_all_physical_map_num_valid[
|
57
|
+
layer_id, :
|
58
|
+
],
|
59
|
+
num_physical_experts=expert_location_metadata.num_physical_experts,
|
60
|
+
)
|
61
|
+
|
62
|
+
|
63
|
+
def transform_select_experts_inputs(
|
64
|
+
router_logits: torch.Tensor,
|
65
|
+
correction_bias: Optional[torch.Tensor],
|
66
|
+
info: Optional[ExpertLocationDispatchInfo],
|
67
|
+
):
|
68
|
+
if (info is not None) and (info.ep_dispatch_algorithm == "fake"):
|
69
|
+
router_logits = torch.randn_like(router_logits)
|
70
|
+
if correction_bias is not None:
|
71
|
+
correction_bias = torch.zeros_like(correction_bias)
|
72
|
+
return router_logits, correction_bias
|
73
|
+
|
74
|
+
|
75
|
+
def topk_ids_logical_to_physical(
|
76
|
+
topk_ids: torch.Tensor, info: Optional[ExpertLocationDispatchInfo]
|
77
|
+
) -> torch.Tensor:
|
78
|
+
if info is None:
|
79
|
+
return topk_ids
|
80
|
+
|
81
|
+
if info.ep_dispatch_algorithm == "static":
|
82
|
+
return _topk_ids_logical_to_physical_static(topk_ids, info)
|
83
|
+
if info.ep_dispatch_algorithm in ["dynamic", "fake"]:
|
84
|
+
return _topk_ids_logical_to_physical_dynamic(topk_ids, info)
|
85
|
+
raise NotImplementedError(f"Unknown algorithm {info.ep_dispatch_algorithm}")
|
86
|
+
|
87
|
+
|
88
|
+
def _topk_ids_logical_to_physical_static(
|
89
|
+
topk_ids: torch.Tensor, info: Optional[ExpertLocationDispatchInfo]
|
90
|
+
) -> torch.Tensor:
|
91
|
+
return info.partial_logical_to_rank_dispatch_physical_map[topk_ids]
|
92
|
+
|
93
|
+
|
94
|
+
def _topk_ids_logical_to_physical_dynamic(
|
95
|
+
topk_ids: torch.Tensor, info: Optional[ExpertLocationDispatchInfo]
|
96
|
+
) -> torch.Tensor:
|
97
|
+
topk_ids_original_shape = topk_ids.shape
|
98
|
+
device = topk_ids.device
|
99
|
+
topk_ids = topk_ids.flatten()
|
100
|
+
|
101
|
+
chosen_dispatch_index = (
|
102
|
+
torch.randint(0, 65536, topk_ids.shape, dtype=torch.int32, device=device)
|
103
|
+
% info.partial_logical_to_all_physical_map_num_valid[topk_ids]
|
104
|
+
)
|
105
|
+
topk_ids = info.partial_logical_to_all_physical_map[topk_ids, chosen_dispatch_index]
|
106
|
+
|
107
|
+
topk_ids = topk_ids.view(topk_ids_original_shape)
|
108
|
+
return topk_ids
|
sglang/srt/managers/io_struct.py
CHANGED
@@ -20,7 +20,9 @@ import copy
|
|
20
20
|
import uuid
|
21
21
|
from dataclasses import dataclass, field
|
22
22
|
from enum import Enum
|
23
|
-
from typing import TYPE_CHECKING, Any, Dict, List,
|
23
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
|
24
|
+
|
25
|
+
from sglang.srt.mm_utils import has_valid_data
|
24
26
|
|
25
27
|
# handle serialization of Image for pydantic
|
26
28
|
if TYPE_CHECKING:
|
@@ -40,6 +42,10 @@ class SessionParams:
|
|
40
42
|
replace: Optional[bool] = None
|
41
43
|
|
42
44
|
|
45
|
+
AudioDataItem = Union[str, Dict]
|
46
|
+
ImageDataItem = Union[Image, str, Dict]
|
47
|
+
|
48
|
+
|
43
49
|
@dataclass
|
44
50
|
class GenerateReqInput:
|
45
51
|
# The input prompt. It can be a single prompt or a batch of prompts.
|
@@ -55,10 +61,10 @@ class GenerateReqInput:
|
|
55
61
|
# - List of lists of images (multiple images per request)
|
56
62
|
# See also python/sglang/srt/utils.py:load_image for more details.
|
57
63
|
image_data: Optional[
|
58
|
-
Union[List[List[
|
64
|
+
Union[List[List[ImageDataItem]], List[ImageDataItem], ImageDataItem]
|
59
65
|
] = None
|
60
66
|
# The audio input. Like image data, it can be a file name, a url, or base64 encoded string.
|
61
|
-
audio_data: Optional[Union[List[
|
67
|
+
audio_data: Optional[Union[List[AudioDataItem], AudioDataItem]] = None
|
62
68
|
# The sampling_params. See descriptions below.
|
63
69
|
sampling_params: Optional[Union[List[Dict], Dict]] = None
|
64
70
|
# The request id.
|
@@ -97,9 +103,15 @@ class GenerateReqInput:
|
|
97
103
|
|
98
104
|
# For disaggregated inference
|
99
105
|
bootstrap_host: Optional[Union[List[str], str]] = None
|
100
|
-
bootstrap_port: Optional[Union[List[int], int]] = None
|
106
|
+
bootstrap_port: Optional[Union[List[Optional[int]], int]] = None
|
101
107
|
bootstrap_room: Optional[Union[List[int], int]] = None
|
102
108
|
|
109
|
+
# For data parallel rank routing
|
110
|
+
data_parallel_rank: Optional[int] = None
|
111
|
+
|
112
|
+
def contains_mm_input(self) -> bool:
|
113
|
+
return has_valid_data(self.image_data) or has_valid_data(self.audio_data)
|
114
|
+
|
103
115
|
def normalize_batch_and_arguments(self):
|
104
116
|
"""
|
105
117
|
Normalize the batch size and arguments for the request.
|
@@ -398,6 +410,7 @@ class GenerateReqInput:
|
|
398
410
|
else None
|
399
411
|
),
|
400
412
|
return_hidden_states=self.return_hidden_states,
|
413
|
+
# if `__getitem__` is called, the bootstrap_host, bootstrap_port, bootstrap_room must be a list
|
401
414
|
bootstrap_host=(
|
402
415
|
self.bootstrap_host[i] if self.bootstrap_host is not None else None
|
403
416
|
),
|
@@ -407,6 +420,9 @@ class GenerateReqInput:
|
|
407
420
|
bootstrap_room=(
|
408
421
|
self.bootstrap_room[i] if self.bootstrap_room is not None else None
|
409
422
|
),
|
423
|
+
data_parallel_rank=(
|
424
|
+
self.data_parallel_rank if self.data_parallel_rank is not None else None
|
425
|
+
),
|
410
426
|
)
|
411
427
|
|
412
428
|
|
@@ -454,6 +470,9 @@ class TokenizedGenerateReqInput:
|
|
454
470
|
bootstrap_port: Optional[int] = None
|
455
471
|
bootstrap_room: Optional[int] = None
|
456
472
|
|
473
|
+
# For data parallel rank routing
|
474
|
+
data_parallel_rank: Optional[int] = None
|
475
|
+
|
457
476
|
|
458
477
|
@dataclass
|
459
478
|
class EmbeddingReqInput:
|
@@ -483,6 +502,9 @@ class EmbeddingReqInput:
|
|
483
502
|
# The modalities of the image data [image, multi-images, video]
|
484
503
|
modalities: Optional[List[str]] = None
|
485
504
|
|
505
|
+
def contains_mm_input(self) -> bool:
|
506
|
+
return has_valid_data(self.image_data) or has_valid_data(self.audio_data)
|
507
|
+
|
486
508
|
def normalize_batch_and_arguments(self):
|
487
509
|
# at least one of text, input_ids, or image should be provided
|
488
510
|
if self.text is None and self.input_ids is None and self.image_data is None:
|
@@ -835,7 +857,8 @@ class ProfileReqInput:
|
|
835
857
|
# If it is set, profiling is automatically stopped after this step, and
|
836
858
|
# the caller doesn't need to run stop_profile.
|
837
859
|
num_steps: Optional[int] = None
|
838
|
-
activities: Optional[List[
|
860
|
+
activities: Optional[List[str]] = None
|
861
|
+
profile_by_stage: bool = False
|
839
862
|
with_stack: Optional[bool] = None
|
840
863
|
record_shapes: Optional[bool] = None
|
841
864
|
|
@@ -862,6 +885,7 @@ class ProfileReq:
|
|
862
885
|
output_dir: Optional[str] = None
|
863
886
|
num_steps: Optional[int] = None
|
864
887
|
activities: Optional[List[str]] = None
|
888
|
+
profile_by_stage: bool = False
|
865
889
|
with_stack: Optional[bool] = None
|
866
890
|
record_shapes: Optional[bool] = None
|
867
891
|
profile_id: Optional[str] = None
|