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
@@ -77,8 +77,8 @@ def create_flashmla_kv_indices_triton(
|
|
77
77
|
) * PAGED_SIZE
|
78
78
|
paged_offset_out = tl.arange(0, NUM_PAGE_PER_BLOCK) + i * NUM_PAGE_PER_BLOCK
|
79
79
|
|
80
|
-
mask = paged_offset
|
81
|
-
mask_out = paged_offset_out
|
80
|
+
mask = paged_offset < num_paged * PAGED_SIZE
|
81
|
+
mask_out = paged_offset_out < num_paged
|
82
82
|
|
83
83
|
data = tl.load(
|
84
84
|
req_to_token_ptr
|
@@ -120,7 +120,7 @@ class VisionSdpaAttention(nn.Module):
|
|
120
120
|
flatten_batch: bool = False,
|
121
121
|
) -> Optional[torch.Tensor]:
|
122
122
|
r"""
|
123
|
-
Creates a non-causal 4D mask of shape `(b, 1, s, s)` or `(1, s, s)`.
|
123
|
+
Creates a non-causal 4D mask of shape `(b, 1, s, s)` or `(1, 1, s, s)`.
|
124
124
|
Args:
|
125
125
|
s: sequence length
|
126
126
|
cu_seqlens: cumulative sequence lengths tensor. If not, returns an empty mask
|
@@ -0,0 +1,517 @@
|
|
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
|
+
|
15
|
+
from dataclasses import dataclass
|
16
|
+
from enum import Enum, auto
|
17
|
+
from functools import partial
|
18
|
+
from typing import Dict, Optional
|
19
|
+
|
20
|
+
import torch.distributed
|
21
|
+
|
22
|
+
from sglang.srt.distributed import (
|
23
|
+
get_tensor_model_parallel_world_size,
|
24
|
+
tensor_model_parallel_all_reduce,
|
25
|
+
)
|
26
|
+
from sglang.srt.layers.dp_attention import (
|
27
|
+
attn_tp_all_gather,
|
28
|
+
attn_tp_reduce_scatter,
|
29
|
+
dp_gather_partial,
|
30
|
+
dp_scatter,
|
31
|
+
get_attention_tp_rank,
|
32
|
+
get_attention_tp_size,
|
33
|
+
get_local_attention_dp_size,
|
34
|
+
)
|
35
|
+
from sglang.srt.managers.schedule_batch import global_server_args_dict
|
36
|
+
from sglang.srt.model_executor.forward_batch_info import ForwardBatch
|
37
|
+
|
38
|
+
|
39
|
+
class ScatterMode(Enum):
|
40
|
+
"""
|
41
|
+
Suppose we have TP=4, DP=2, enable-dp-attention, and the system handles seq a,b,c,d
|
42
|
+
Model input/output: [ab, ab, cd, cd] for four ranks respectively
|
43
|
+
SCATTERED: [a, b, c, d]
|
44
|
+
TP_ATTN_FULL: [ab, ab, cd, cd], i.e. all ranks inside a TP attn group have full data of the group
|
45
|
+
FULL: [abcd, abcd, abcd, abcd]
|
46
|
+
"""
|
47
|
+
|
48
|
+
SCATTERED = auto()
|
49
|
+
TP_ATTN_FULL = auto()
|
50
|
+
FULL = auto()
|
51
|
+
|
52
|
+
@staticmethod
|
53
|
+
def model_input_output():
|
54
|
+
"""The scatter mode for model forward pass input and output data"""
|
55
|
+
return ScatterMode.TP_ATTN_FULL
|
56
|
+
|
57
|
+
|
58
|
+
@dataclass
|
59
|
+
class _LayerModeComputationContext:
|
60
|
+
num_layers: int
|
61
|
+
layer_id: int
|
62
|
+
is_layer_sparse: bool
|
63
|
+
is_previous_layer_sparse: Optional[bool]
|
64
|
+
|
65
|
+
def previous_layer(self):
|
66
|
+
assert self.is_previous_layer_sparse is not None
|
67
|
+
return _LayerModeComputationContext(
|
68
|
+
layer_id=self.layer_id - 1,
|
69
|
+
is_layer_sparse=self.is_previous_layer_sparse,
|
70
|
+
is_previous_layer_sparse=None,
|
71
|
+
num_layers=self.num_layers,
|
72
|
+
)
|
73
|
+
|
74
|
+
|
75
|
+
@dataclass
|
76
|
+
class LayerScatterModes:
|
77
|
+
layer_input_mode: ScatterMode
|
78
|
+
attn_mode: ScatterMode
|
79
|
+
# Can be further split into e.g. mlp_input_mode and mlp_output_mode if needed
|
80
|
+
mlp_mode: ScatterMode
|
81
|
+
middle_residual_mode: ScatterMode
|
82
|
+
layer_output_mode: ScatterMode
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def init_new(cls, **kwargs):
|
86
|
+
context = _LayerModeComputationContext(**kwargs)
|
87
|
+
return cls(
|
88
|
+
layer_input_mode=cls._compute_layer_input_mode(context),
|
89
|
+
attn_mode=ScatterMode.TP_ATTN_FULL,
|
90
|
+
mlp_mode=cls._compute_mlp_mode(context),
|
91
|
+
middle_residual_mode=cls._compute_middle_residual_mode(context),
|
92
|
+
layer_output_mode=cls._compute_layer_output_mode(context),
|
93
|
+
)
|
94
|
+
|
95
|
+
@classmethod
|
96
|
+
def _compute_layer_input_mode(cls, context: _LayerModeComputationContext):
|
97
|
+
if context.layer_id == 0:
|
98
|
+
return ScatterMode.model_input_output()
|
99
|
+
return cls._compute_layer_output_mode(context.previous_layer())
|
100
|
+
|
101
|
+
@classmethod
|
102
|
+
def _compute_mlp_mode(cls, context: _LayerModeComputationContext):
|
103
|
+
if context.is_layer_sparse:
|
104
|
+
return (
|
105
|
+
ScatterMode.SCATTERED
|
106
|
+
if global_server_args_dict["enable_deepep_moe"]
|
107
|
+
else ScatterMode.FULL
|
108
|
+
)
|
109
|
+
else:
|
110
|
+
return (
|
111
|
+
ScatterMode.SCATTERED
|
112
|
+
if enable_moe_dense_fully_dp()
|
113
|
+
else ScatterMode.FULL
|
114
|
+
)
|
115
|
+
|
116
|
+
@classmethod
|
117
|
+
def _compute_middle_residual_mode(cls, context: _LayerModeComputationContext):
|
118
|
+
mlp_mode = cls._compute_mlp_mode(context)
|
119
|
+
if mlp_mode == ScatterMode.SCATTERED:
|
120
|
+
return ScatterMode.SCATTERED
|
121
|
+
if mlp_mode == ScatterMode.FULL:
|
122
|
+
return ScatterMode.TP_ATTN_FULL
|
123
|
+
raise NotImplementedError
|
124
|
+
|
125
|
+
@classmethod
|
126
|
+
def _compute_layer_output_mode(cls, context: _LayerModeComputationContext):
|
127
|
+
mlp_mode = cls._compute_mlp_mode(context)
|
128
|
+
if context.layer_id == context.num_layers - 1:
|
129
|
+
return ScatterMode.model_input_output()
|
130
|
+
if mlp_mode == ScatterMode.SCATTERED:
|
131
|
+
return ScatterMode.SCATTERED
|
132
|
+
if mlp_mode == ScatterMode.FULL:
|
133
|
+
return ScatterMode.TP_ATTN_FULL
|
134
|
+
raise NotImplementedError
|
135
|
+
|
136
|
+
|
137
|
+
def enable_moe_dense_fully_dp():
|
138
|
+
return global_server_args_dict["moe_dense_tp_size"] == 1
|
139
|
+
|
140
|
+
|
141
|
+
class LayerCommunicator:
|
142
|
+
def __init__(
|
143
|
+
self,
|
144
|
+
layer_scatter_modes: LayerScatterModes,
|
145
|
+
input_layernorm: torch.nn.Module,
|
146
|
+
post_attention_layernorm: torch.nn.Module,
|
147
|
+
):
|
148
|
+
self.layer_scatter_modes = layer_scatter_modes
|
149
|
+
self.input_layernorm = input_layernorm
|
150
|
+
self.post_attention_layernorm = post_attention_layernorm
|
151
|
+
|
152
|
+
self._context = CommunicateContext.init_new()
|
153
|
+
self._communicate_simple_fn = CommunicateSimpleFn.get_fn(
|
154
|
+
input_mode=self.layer_scatter_modes.layer_input_mode,
|
155
|
+
output_mode=self.layer_scatter_modes.attn_mode,
|
156
|
+
context=self._context,
|
157
|
+
)
|
158
|
+
self._communicate_with_all_reduce_and_layer_norm_fn = (
|
159
|
+
CommunicateWithAllReduceAndLayerNormFn.get_fn(
|
160
|
+
hidden_states_input_mode=self.layer_scatter_modes.attn_mode,
|
161
|
+
residual_input_mode=self.layer_scatter_modes.layer_input_mode,
|
162
|
+
hidden_states_output_mode=self.layer_scatter_modes.mlp_mode,
|
163
|
+
residual_output_mode=self.layer_scatter_modes.middle_residual_mode,
|
164
|
+
context=self._context,
|
165
|
+
)
|
166
|
+
)
|
167
|
+
self._communicate_summable_tensor_pair_fn = (
|
168
|
+
CommunicateSummableTensorPairFn.get_fn(
|
169
|
+
hidden_states_input_mode=self.layer_scatter_modes.mlp_mode,
|
170
|
+
residual_input_mode=self.layer_scatter_modes.middle_residual_mode,
|
171
|
+
output_mode=self.layer_scatter_modes.layer_output_mode,
|
172
|
+
context=self._context,
|
173
|
+
)
|
174
|
+
)
|
175
|
+
|
176
|
+
def prepare_attn(
|
177
|
+
self,
|
178
|
+
hidden_states: torch.Tensor,
|
179
|
+
residual: torch.Tensor,
|
180
|
+
forward_batch: ForwardBatch,
|
181
|
+
):
|
182
|
+
if hidden_states.shape[0] == 0:
|
183
|
+
residual = hidden_states
|
184
|
+
else:
|
185
|
+
if residual is None:
|
186
|
+
residual = hidden_states
|
187
|
+
hidden_states = self.input_layernorm(hidden_states)
|
188
|
+
else:
|
189
|
+
hidden_states, residual = self.input_layernorm(hidden_states, residual)
|
190
|
+
|
191
|
+
hidden_states = self._communicate_simple_fn(
|
192
|
+
hidden_states=hidden_states,
|
193
|
+
forward_batch=forward_batch,
|
194
|
+
context=self._context,
|
195
|
+
)
|
196
|
+
|
197
|
+
return hidden_states, residual
|
198
|
+
|
199
|
+
def prepare_mlp(
|
200
|
+
self,
|
201
|
+
hidden_states: torch.Tensor,
|
202
|
+
residual: torch.Tensor,
|
203
|
+
forward_batch: ForwardBatch,
|
204
|
+
):
|
205
|
+
return self._communicate_with_all_reduce_and_layer_norm_fn(
|
206
|
+
hidden_states=hidden_states,
|
207
|
+
residual=residual,
|
208
|
+
forward_batch=forward_batch,
|
209
|
+
layernorm=self.post_attention_layernorm,
|
210
|
+
context=self._context,
|
211
|
+
)
|
212
|
+
|
213
|
+
def postprocess_layer(
|
214
|
+
self,
|
215
|
+
hidden_states: torch.Tensor,
|
216
|
+
residual: torch.Tensor,
|
217
|
+
forward_batch: ForwardBatch,
|
218
|
+
):
|
219
|
+
return self._communicate_summable_tensor_pair_fn(
|
220
|
+
hidden_states=hidden_states,
|
221
|
+
residual=residual,
|
222
|
+
forward_batch=forward_batch,
|
223
|
+
context=self._context,
|
224
|
+
)
|
225
|
+
|
226
|
+
|
227
|
+
@dataclass
|
228
|
+
class CommunicateContext:
|
229
|
+
process_group_sizes: Dict["ScatterMode", int]
|
230
|
+
attn_tp_rank: int
|
231
|
+
attn_tp_size: int
|
232
|
+
local_attn_dp_size: int
|
233
|
+
tp_size: int
|
234
|
+
|
235
|
+
def is_same_group_size(self, a: "ScatterMode", b: "ScatterMode"):
|
236
|
+
return self.process_group_sizes[a] == self.process_group_sizes[b]
|
237
|
+
|
238
|
+
@classmethod
|
239
|
+
def init_new(cls):
|
240
|
+
attn_tp_rank = get_attention_tp_rank()
|
241
|
+
attn_tp_size = get_attention_tp_size()
|
242
|
+
local_attn_dp_size = get_local_attention_dp_size()
|
243
|
+
tp_size = get_tensor_model_parallel_world_size()
|
244
|
+
process_group_sizes = {
|
245
|
+
ScatterMode.SCATTERED: 1,
|
246
|
+
ScatterMode.TP_ATTN_FULL: attn_tp_size,
|
247
|
+
ScatterMode.FULL: tp_size,
|
248
|
+
}
|
249
|
+
return cls(
|
250
|
+
process_group_sizes=process_group_sizes,
|
251
|
+
attn_tp_rank=attn_tp_rank,
|
252
|
+
attn_tp_size=attn_tp_size,
|
253
|
+
local_attn_dp_size=local_attn_dp_size,
|
254
|
+
tp_size=tp_size,
|
255
|
+
)
|
256
|
+
|
257
|
+
|
258
|
+
class CommunicateSimpleFn:
|
259
|
+
@staticmethod
|
260
|
+
def get_fn(
|
261
|
+
input_mode: ScatterMode,
|
262
|
+
output_mode: ScatterMode,
|
263
|
+
context: CommunicateContext,
|
264
|
+
):
|
265
|
+
if context.is_same_group_size(input_mode, output_mode):
|
266
|
+
return CommunicateSimpleFn._trivial
|
267
|
+
|
268
|
+
if (input_mode == ScatterMode.SCATTERED) and (
|
269
|
+
output_mode == ScatterMode.TP_ATTN_FULL
|
270
|
+
):
|
271
|
+
return CommunicateSimpleFn._scattered_to_tp_attn_full
|
272
|
+
|
273
|
+
raise NotImplementedError(f"{input_mode=} {output_mode=}")
|
274
|
+
|
275
|
+
@staticmethod
|
276
|
+
def _trivial(
|
277
|
+
hidden_states: torch.Tensor,
|
278
|
+
forward_batch: ForwardBatch,
|
279
|
+
context: CommunicateContext,
|
280
|
+
) -> torch.Tensor:
|
281
|
+
return hidden_states
|
282
|
+
|
283
|
+
@staticmethod
|
284
|
+
def _scattered_to_tp_attn_full(
|
285
|
+
hidden_states: torch.Tensor,
|
286
|
+
forward_batch: ForwardBatch,
|
287
|
+
context: CommunicateContext,
|
288
|
+
) -> torch.Tensor:
|
289
|
+
hidden_states, local_hidden_states = (
|
290
|
+
forward_batch.gathered_buffer[: forward_batch.input_ids.shape[0]],
|
291
|
+
hidden_states,
|
292
|
+
)
|
293
|
+
attn_tp_all_gather(
|
294
|
+
list(hidden_states.tensor_split(context.attn_tp_size)),
|
295
|
+
local_hidden_states,
|
296
|
+
)
|
297
|
+
return hidden_states
|
298
|
+
|
299
|
+
|
300
|
+
class CommunicateWithAllReduceAndLayerNormFn:
|
301
|
+
"""Besides communication, needs to
|
302
|
+
1. All reduce in tp_attn_group on hidden_states
|
303
|
+
2. Apply layer norm
|
304
|
+
"""
|
305
|
+
|
306
|
+
@staticmethod
|
307
|
+
def get_fn(
|
308
|
+
hidden_states_input_mode: ScatterMode,
|
309
|
+
residual_input_mode: ScatterMode,
|
310
|
+
hidden_states_output_mode: ScatterMode,
|
311
|
+
residual_output_mode: ScatterMode,
|
312
|
+
context: CommunicateContext,
|
313
|
+
):
|
314
|
+
|
315
|
+
if (
|
316
|
+
context.is_same_group_size(
|
317
|
+
hidden_states_input_mode, hidden_states_output_mode
|
318
|
+
)
|
319
|
+
and context.is_same_group_size(residual_input_mode, residual_output_mode)
|
320
|
+
and context.attn_tp_size == 1
|
321
|
+
):
|
322
|
+
return CommunicateWithAllReduceAndLayerNormFn._simple
|
323
|
+
|
324
|
+
if (
|
325
|
+
(hidden_states_input_mode == ScatterMode.TP_ATTN_FULL)
|
326
|
+
and (residual_input_mode == ScatterMode.TP_ATTN_FULL)
|
327
|
+
and (hidden_states_output_mode == ScatterMode.FULL)
|
328
|
+
and (residual_output_mode == ScatterMode.TP_ATTN_FULL)
|
329
|
+
):
|
330
|
+
return CommunicateWithAllReduceAndLayerNormFn._gather_hidden_states
|
331
|
+
|
332
|
+
if (
|
333
|
+
(hidden_states_input_mode == ScatterMode.TP_ATTN_FULL)
|
334
|
+
and (
|
335
|
+
residual_input_mode in [ScatterMode.SCATTERED, ScatterMode.TP_ATTN_FULL]
|
336
|
+
)
|
337
|
+
and (hidden_states_output_mode == ScatterMode.SCATTERED)
|
338
|
+
and (residual_output_mode == ScatterMode.SCATTERED)
|
339
|
+
):
|
340
|
+
return partial(
|
341
|
+
CommunicateWithAllReduceAndLayerNormFn._scatter_hidden_states_and_residual,
|
342
|
+
residual_input_mode=residual_input_mode,
|
343
|
+
)
|
344
|
+
|
345
|
+
raise NotImplementedError(
|
346
|
+
f"{hidden_states_input_mode=} {residual_input_mode=} {residual_output_mode=} {residual_output_mode=}"
|
347
|
+
)
|
348
|
+
|
349
|
+
@staticmethod
|
350
|
+
def _simple(
|
351
|
+
hidden_states: torch.Tensor,
|
352
|
+
residual: torch.Tensor,
|
353
|
+
forward_batch: ForwardBatch,
|
354
|
+
layernorm: torch.nn.Module,
|
355
|
+
context: CommunicateContext,
|
356
|
+
):
|
357
|
+
# TODO move these `if shape != 0` into LayerNorm itself
|
358
|
+
if hidden_states.shape[0] != 0:
|
359
|
+
hidden_states, residual = layernorm(hidden_states, residual)
|
360
|
+
return hidden_states, residual
|
361
|
+
|
362
|
+
@staticmethod
|
363
|
+
def _gather_hidden_states(
|
364
|
+
hidden_states: torch.Tensor,
|
365
|
+
residual: torch.Tensor,
|
366
|
+
forward_batch: ForwardBatch,
|
367
|
+
layernorm: torch.nn.Module,
|
368
|
+
context: CommunicateContext,
|
369
|
+
):
|
370
|
+
if context.local_attn_dp_size != 1:
|
371
|
+
if context.attn_tp_rank == 0:
|
372
|
+
hidden_states += residual
|
373
|
+
hidden_states, local_hidden_states = (
|
374
|
+
forward_batch.gathered_buffer,
|
375
|
+
hidden_states,
|
376
|
+
)
|
377
|
+
dp_gather_partial(hidden_states, local_hidden_states, forward_batch)
|
378
|
+
dp_scatter(residual, hidden_states, forward_batch)
|
379
|
+
if hidden_states.shape[0] != 0:
|
380
|
+
hidden_states = layernorm(hidden_states)
|
381
|
+
else:
|
382
|
+
hidden_states = tensor_model_parallel_all_reduce(hidden_states)
|
383
|
+
hidden_states, residual = layernorm(hidden_states, residual)
|
384
|
+
return hidden_states, residual
|
385
|
+
|
386
|
+
@staticmethod
|
387
|
+
def _scatter_hidden_states_and_residual(
|
388
|
+
hidden_states: torch.Tensor,
|
389
|
+
residual: torch.Tensor,
|
390
|
+
forward_batch: ForwardBatch,
|
391
|
+
layernorm: torch.nn.Module,
|
392
|
+
context: CommunicateContext,
|
393
|
+
*,
|
394
|
+
residual_input_mode,
|
395
|
+
):
|
396
|
+
tensor_list = list(hidden_states.tensor_split(context.attn_tp_size))
|
397
|
+
hidden_states = tensor_list[context.attn_tp_rank]
|
398
|
+
attn_tp_reduce_scatter(hidden_states, tensor_list)
|
399
|
+
if residual_input_mode == ScatterMode.TP_ATTN_FULL:
|
400
|
+
residual = residual.tensor_split(context.attn_tp_size)[context.attn_tp_rank]
|
401
|
+
if hidden_states.shape[0] != 0:
|
402
|
+
hidden_states, residual = layernorm(hidden_states, residual)
|
403
|
+
return hidden_states, residual
|
404
|
+
|
405
|
+
|
406
|
+
class CommunicateSummableTensorPairFn:
|
407
|
+
"""It is allowed to make (hidden_states, residual) := (hidden_states + residual, None) if needed."""
|
408
|
+
|
409
|
+
@classmethod
|
410
|
+
def execute(
|
411
|
+
cls,
|
412
|
+
hidden_states_input_mode,
|
413
|
+
residual_input_mode,
|
414
|
+
output_mode,
|
415
|
+
context,
|
416
|
+
**kwargs,
|
417
|
+
):
|
418
|
+
return cls.get_fn(
|
419
|
+
hidden_states_input_mode=hidden_states_input_mode,
|
420
|
+
residual_input_mode=residual_input_mode,
|
421
|
+
output_mode=output_mode,
|
422
|
+
context=context,
|
423
|
+
)(context=context, **kwargs)
|
424
|
+
|
425
|
+
@staticmethod
|
426
|
+
def get_fn(
|
427
|
+
hidden_states_input_mode: ScatterMode,
|
428
|
+
residual_input_mode: ScatterMode,
|
429
|
+
output_mode: ScatterMode,
|
430
|
+
context: CommunicateContext,
|
431
|
+
):
|
432
|
+
if context.is_same_group_size(
|
433
|
+
hidden_states_input_mode, output_mode
|
434
|
+
) and context.is_same_group_size(residual_input_mode, output_mode):
|
435
|
+
return CommunicateSummableTensorPairFn._trivial
|
436
|
+
|
437
|
+
if (
|
438
|
+
(hidden_states_input_mode == ScatterMode.FULL)
|
439
|
+
and (residual_input_mode == ScatterMode.TP_ATTN_FULL)
|
440
|
+
and (output_mode == ScatterMode.TP_ATTN_FULL)
|
441
|
+
):
|
442
|
+
return CommunicateSummableTensorPairFn._scatter_hidden_states
|
443
|
+
|
444
|
+
if (
|
445
|
+
(hidden_states_input_mode == ScatterMode.SCATTERED)
|
446
|
+
and (residual_input_mode == ScatterMode.SCATTERED)
|
447
|
+
and (output_mode == ScatterMode.TP_ATTN_FULL)
|
448
|
+
):
|
449
|
+
return CommunicateSummableTensorPairFn._gather
|
450
|
+
|
451
|
+
if (
|
452
|
+
(hidden_states_input_mode == ScatterMode.TP_ATTN_FULL)
|
453
|
+
and (residual_input_mode == ScatterMode.TP_ATTN_FULL)
|
454
|
+
and (output_mode == ScatterMode.SCATTERED)
|
455
|
+
):
|
456
|
+
return CommunicateSummableTensorPairFn._scatter
|
457
|
+
|
458
|
+
raise NotImplementedError(
|
459
|
+
f"{hidden_states_input_mode=} {residual_input_mode=} {output_mode=}"
|
460
|
+
)
|
461
|
+
|
462
|
+
@staticmethod
|
463
|
+
def _trivial(
|
464
|
+
hidden_states: torch.Tensor,
|
465
|
+
residual: torch.Tensor,
|
466
|
+
forward_batch: ForwardBatch,
|
467
|
+
context: CommunicateContext,
|
468
|
+
):
|
469
|
+
return hidden_states, residual
|
470
|
+
|
471
|
+
@staticmethod
|
472
|
+
def _scatter_hidden_states(
|
473
|
+
hidden_states: torch.Tensor,
|
474
|
+
residual: torch.Tensor,
|
475
|
+
forward_batch: ForwardBatch,
|
476
|
+
context: CommunicateContext,
|
477
|
+
):
|
478
|
+
# TODO(ch-wan): use reduce-scatter in MLP to avoid this scatter
|
479
|
+
# important: forward batch.gathered_buffer is used both after scatter and after gather.
|
480
|
+
# be careful about this!
|
481
|
+
hidden_states, global_hidden_states = (
|
482
|
+
forward_batch.gathered_buffer[: forward_batch.input_ids.shape[0]],
|
483
|
+
hidden_states,
|
484
|
+
)
|
485
|
+
dp_scatter(hidden_states, global_hidden_states, forward_batch)
|
486
|
+
return hidden_states, residual
|
487
|
+
|
488
|
+
@staticmethod
|
489
|
+
def _gather(
|
490
|
+
hidden_states: torch.Tensor,
|
491
|
+
residual: torch.Tensor,
|
492
|
+
forward_batch: ForwardBatch,
|
493
|
+
context: CommunicateContext,
|
494
|
+
):
|
495
|
+
hidden_states += residual
|
496
|
+
residual = None
|
497
|
+
hidden_states, local_hidden_states = (
|
498
|
+
forward_batch.gathered_buffer[: forward_batch.input_ids.shape[0]],
|
499
|
+
hidden_states,
|
500
|
+
)
|
501
|
+
attn_tp_all_gather(
|
502
|
+
list(hidden_states.tensor_split(context.attn_tp_size)),
|
503
|
+
local_hidden_states,
|
504
|
+
)
|
505
|
+
return hidden_states, residual
|
506
|
+
|
507
|
+
@staticmethod
|
508
|
+
def _scatter(
|
509
|
+
hidden_states: torch.Tensor,
|
510
|
+
residual: torch.Tensor,
|
511
|
+
forward_batch: ForwardBatch,
|
512
|
+
context: CommunicateContext,
|
513
|
+
):
|
514
|
+
assert residual is None, "not yet handled residual!=None"
|
515
|
+
tensor_list = list(hidden_states.tensor_split(context.attn_tp_size))
|
516
|
+
hidden_states = tensor_list[context.attn_tp_rank]
|
517
|
+
return hidden_states, residual
|
@@ -98,11 +98,12 @@ def initialize_dp_attention(
|
|
98
98
|
],
|
99
99
|
local_rank,
|
100
100
|
torch.distributed.get_backend(tp_group.device_group),
|
101
|
-
SYNC_TOKEN_IDS_ACROSS_TP,
|
102
|
-
False,
|
103
|
-
False,
|
104
|
-
False,
|
105
|
-
False,
|
101
|
+
use_pynccl=SYNC_TOKEN_IDS_ACROSS_TP,
|
102
|
+
use_pymscclpp=False,
|
103
|
+
use_custom_allreduce=False,
|
104
|
+
use_hpu_communicator=False,
|
105
|
+
use_xpu_communicator=False,
|
106
|
+
use_npu_communicator=False,
|
106
107
|
group_name="attention_tp",
|
107
108
|
)
|
108
109
|
|
@@ -142,16 +143,6 @@ def get_local_attention_dp_size():
|
|
142
143
|
return _LOCAL_ATTN_DP_SIZE
|
143
144
|
|
144
145
|
|
145
|
-
def get_local_attention_dp_rank():
|
146
|
-
assert _LOCAL_ATTN_DP_RANK is not None, "dp attention not initialized!"
|
147
|
-
return _LOCAL_ATTN_DP_RANK
|
148
|
-
|
149
|
-
|
150
|
-
def get_local_attention_dp_size():
|
151
|
-
assert _LOCAL_ATTN_DP_SIZE is not None, "dp attention not initialized!"
|
152
|
-
return _LOCAL_ATTN_DP_SIZE
|
153
|
-
|
154
|
-
|
155
146
|
@contextmanager
|
156
147
|
def disable_dp_size():
|
157
148
|
"""Patch the tp group temporarily until this function ends.
|
sglang/srt/layers/layernorm.py
CHANGED
@@ -20,10 +20,11 @@ import torch
|
|
20
20
|
import torch.nn as nn
|
21
21
|
|
22
22
|
from sglang.srt.custom_op import CustomOp
|
23
|
-
from sglang.srt.utils import is_cuda, is_hip
|
23
|
+
from sglang.srt.utils import get_bool_env_var, is_cuda, is_hip
|
24
24
|
|
25
25
|
_is_cuda = is_cuda()
|
26
26
|
_is_hip = is_hip()
|
27
|
+
_use_aiter = get_bool_env_var("SGLANG_USE_AITER") and _is_hip
|
27
28
|
|
28
29
|
if _is_cuda:
|
29
30
|
from sgl_kernel import (
|
@@ -33,7 +34,10 @@ if _is_cuda:
|
|
33
34
|
rmsnorm,
|
34
35
|
)
|
35
36
|
|
36
|
-
if
|
37
|
+
if _use_aiter:
|
38
|
+
from aiter import rmsnorm2d_fwd as rms_norm
|
39
|
+
from aiter import rmsnorm2d_fwd_with_add as fused_add_rms_norm
|
40
|
+
elif _is_hip:
|
37
41
|
from vllm._custom_ops import fused_add_rms_norm, rms_norm
|
38
42
|
|
39
43
|
logger = logging.getLogger(__name__)
|
@@ -48,16 +52,8 @@ class RMSNorm(CustomOp):
|
|
48
52
|
super().__init__()
|
49
53
|
self.weight = nn.Parameter(torch.ones(hidden_size))
|
50
54
|
self.variance_epsilon = eps
|
51
|
-
|
52
|
-
|
53
|
-
if torch.compiler.is_compiling():
|
54
|
-
return self.forward_native(*args, **kwargs)
|
55
|
-
if _is_cuda:
|
56
|
-
return self.forward_cuda(*args, **kwargs)
|
57
|
-
elif _is_hip:
|
58
|
-
return self.forward_hip(*args, **kwargs)
|
59
|
-
else:
|
60
|
-
return self.forward_native(*args, **kwargs)
|
55
|
+
if _use_aiter:
|
56
|
+
self._forward_method = self.forward_aiter
|
61
57
|
|
62
58
|
def forward_cuda(
|
63
59
|
self,
|
@@ -70,6 +66,25 @@ class RMSNorm(CustomOp):
|
|
70
66
|
out = rmsnorm(x, self.weight.data, self.variance_epsilon)
|
71
67
|
return out
|
72
68
|
|
69
|
+
def forward_aiter(
|
70
|
+
self,
|
71
|
+
x: torch.Tensor,
|
72
|
+
residual: Optional[torch.Tensor] = None,
|
73
|
+
) -> Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
|
74
|
+
if residual is not None:
|
75
|
+
residual_out = torch.empty_like(x)
|
76
|
+
output = torch.empty_like(x)
|
77
|
+
fused_add_rms_norm(
|
78
|
+
output,
|
79
|
+
x,
|
80
|
+
residual,
|
81
|
+
residual_out,
|
82
|
+
self.weight.data,
|
83
|
+
self.variance_epsilon,
|
84
|
+
)
|
85
|
+
return output, residual_out
|
86
|
+
return rms_norm(x, self.weight.data, self.variance_epsilon)
|
87
|
+
|
73
88
|
def forward_hip(
|
74
89
|
self,
|
75
90
|
x: torch.Tensor,
|
@@ -117,13 +132,9 @@ class GemmaRMSNorm(CustomOp):
|
|
117
132
|
self.weight = nn.Parameter(torch.zeros(hidden_size))
|
118
133
|
self.variance_epsilon = eps
|
119
134
|
|
120
|
-
|
121
|
-
if
|
122
|
-
|
123
|
-
if _is_cuda:
|
124
|
-
return self.forward_cuda(*args, **kwargs)
|
125
|
-
else:
|
126
|
-
return self.forward_native(*args, **kwargs)
|
135
|
+
# Re-dispatch
|
136
|
+
if _is_hip:
|
137
|
+
self._forward_method = self.forward_native
|
127
138
|
|
128
139
|
def forward_native(
|
129
140
|
self,
|