sglang 0.4.6.post5__py3-none-any.whl → 0.4.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sglang/bench_offline_throughput.py +10 -4
- sglang/bench_one_batch_server.py +67 -11
- sglang/bench_serving.py +85 -74
- sglang/lang/backend/runtime_endpoint.py +24 -1
- sglang/profiler.py +167 -0
- sglang/srt/_custom_ops.py +34 -0
- sglang/srt/configs/internvl.py +8 -12
- sglang/srt/configs/model_config.py +27 -1
- sglang/srt/constrained/base_grammar_backend.py +5 -2
- sglang/srt/constrained/llguidance_backend.py +9 -8
- sglang/srt/constrained/outlines_backend.py +5 -4
- sglang/srt/constrained/xgrammar_backend.py +18 -18
- sglang/srt/conversation.py +46 -8
- sglang/srt/custom_op.py +38 -3
- sglang/srt/debug_utils.py +74 -0
- sglang/srt/disaggregation/common/__init__.py +1 -0
- sglang/srt/disaggregation/common/conn.py +407 -0
- sglang/srt/disaggregation/decode.py +67 -3
- sglang/srt/disaggregation/fake/conn.py +1 -0
- sglang/srt/disaggregation/kv_events.py +60 -5
- sglang/srt/disaggregation/launch_lb.py +140 -0
- sglang/srt/disaggregation/mini_lb.py +29 -48
- sglang/srt/disaggregation/mooncake/conn.py +432 -140
- sglang/srt/disaggregation/mooncake/transfer_engine.py +32 -16
- sglang/srt/disaggregation/nixl/conn.py +124 -432
- sglang/srt/disaggregation/prefill.py +2 -0
- sglang/srt/disaggregation/utils.py +38 -1
- sglang/srt/distributed/device_communicators/pymscclpp.py +315 -0
- sglang/srt/distributed/parallel_state.py +52 -5
- sglang/srt/entrypoints/EngineBase.py +6 -0
- sglang/srt/entrypoints/engine.py +102 -5
- sglang/srt/entrypoints/http_server.py +15 -2
- sglang/srt/function_call/base_format_detector.py +138 -86
- sglang/srt/function_call/deepseekv3_detector.py +54 -6
- sglang/srt/function_call/ebnf_composer.py +33 -19
- sglang/srt/function_call/function_call_parser.py +27 -0
- sglang/srt/function_call/llama32_detector.py +33 -14
- sglang/srt/function_call/mistral_detector.py +73 -26
- sglang/srt/function_call/pythonic_detector.py +86 -20
- sglang/srt/function_call/qwen25_detector.py +64 -10
- sglang/srt/function_call/utils.py +17 -0
- sglang/srt/hf_transformers_utils.py +4 -0
- sglang/srt/layers/attention/aiter_backend.py +488 -123
- sglang/srt/layers/attention/base_attn_backend.py +4 -0
- sglang/srt/layers/attention/cutlass_mla_backend.py +2 -19
- sglang/srt/layers/attention/flashattention_backend.py +103 -18
- sglang/srt/layers/attention/flashinfer_backend.py +45 -1
- sglang/srt/layers/attention/flashinfer_mla_backend.py +37 -1
- sglang/srt/layers/attention/intel_amx_backend.py +128 -0
- sglang/srt/layers/attention/tbo_backend.py +232 -0
- sglang/srt/layers/attention/torch_native_backend.py +3 -0
- sglang/srt/layers/attention/triton_backend.py +244 -5
- sglang/srt/layers/attention/triton_ops/extend_attention.py +12 -4
- sglang/srt/layers/communicator.py +260 -194
- sglang/srt/layers/dp_attention.py +6 -5
- sglang/srt/layers/layernorm.py +30 -19
- sglang/srt/layers/moe/cutlass_moe.py +170 -7
- sglang/srt/layers/moe/cutlass_moe_params.py +169 -0
- sglang/srt/layers/moe/ep_moe/kernels.py +27 -6
- sglang/srt/layers/moe/ep_moe/layer.py +94 -40
- sglang/srt/layers/moe/ep_moe/token_dispatcher.py +13 -8
- sglang/srt/layers/moe/fused_moe_native.py +4 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_3_1/E=257,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_3_1/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/fused_moe.py +220 -25
- sglang/srt/layers/moe/fused_moe_triton/layer.py +34 -4
- sglang/srt/layers/moe/topk.py +44 -18
- sglang/srt/layers/multimodal.py +3 -3
- sglang/srt/layers/quantization/__init__.py +3 -2
- sglang/srt/layers/quantization/blockwise_int8.py +3 -0
- sglang/srt/layers/quantization/compressed_tensors/compressed_tensors_moe.py +5 -0
- sglang/srt/layers/quantization/deep_gemm.py +55 -56
- sglang/srt/layers/quantization/fp8.py +28 -23
- sglang/srt/layers/quantization/fp8_kernel.py +118 -66
- sglang/srt/layers/quantization/fp8_utils.py +165 -49
- sglang/srt/layers/quantization/modelopt_quant.py +334 -7
- sglang/srt/layers/quantization/moe_wna16.py +3 -0
- sglang/srt/layers/quantization/w8a8_fp8.py +3 -0
- sglang/srt/layers/quantization/w8a8_int8.py +3 -0
- sglang/srt/layers/rotary_embedding.py +6 -12
- sglang/srt/layers/sampler.py +80 -79
- sglang/srt/layers/utils.py +6 -0
- sglang/srt/lora/layers.py +12 -15
- sglang/srt/lora/lora.py +49 -5
- sglang/srt/lora/lora_manager.py +19 -5
- sglang/srt/lora/mem_pool.py +24 -16
- sglang/srt/lora/utils.py +17 -13
- sglang/srt/managers/data_parallel_controller.py +13 -5
- sglang/srt/managers/eplb_algorithms/__init__.py +63 -0
- sglang/srt/managers/eplb_algorithms/deepseek.py +223 -0
- sglang/srt/managers/{deepseek_eplb.py → eplb_algorithms/deepseek_vec.py} +5 -7
- sglang/srt/managers/eplb_manager.py +55 -14
- sglang/srt/managers/expert_distribution.py +220 -46
- sglang/srt/managers/expert_location.py +110 -56
- sglang/srt/managers/expert_location_dispatch.py +23 -6
- sglang/srt/managers/io_struct.py +15 -4
- sglang/srt/managers/mm_utils.py +88 -38
- sglang/srt/managers/multimodal_processors/base_processor.py +188 -16
- sglang/srt/managers/multimodal_processors/gemma3.py +4 -31
- sglang/srt/managers/multimodal_processors/internvl.py +4 -0
- sglang/srt/managers/multimodal_processors/kimi_vl.py +15 -34
- sglang/srt/managers/multimodal_processors/minicpm.py +2 -1
- sglang/srt/managers/multimodal_processors/phi4mm.py +87 -0
- sglang/srt/managers/multimodal_processors/qwen_vl.py +22 -64
- sglang/srt/managers/schedule_batch.py +140 -38
- sglang/srt/managers/scheduler.py +305 -112
- sglang/srt/managers/tokenizer_manager.py +134 -17
- sglang/srt/managers/utils.py +0 -4
- sglang/srt/metrics/collector.py +9 -0
- sglang/srt/model_executor/cuda_graph_runner.py +72 -61
- sglang/srt/model_executor/expert_location_updater.py +157 -22
- sglang/srt/model_executor/forward_batch_info.py +38 -17
- sglang/srt/model_executor/model_runner.py +96 -56
- sglang/srt/model_loader/utils.py +67 -1
- sglang/srt/models/deepseek_nextn.py +1 -1
- sglang/srt/models/deepseek_v2.py +609 -234
- sglang/srt/models/gemma3_causal.py +7 -0
- sglang/srt/models/gemma3_mm.py +19 -14
- sglang/srt/models/idefics2.py +342 -0
- sglang/srt/models/kimi_vl.py +4 -4
- sglang/srt/models/llama.py +1 -1
- sglang/srt/models/minicpmo.py +2 -5
- sglang/srt/models/minicpmv.py +3 -295
- sglang/srt/models/phi4mm.py +512 -0
- sglang/srt/models/qwen2.py +38 -9
- sglang/srt/models/qwen2_5_vl.py +3 -9
- sglang/srt/models/qwen2_eagle.py +4 -1
- sglang/srt/models/qwen2_moe.py +58 -191
- sglang/srt/models/qwen2_vl.py +3 -9
- sglang/srt/models/qwen3.py +41 -10
- sglang/srt/models/qwen3_moe.py +230 -191
- sglang/srt/models/registry.py +9 -1
- sglang/srt/models/transformers.py +291 -0
- sglang/srt/openai_api/adapter.py +86 -24
- sglang/srt/openai_api/protocol.py +31 -2
- sglang/srt/openai_api/utils.py +172 -0
- sglang/srt/operations.py +37 -2
- sglang/srt/operations_strategy.py +200 -24
- sglang/srt/sampling/sampling_batch_info.py +13 -1
- sglang/srt/sampling/sampling_params.py +2 -1
- sglang/srt/server_args.py +114 -27
- sglang/srt/speculative/build_eagle_tree.py +8 -8
- sglang/srt/speculative/eagle_draft_cuda_graph_runner.py +8 -11
- sglang/srt/speculative/eagle_draft_extend_cuda_graph_runner.py +253 -0
- sglang/srt/speculative/eagle_utils.py +51 -91
- sglang/srt/speculative/eagle_worker.py +101 -21
- sglang/srt/two_batch_overlap.py +635 -0
- sglang/srt/utils.py +129 -7
- sglang/test/runners.py +16 -7
- sglang/test/send_one.py +4 -0
- sglang/test/test_cutlass_moe.py +3 -3
- sglang/test/test_fp4_moe.py +248 -0
- sglang/test/test_utils.py +79 -6
- sglang/version.py +1 -1
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/METADATA +14 -11
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/RECORD +318 -291
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/WHEEL +1 -1
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=144,N=512,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=144,N=512,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1024,device_name=NVIDIA_H200.json → triton_3_1_0/E=16,N=1024,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=20,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=20,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=24,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=24,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H20,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H20,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_L20,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_L20,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_L40S,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_L40S,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=64,N=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=64,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_L40S.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_L40S.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=96,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=96,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_2_0/E=264,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=272,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=288,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=288,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/licenses/LICENSE +0 -0
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.dist-info}/top_level.txt +0 -0
sglang/srt/models/qwen3_moe.py
CHANGED
@@ -18,15 +18,10 @@
|
|
18
18
|
"""Inference-only Qwen3MoE model compatible with HuggingFace weights."""
|
19
19
|
|
20
20
|
import logging
|
21
|
-
from dataclasses import dataclass
|
22
|
-
from enum import Enum, auto
|
23
|
-
from functools import partial
|
24
21
|
from typing import Any, Dict, Iterable, Optional, Tuple
|
25
22
|
|
26
23
|
import torch
|
27
|
-
import torch.nn.functional as F
|
28
24
|
from torch import nn
|
29
|
-
from transformers.configuration_utils import PretrainedConfig
|
30
25
|
|
31
26
|
from sglang.srt.distributed import (
|
32
27
|
get_pp_group,
|
@@ -38,6 +33,7 @@ from sglang.srt.distributed import (
|
|
38
33
|
tensor_model_parallel_all_reduce,
|
39
34
|
)
|
40
35
|
from sglang.srt.layers.activation import SiluAndMul
|
36
|
+
from sglang.srt.layers.communicator import LayerCommunicator, LayerScatterModes
|
41
37
|
from sglang.srt.layers.dp_attention import (
|
42
38
|
attn_tp_all_gather,
|
43
39
|
attn_tp_reduce_scatter,
|
@@ -67,6 +63,9 @@ from sglang.srt.layers.vocab_parallel_embedding import (
|
|
67
63
|
ParallelLMHead,
|
68
64
|
VocabParallelEmbedding,
|
69
65
|
)
|
66
|
+
from sglang.srt.managers.expert_distribution import (
|
67
|
+
get_global_expert_distribution_recorder,
|
68
|
+
)
|
70
69
|
from sglang.srt.managers.expert_location import ModelConfigForExpertLocation
|
71
70
|
from sglang.srt.managers.expert_location_dispatch import ExpertLocationDispatchInfo
|
72
71
|
from sglang.srt.managers.schedule_batch import global_server_args_dict
|
@@ -78,7 +77,8 @@ from sglang.srt.model_executor.forward_batch_info import (
|
|
78
77
|
from sglang.srt.model_loader.weight_utils import default_weight_loader
|
79
78
|
from sglang.srt.models.qwen2_moe import Qwen2MoeMLP as Qwen3MoeMLP
|
80
79
|
from sglang.srt.models.qwen2_moe import Qwen2MoeModel
|
81
|
-
from sglang.srt.
|
80
|
+
from sglang.srt.two_batch_overlap import MaybeTboDeepEPDispatcher
|
81
|
+
from sglang.srt.utils import DeepEPMode, add_prefix, is_non_idle_and_non_empty
|
82
82
|
|
83
83
|
Qwen3MoeConfig = None
|
84
84
|
|
@@ -136,7 +136,7 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
|
|
136
136
|
self.top_k = config.num_experts_per_tok
|
137
137
|
self.renormalize = config.norm_topk_prob
|
138
138
|
|
139
|
-
self.deepep_dispatcher =
|
139
|
+
self.deepep_dispatcher = MaybeTboDeepEPDispatcher(
|
140
140
|
group=parallel_state.get_tp_group().device_group,
|
141
141
|
router_topk=self.top_k,
|
142
142
|
permute_fusion=True,
|
@@ -150,13 +150,13 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
|
|
150
150
|
)
|
151
151
|
|
152
152
|
def forward(
|
153
|
-
self, hidden_states: torch.Tensor,
|
153
|
+
self, hidden_states: torch.Tensor, forward_batch: Optional[ForwardBatch] = None
|
154
154
|
) -> torch.Tensor:
|
155
155
|
|
156
156
|
if not global_server_args_dict["enable_deepep_moe"]:
|
157
157
|
return self.forward_normal(hidden_states)
|
158
158
|
else:
|
159
|
-
return self.forward_deepep(hidden_states,
|
159
|
+
return self.forward_deepep(hidden_states, forward_batch)
|
160
160
|
|
161
161
|
def get_moe_weights(self):
|
162
162
|
return [
|
@@ -180,13 +180,10 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
|
|
180
180
|
return final_hidden_states.view(num_tokens, hidden_dim)
|
181
181
|
|
182
182
|
def forward_deepep(
|
183
|
-
self, hidden_states: torch.Tensor,
|
183
|
+
self, hidden_states: torch.Tensor, forward_batch: ForwardBatch
|
184
184
|
) -> torch.Tensor:
|
185
|
-
|
186
|
-
|
187
|
-
and not forward_mode.is_idle()
|
188
|
-
and hidden_states.shape[0] > 0
|
189
|
-
):
|
185
|
+
forward_mode = forward_batch.forward_mode
|
186
|
+
if is_non_idle_and_non_empty(forward_mode, hidden_states):
|
190
187
|
# router_logits: (num_tokens, n_experts)
|
191
188
|
router_logits, _ = self.gate(hidden_states)
|
192
189
|
|
@@ -196,6 +193,7 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
|
|
196
193
|
top_k=self.top_k,
|
197
194
|
use_grouped_topk=False,
|
198
195
|
renormalize=self.renormalize,
|
196
|
+
num_token_non_padded=forward_batch.num_token_non_padded,
|
199
197
|
expert_location_dispatch_info=ExpertLocationDispatchInfo.init_new(
|
200
198
|
layer_id=self.layer_id,
|
201
199
|
),
|
@@ -219,9 +217,9 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
|
|
219
217
|
masked_m,
|
220
218
|
expected_m,
|
221
219
|
) = self.deepep_dispatcher.dispatch(
|
222
|
-
hidden_states,
|
223
|
-
topk_idx,
|
224
|
-
topk_weights,
|
220
|
+
hidden_states=hidden_states,
|
221
|
+
topk_idx=topk_idx,
|
222
|
+
topk_weights=topk_weights,
|
225
223
|
forward_mode=forward_mode,
|
226
224
|
)
|
227
225
|
final_hidden_states = self.experts(
|
@@ -237,13 +235,109 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
|
|
237
235
|
)
|
238
236
|
if self.ep_size > 1:
|
239
237
|
final_hidden_states = self.deepep_dispatcher.combine(
|
240
|
-
final_hidden_states,
|
241
|
-
topk_idx,
|
242
|
-
topk_weights,
|
243
|
-
forward_mode,
|
238
|
+
hidden_states=final_hidden_states,
|
239
|
+
topk_idx=topk_idx,
|
240
|
+
topk_weights=topk_weights,
|
241
|
+
forward_mode=forward_mode,
|
244
242
|
)
|
245
243
|
return final_hidden_states
|
246
244
|
|
245
|
+
def op_gate(self, state):
|
246
|
+
if is_non_idle_and_non_empty(
|
247
|
+
state.forward_batch.forward_mode, state.hidden_states_mlp_input
|
248
|
+
):
|
249
|
+
# router_logits: (num_tokens, n_experts)
|
250
|
+
state.router_logits, _ = self.gate(state.hidden_states_mlp_input)
|
251
|
+
else:
|
252
|
+
state.router_logits = None
|
253
|
+
|
254
|
+
def op_select_experts(self, state):
|
255
|
+
router_logits = state.pop("router_logits")
|
256
|
+
hidden_states = state.hidden_states_mlp_input
|
257
|
+
if router_logits is not None:
|
258
|
+
with get_global_expert_distribution_recorder().with_current_layer(
|
259
|
+
self.layer_id
|
260
|
+
):
|
261
|
+
state.topk_weights_local, state.topk_idx_local = select_experts(
|
262
|
+
hidden_states=hidden_states,
|
263
|
+
router_logits=router_logits,
|
264
|
+
top_k=self.top_k,
|
265
|
+
use_grouped_topk=False,
|
266
|
+
renormalize=self.renormalize,
|
267
|
+
num_token_non_padded=state.forward_batch.num_token_non_padded,
|
268
|
+
expert_location_dispatch_info=ExpertLocationDispatchInfo.init_new(
|
269
|
+
layer_id=self.layer_id,
|
270
|
+
),
|
271
|
+
)
|
272
|
+
else:
|
273
|
+
state.topk_idx_local = torch.full(
|
274
|
+
(0, self.top_k), -1, dtype=torch.int, device=hidden_states.device
|
275
|
+
)
|
276
|
+
state.topk_weights_local = torch.empty(
|
277
|
+
(0, self.top_k), dtype=torch.float32, device=hidden_states.device
|
278
|
+
)
|
279
|
+
|
280
|
+
def op_dispatch_a(self, state):
|
281
|
+
if self.ep_size > 1:
|
282
|
+
# TODO(ch-wan): allow users to set num_max_dispatch_tokens_per_rank value
|
283
|
+
self.deepep_dispatcher.dispatch_a(
|
284
|
+
hidden_states=state.pop("hidden_states_mlp_input"),
|
285
|
+
topk_idx=state.pop("topk_idx_local"),
|
286
|
+
topk_weights=state.pop("topk_weights_local"),
|
287
|
+
forward_mode=state.forward_batch.forward_mode,
|
288
|
+
tbo_subbatch_index=state.get("tbo_subbatch_index"),
|
289
|
+
)
|
290
|
+
|
291
|
+
def op_dispatch_b(self, state):
|
292
|
+
if self.ep_size > 1:
|
293
|
+
with get_global_expert_distribution_recorder().with_current_layer(
|
294
|
+
self.layer_id
|
295
|
+
):
|
296
|
+
(
|
297
|
+
state.hidden_states_experts_input,
|
298
|
+
state.topk_idx_dispatched,
|
299
|
+
state.topk_weights_dispatched,
|
300
|
+
state.reorder_topk_ids,
|
301
|
+
state.num_recv_tokens_per_expert,
|
302
|
+
state.seg_indptr,
|
303
|
+
state.masked_m,
|
304
|
+
state.expected_m,
|
305
|
+
) = self.deepep_dispatcher.dispatch_b(
|
306
|
+
tbo_subbatch_index=state.get("tbo_subbatch_index"),
|
307
|
+
)
|
308
|
+
|
309
|
+
def op_experts(self, state):
|
310
|
+
state.hidden_states_experts_output = self.experts(
|
311
|
+
hidden_states=state.pop("hidden_states_experts_input"),
|
312
|
+
topk_idx=state.topk_idx_dispatched,
|
313
|
+
topk_weights=state.topk_weights_dispatched,
|
314
|
+
reorder_topk_ids=state.pop("reorder_topk_ids"),
|
315
|
+
seg_indptr=state.pop("seg_indptr"),
|
316
|
+
masked_m=state.pop("masked_m"),
|
317
|
+
expected_m=state.pop("expected_m"),
|
318
|
+
num_recv_tokens_per_expert=state.pop("num_recv_tokens_per_expert"),
|
319
|
+
forward_mode=state.forward_batch.forward_mode,
|
320
|
+
)
|
321
|
+
|
322
|
+
def op_combine_a(self, state):
|
323
|
+
if self.ep_size > 1:
|
324
|
+
self.deepep_dispatcher.combine_a(
|
325
|
+
hidden_states=state.pop("hidden_states_experts_output"),
|
326
|
+
topk_idx=state.pop("topk_idx_dispatched"),
|
327
|
+
topk_weights=state.pop("topk_weights_dispatched"),
|
328
|
+
forward_mode=state.forward_batch.forward_mode,
|
329
|
+
tbo_subbatch_index=state.get("tbo_subbatch_index"),
|
330
|
+
)
|
331
|
+
|
332
|
+
def op_combine_b(self, state):
|
333
|
+
if self.ep_size > 1:
|
334
|
+
state.hidden_states_after_combine = self.deepep_dispatcher.combine_b(
|
335
|
+
tbo_subbatch_index=state.get("tbo_subbatch_index"),
|
336
|
+
)
|
337
|
+
|
338
|
+
def op_output(self, state):
|
339
|
+
state.hidden_states_mlp_output = state.pop("hidden_states_after_combine")
|
340
|
+
|
247
341
|
|
248
342
|
class Qwen3MoeAttention(nn.Module):
|
249
343
|
def __init__(
|
@@ -341,32 +435,53 @@ class Qwen3MoeAttention(nn.Module):
|
|
341
435
|
k = k_by_head.view(k.shape)
|
342
436
|
return q, k
|
343
437
|
|
344
|
-
def
|
438
|
+
def op_prepare(self, state):
|
439
|
+
state.attn_intermediate_state = self.forward_prepare(
|
440
|
+
positions=state.positions,
|
441
|
+
hidden_states=state.pop("hidden_states_after_comm_pre_attn"),
|
442
|
+
forward_batch=state.forward_batch,
|
443
|
+
)
|
444
|
+
|
445
|
+
def op_core(self, state):
|
446
|
+
state.hidden_states_after_attn = self.forward_core(
|
447
|
+
state.pop("attn_intermediate_state")
|
448
|
+
)
|
449
|
+
|
450
|
+
def forward_prepare(
|
345
451
|
self,
|
346
452
|
positions: torch.Tensor,
|
347
453
|
hidden_states: torch.Tensor,
|
348
454
|
forward_batch: ForwardBatch,
|
349
|
-
)
|
455
|
+
):
|
456
|
+
if hidden_states.shape[0] == 0:
|
457
|
+
return hidden_states, forward_batch, None
|
350
458
|
qkv, _ = self.qkv_proj(hidden_states)
|
351
459
|
q, k, v = qkv.split([self.q_size, self.kv_size, self.kv_size], dim=-1)
|
352
460
|
q, k = self._apply_qk_norm(q, k)
|
353
461
|
q, k = self.rotary_emb(positions, q, k)
|
354
|
-
|
462
|
+
inner_state = q, k, v, forward_batch
|
463
|
+
return None, forward_batch, inner_state
|
464
|
+
|
465
|
+
def forward_core(self, intermediate_state):
|
466
|
+
hidden_states, forward_batch, inner_state = intermediate_state
|
467
|
+
if inner_state is None:
|
468
|
+
return hidden_states
|
469
|
+
attn_output = self.attn(*inner_state)
|
355
470
|
output, _ = self.o_proj(attn_output)
|
356
471
|
return output
|
357
472
|
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
473
|
+
def forward(
|
474
|
+
self,
|
475
|
+
positions: torch.Tensor,
|
476
|
+
hidden_states: torch.Tensor,
|
477
|
+
forward_batch: ForwardBatch,
|
478
|
+
) -> torch.Tensor:
|
479
|
+
s = self.forward_prepare(
|
480
|
+
positions=positions,
|
481
|
+
hidden_states=hidden_states,
|
482
|
+
forward_batch=forward_batch,
|
483
|
+
)
|
484
|
+
return self.forward_core(s)
|
370
485
|
|
371
486
|
|
372
487
|
class Qwen3MoeDecoderLayer(nn.Module):
|
@@ -378,6 +493,7 @@ class Qwen3MoeDecoderLayer(nn.Module):
|
|
378
493
|
prefix: str = "",
|
379
494
|
) -> None:
|
380
495
|
super().__init__()
|
496
|
+
self.config = config
|
381
497
|
self.hidden_size = config.hidden_size
|
382
498
|
rope_theta = getattr(config, "rope_theta", 10000)
|
383
499
|
rope_scaling = getattr(config, "rope_scaling", None)
|
@@ -408,15 +524,18 @@ class Qwen3MoeDecoderLayer(nn.Module):
|
|
408
524
|
self.attn_tp_rank = get_attention_tp_rank()
|
409
525
|
self.local_dp_size = get_local_attention_dp_size()
|
410
526
|
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
527
|
+
# Qwen3MoE all layers are sparse and have no nextn now
|
528
|
+
self.is_layer_sparse = True
|
529
|
+
is_previous_layer_sparse = True
|
530
|
+
|
531
|
+
self.layer_scatter_modes = LayerScatterModes.init_new(
|
532
|
+
layer_id=layer_id,
|
533
|
+
num_layers=config.num_hidden_layers,
|
534
|
+
is_layer_sparse=self.is_layer_sparse,
|
535
|
+
is_previous_layer_sparse=is_previous_layer_sparse,
|
416
536
|
)
|
417
|
-
self.is_last_layer = self.layer_id == config.num_hidden_layers - 1
|
418
537
|
|
419
|
-
if self.
|
538
|
+
if self.is_layer_sparse:
|
420
539
|
self.mlp = Qwen3MoeSparseMoeBlock(
|
421
540
|
layer_id=self.layer_id,
|
422
541
|
config=config,
|
@@ -436,26 +555,11 @@ class Qwen3MoeDecoderLayer(nn.Module):
|
|
436
555
|
config.hidden_size, eps=config.rms_norm_eps
|
437
556
|
)
|
438
557
|
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
@staticmethod
|
444
|
-
def _compute_info(config: PretrainedConfig, layer_id: int):
|
445
|
-
# WARN: Qwen3MOE has no dense_layer, it is only for compatibility.
|
446
|
-
mlp_only_layers = (
|
447
|
-
[] if not hasattr(config, "mlp_only_layers") else config.mlp_only_layers
|
448
|
-
)
|
449
|
-
is_sparse = (layer_id not in mlp_only_layers) and (
|
450
|
-
config.num_experts > 0 and (layer_id + 1) % config.decoder_sparse_step == 0
|
451
|
-
)
|
452
|
-
ffn_input_mode = (
|
453
|
-
_FFNInputMode.SCATTERED
|
454
|
-
if (global_server_args_dict["enable_deepep_moe"] and is_sparse)
|
455
|
-
or (Qwen3MoeDecoderLayer._enable_moe_dense_fully_dp() and not is_sparse)
|
456
|
-
else _FFNInputMode.FULL
|
558
|
+
self.layer_communicator = LayerCommunicator(
|
559
|
+
layer_scatter_modes=self.layer_scatter_modes,
|
560
|
+
input_layernorm=self.input_layernorm,
|
561
|
+
post_attention_layernorm=self.post_attention_layernorm,
|
457
562
|
)
|
458
|
-
return _DecoderLayerInfo(is_sparse=is_sparse, ffn_input_mode=ffn_input_mode)
|
459
563
|
|
460
564
|
def forward(
|
461
565
|
self,
|
@@ -464,155 +568,88 @@ class Qwen3MoeDecoderLayer(nn.Module):
|
|
464
568
|
forward_batch: ForwardBatch,
|
465
569
|
residual: Optional[torch.Tensor],
|
466
570
|
) -> Tuple[torch.Tensor, torch.Tensor]:
|
467
|
-
if self.info.ffn_input_mode == _FFNInputMode.SCATTERED:
|
468
|
-
return self.forward_ffn_with_scattered_input(
|
469
|
-
positions, hidden_states, forward_batch, residual
|
470
|
-
)
|
471
|
-
elif self.info.ffn_input_mode == _FFNInputMode.FULL:
|
472
|
-
return self.forward_ffn_with_full_input(
|
473
|
-
positions, hidden_states, forward_batch, residual
|
474
|
-
)
|
475
|
-
else:
|
476
|
-
raise NotImplementedError
|
477
571
|
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
hidden_states: torch.Tensor,
|
482
|
-
forward_batch: ForwardBatch,
|
483
|
-
residual: Optional[torch.Tensor],
|
484
|
-
) -> Tuple[torch.Tensor, torch.Tensor]:
|
485
|
-
if hidden_states.shape[0] == 0:
|
486
|
-
residual = hidden_states
|
487
|
-
else:
|
488
|
-
if residual is None:
|
489
|
-
residual = hidden_states
|
490
|
-
hidden_states = self.input_layernorm(hidden_states)
|
491
|
-
else:
|
492
|
-
hidden_states, residual = self.input_layernorm(hidden_states, residual)
|
572
|
+
hidden_states, residual = self.layer_communicator.prepare_attn(
|
573
|
+
hidden_states, residual, forward_batch
|
574
|
+
)
|
493
575
|
|
494
|
-
|
576
|
+
if hidden_states.shape[0] != 0:
|
495
577
|
hidden_states = self.self_attn(
|
496
578
|
positions=positions,
|
497
579
|
hidden_states=hidden_states,
|
498
580
|
forward_batch=forward_batch,
|
499
581
|
)
|
500
|
-
# Gather
|
501
|
-
if get_tensor_model_parallel_world_size() > 1:
|
502
|
-
if self.local_dp_size != 1:
|
503
|
-
if self.attn_tp_rank == 0:
|
504
|
-
hidden_states += residual
|
505
|
-
hidden_states, local_hidden_states = (
|
506
|
-
forward_batch.gathered_buffer,
|
507
|
-
hidden_states,
|
508
|
-
)
|
509
|
-
dp_gather_partial(hidden_states, local_hidden_states, forward_batch)
|
510
|
-
dp_scatter(residual, hidden_states, forward_batch)
|
511
|
-
hidden_states = self.post_attention_layernorm(hidden_states)
|
512
|
-
else:
|
513
|
-
hidden_states = tensor_model_parallel_all_reduce(hidden_states)
|
514
|
-
# TODO extract this bugfix
|
515
|
-
if hidden_states.shape[0] != 0:
|
516
|
-
hidden_states, residual = self.post_attention_layernorm(
|
517
|
-
hidden_states, residual
|
518
|
-
)
|
519
|
-
elif hidden_states.shape[0] != 0:
|
520
|
-
hidden_states, residual = self.post_attention_layernorm(
|
521
|
-
hidden_states, residual
|
522
|
-
)
|
523
582
|
|
524
|
-
|
525
|
-
|
583
|
+
hidden_states, residual = self.layer_communicator.prepare_mlp(
|
584
|
+
hidden_states, residual, forward_batch
|
585
|
+
)
|
526
586
|
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
hidden_states, global_hidden_states = (
|
533
|
-
forward_batch.gathered_buffer[: forward_batch.input_ids.shape[0]],
|
534
|
-
hidden_states,
|
535
|
-
)
|
536
|
-
dp_scatter(hidden_states, global_hidden_states, forward_batch)
|
587
|
+
hidden_states = self.mlp(hidden_states, forward_batch)
|
588
|
+
|
589
|
+
hidden_states, residual = self.layer_communicator.postprocess_layer(
|
590
|
+
hidden_states, residual, forward_batch
|
591
|
+
)
|
537
592
|
|
538
593
|
return hidden_states, residual
|
539
594
|
|
540
|
-
def
|
595
|
+
def op_comm_prepare_attn(
|
541
596
|
self,
|
597
|
+
state,
|
542
598
|
positions: torch.Tensor,
|
543
599
|
hidden_states: torch.Tensor,
|
544
600
|
forward_batch: ForwardBatch,
|
545
601
|
residual: Optional[torch.Tensor],
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
if self.attn_tp_size != 1 and self.input_is_scattered:
|
557
|
-
hidden_states, local_hidden_states = (
|
558
|
-
forward_batch.gathered_buffer[: forward_batch.input_ids.shape[0]],
|
559
|
-
hidden_states,
|
560
|
-
)
|
561
|
-
attn_tp_all_gather(
|
562
|
-
list(hidden_states.tensor_split(self.attn_tp_size)), local_hidden_states
|
602
|
+
tbo_subbatch_index: Optional[int] = None,
|
603
|
+
):
|
604
|
+
state.hidden_states_after_comm_pre_attn, state.residual_after_input_ln = (
|
605
|
+
self.layer_communicator.prepare_attn(hidden_states, residual, forward_batch)
|
606
|
+
)
|
607
|
+
state.update(
|
608
|
+
dict(
|
609
|
+
forward_batch=forward_batch,
|
610
|
+
positions=positions,
|
611
|
+
tbo_subbatch_index=tbo_subbatch_index,
|
563
612
|
)
|
613
|
+
)
|
564
614
|
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
forward_batch
|
615
|
+
def op_comm_prepare_mlp(self, state):
|
616
|
+
state.hidden_states_mlp_input, state.residual_after_comm_pre_mlp = (
|
617
|
+
self.layer_communicator.prepare_mlp(
|
618
|
+
state.pop("hidden_states_after_attn"),
|
619
|
+
state.pop("residual_after_input_ln"),
|
620
|
+
state.forward_batch,
|
571
621
|
)
|
622
|
+
)
|
572
623
|
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
if hidden_states.shape[0] != 0:
|
579
|
-
hidden_states, residual = self.post_attention_layernorm(
|
580
|
-
hidden_states, residual
|
581
|
-
)
|
582
|
-
else:
|
583
|
-
if self.attn_tp_rank == 0:
|
584
|
-
hidden_states += residual
|
585
|
-
tensor_list = list(hidden_states.tensor_split(self.attn_tp_size))
|
586
|
-
hidden_states = tensor_list[self.attn_tp_rank]
|
587
|
-
attn_tp_reduce_scatter(hidden_states, tensor_list)
|
588
|
-
residual = hidden_states
|
589
|
-
if hidden_states.shape[0] != 0:
|
590
|
-
hidden_states = self.post_attention_layernorm(hidden_states)
|
591
|
-
else:
|
592
|
-
if hidden_states.shape[0] != 0:
|
593
|
-
hidden_states, residual = self.post_attention_layernorm(
|
594
|
-
hidden_states, residual
|
595
|
-
)
|
624
|
+
def op_mlp(self, state):
|
625
|
+
hidden_states = state.pop("hidden_states_mlp_input")
|
626
|
+
state.hidden_states_mlp_output = self.mlp(
|
627
|
+
hidden_states, state.forward_batch.forward_mode
|
628
|
+
)
|
596
629
|
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
630
|
+
def op_comm_postprocess_layer(self, state):
|
631
|
+
hidden_states, residual = self.layer_communicator.postprocess_layer(
|
632
|
+
state.pop("hidden_states_mlp_output"),
|
633
|
+
state.pop("residual_after_comm_pre_mlp"),
|
634
|
+
state.forward_batch,
|
635
|
+
)
|
603
636
|
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
attn_tp_all_gather(
|
612
|
-
list(hidden_states.tensor_split(self.attn_tp_size)), local_hidden_states
|
613
|
-
)
|
637
|
+
output = dict(
|
638
|
+
positions=state.positions,
|
639
|
+
hidden_states=hidden_states,
|
640
|
+
residual=residual,
|
641
|
+
forward_batch=state.forward_batch,
|
642
|
+
tbo_subbatch_index=state.tbo_subbatch_index,
|
643
|
+
)
|
614
644
|
|
615
|
-
|
645
|
+
state.clear(
|
646
|
+
expect_keys={
|
647
|
+
"positions",
|
648
|
+
"forward_batch",
|
649
|
+
"tbo_subbatch_index",
|
650
|
+
}
|
651
|
+
)
|
652
|
+
return output
|
616
653
|
|
617
654
|
|
618
655
|
class Qwen3MoeModel(Qwen2MoeModel):
|
@@ -651,6 +688,7 @@ class Qwen3MoeForCausalLM(nn.Module):
|
|
651
688
|
config.hidden_size,
|
652
689
|
quant_config=quant_config,
|
653
690
|
prefix=add_prefix("lm_head", prefix),
|
691
|
+
use_attn_tp_group=global_server_args_dict["enable_dp_lm_head"],
|
654
692
|
)
|
655
693
|
self.logits_processor = LogitsProcessor(config)
|
656
694
|
|
@@ -773,10 +811,11 @@ class Qwen3MoeForCausalLM(nn.Module):
|
|
773
811
|
else:
|
774
812
|
logger.warning(f"Parameter {name} not found in params_dict")
|
775
813
|
|
814
|
+
# TODO mimic deepseek
|
776
815
|
self.routed_experts_weights_of_layer = {
|
777
|
-
layer_id:
|
778
|
-
for layer_id
|
779
|
-
if isinstance(
|
816
|
+
layer_id: self.model.layers[layer_id].mlp.get_moe_weights()
|
817
|
+
for layer_id in range(self.start_layer, self.end_layer)
|
818
|
+
if isinstance(self.model.layers[layer_id].mlp, Qwen3MoeSparseMoeBlock)
|
780
819
|
}
|
781
820
|
|
782
821
|
@classmethod
|
sglang/srt/models/registry.py
CHANGED
@@ -49,7 +49,15 @@ class _ModelRegistry:
|
|
49
49
|
if not architectures:
|
50
50
|
logger.warning("No model architectures are specified")
|
51
51
|
|
52
|
-
|
52
|
+
# filter out support architectures
|
53
|
+
normalized_arch = list(
|
54
|
+
filter(lambda model: model in self.models, architectures)
|
55
|
+
)
|
56
|
+
|
57
|
+
# make sure Transformers backend is put at the last as a fallback
|
58
|
+
if len(normalized_arch) != len(architectures):
|
59
|
+
normalized_arch.append("TransformersForCausalLM")
|
60
|
+
return normalized_arch
|
53
61
|
|
54
62
|
def resolve_model_cls(
|
55
63
|
self,
|