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/utils.py
CHANGED
@@ -25,6 +25,7 @@ import json
|
|
25
25
|
import logging
|
26
26
|
import os
|
27
27
|
import pickle
|
28
|
+
import platform
|
28
29
|
import random
|
29
30
|
import re
|
30
31
|
import resource
|
@@ -44,6 +45,7 @@ from functools import lru_cache
|
|
44
45
|
from importlib.metadata import PackageNotFoundError, version
|
45
46
|
from importlib.util import find_spec
|
46
47
|
from io import BytesIO
|
48
|
+
from json import JSONDecodeError
|
47
49
|
from multiprocessing.reduction import ForkingPickler
|
48
50
|
from pathlib import Path
|
49
51
|
from typing import (
|
@@ -157,6 +159,15 @@ def is_npu() -> bool:
|
|
157
159
|
return hasattr(torch, "npu") and torch.npu.is_available()
|
158
160
|
|
159
161
|
|
162
|
+
def is_cpu() -> bool:
|
163
|
+
machine = platform.machine().lower()
|
164
|
+
return (
|
165
|
+
machine in ("x86_64", "amd64", "i386", "i686")
|
166
|
+
and hasattr(torch, "cpu")
|
167
|
+
and torch.cpu.is_available()
|
168
|
+
)
|
169
|
+
|
170
|
+
|
160
171
|
def is_flashinfer_available():
|
161
172
|
"""
|
162
173
|
Check whether flashinfer is available.
|
@@ -1917,16 +1928,18 @@ def next_power_of_2(n: int):
|
|
1917
1928
|
setattr(triton, "next_power_of_2", next_power_of_2)
|
1918
1929
|
|
1919
1930
|
|
1920
|
-
|
1921
|
-
def
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
finally:
|
1926
|
-
# Cleanup code goes here
|
1931
|
+
class EmptyContextManager:
|
1932
|
+
def __enter__(self):
|
1933
|
+
return self
|
1934
|
+
|
1935
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
1927
1936
|
pass
|
1928
1937
|
|
1929
1938
|
|
1939
|
+
def empty_context(*args, **kwargs):
|
1940
|
+
return EmptyContextManager()
|
1941
|
+
|
1942
|
+
|
1930
1943
|
def add_prefix(name: str, prefix: str) -> str:
|
1931
1944
|
"""Add a weight path prefix to a module name.
|
1932
1945
|
|
@@ -2025,6 +2038,14 @@ class DeepEPMode(Enum):
|
|
2025
2038
|
return DeepEPMode.normal
|
2026
2039
|
|
2027
2040
|
|
2041
|
+
def is_non_idle_and_non_empty(forward_mode, hidden_states):
|
2042
|
+
return (
|
2043
|
+
(forward_mode is not None)
|
2044
|
+
and not forward_mode.is_idle()
|
2045
|
+
and hidden_states.shape[0] > 0
|
2046
|
+
)
|
2047
|
+
|
2048
|
+
|
2028
2049
|
def fast_topk(values, topk, dim):
|
2029
2050
|
if topk == 1:
|
2030
2051
|
# Use max along the specified dimension to get both value and index
|
@@ -2046,6 +2067,12 @@ is_ampere_with_cuda_12_3 = lambda: _check(8)
|
|
2046
2067
|
is_hopper_with_cuda_12_3 = lambda: _check(9)
|
2047
2068
|
|
2048
2069
|
|
2070
|
+
def is_blackwell():
|
2071
|
+
if not is_cuda():
|
2072
|
+
return False
|
2073
|
+
return torch.cuda.get_device_capability()[0] == 10
|
2074
|
+
|
2075
|
+
|
2049
2076
|
def get_free_port():
|
2050
2077
|
# try ipv4
|
2051
2078
|
try:
|
@@ -2068,6 +2095,14 @@ def get_local_ip_by_remote() -> str:
|
|
2068
2095
|
except Exception:
|
2069
2096
|
pass
|
2070
2097
|
|
2098
|
+
try:
|
2099
|
+
hostname = socket.gethostname()
|
2100
|
+
ip = socket.gethostbyname(hostname)
|
2101
|
+
if ip and ip != "127.0.0.1" and ip != "0.0.0.0":
|
2102
|
+
return ip
|
2103
|
+
except Exception:
|
2104
|
+
pass
|
2105
|
+
|
2071
2106
|
# try ipv6
|
2072
2107
|
try:
|
2073
2108
|
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
|
@@ -2160,3 +2195,90 @@ class Withable(Generic[T]):
|
|
2160
2195
|
finally:
|
2161
2196
|
assert self._value is new_value
|
2162
2197
|
self._value = None
|
2198
|
+
|
2199
|
+
|
2200
|
+
def find_local_repo_dir(repo_id: str, revision: Optional[str] = None) -> Optional[str]:
|
2201
|
+
import huggingface_hub as hf
|
2202
|
+
|
2203
|
+
# Build cache path
|
2204
|
+
cache_path = os.path.join(
|
2205
|
+
hf.constants.HF_HUB_CACHE,
|
2206
|
+
hf.constants.REPO_ID_SEPARATOR.join(["models", *repo_id.split("/")]),
|
2207
|
+
)
|
2208
|
+
|
2209
|
+
# Get revision from main ref if not specified
|
2210
|
+
if not revision:
|
2211
|
+
ref_path = os.path.join(cache_path, "refs", "main")
|
2212
|
+
if os.path.isfile(ref_path):
|
2213
|
+
with open(ref_path) as f:
|
2214
|
+
revision = f.read().strip()
|
2215
|
+
|
2216
|
+
# List files from revision directory
|
2217
|
+
if revision:
|
2218
|
+
rev_dir = os.path.join(cache_path, "snapshots", revision)
|
2219
|
+
if os.path.isdir(rev_dir):
|
2220
|
+
return rev_dir
|
2221
|
+
|
2222
|
+
return None
|
2223
|
+
|
2224
|
+
|
2225
|
+
def read_system_prompt_from_file(model_name: str) -> str:
|
2226
|
+
"""Read system prompt from a file in the HuggingFace cache directory.
|
2227
|
+
|
2228
|
+
Args:
|
2229
|
+
model_name: The model name to construct the file path
|
2230
|
+
|
2231
|
+
Returns:
|
2232
|
+
The system prompt content from the file, or empty string if file not found
|
2233
|
+
"""
|
2234
|
+
try:
|
2235
|
+
local_repo_dir = find_local_repo_dir(model_name)
|
2236
|
+
if local_repo_dir:
|
2237
|
+
system_prompt_file = os.path.join(local_repo_dir, "SYSTEM_PROMPT.txt")
|
2238
|
+
if os.path.exists(system_prompt_file):
|
2239
|
+
with open(system_prompt_file, "r", encoding="utf-8") as f:
|
2240
|
+
return f.read()
|
2241
|
+
|
2242
|
+
return ""
|
2243
|
+
except Exception:
|
2244
|
+
# If anything fails, return empty string
|
2245
|
+
return ""
|
2246
|
+
|
2247
|
+
|
2248
|
+
def bind_or_assign(target, source):
|
2249
|
+
if target is not None:
|
2250
|
+
target.copy_(source)
|
2251
|
+
return target
|
2252
|
+
else:
|
2253
|
+
return source
|
2254
|
+
|
2255
|
+
|
2256
|
+
def support_triton(backend: str) -> bool:
|
2257
|
+
return backend not in ["torch_native", "intel_amx"]
|
2258
|
+
|
2259
|
+
|
2260
|
+
try:
|
2261
|
+
import sgl_kernel
|
2262
|
+
|
2263
|
+
is_intel_amx_backend_available = hasattr(
|
2264
|
+
torch.ops.sgl_kernel, "convert_weight_packed"
|
2265
|
+
)
|
2266
|
+
except:
|
2267
|
+
is_intel_amx_backend_available = False
|
2268
|
+
|
2269
|
+
|
2270
|
+
def cpu_has_amx_support():
|
2271
|
+
return torch._C._cpu._is_amx_tile_supported() and is_intel_amx_backend_available
|
2272
|
+
|
2273
|
+
|
2274
|
+
class LazyValue:
|
2275
|
+
def __init__(self, creator: Callable):
|
2276
|
+
self._creator = creator
|
2277
|
+
self._value = None
|
2278
|
+
|
2279
|
+
@property
|
2280
|
+
def value(self):
|
2281
|
+
if self._creator is not None:
|
2282
|
+
self._value = self._creator()
|
2283
|
+
self._creator = None
|
2284
|
+
return self._value
|
sglang/test/runners.py
CHANGED
@@ -26,6 +26,7 @@ from transformers import (
|
|
26
26
|
AutoModelForCausalLM,
|
27
27
|
AutoModelForVision2Seq,
|
28
28
|
AutoProcessor,
|
29
|
+
GenerationConfig,
|
29
30
|
)
|
30
31
|
|
31
32
|
from sglang.srt.entrypoints.engine import Engine
|
@@ -382,13 +383,17 @@ class HFRunner:
|
|
382
383
|
model = base_model
|
383
384
|
|
384
385
|
outputs = model.generate(
|
385
|
-
input_ids,
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
386
|
+
input_ids=input_ids,
|
387
|
+
generation_config=GenerationConfig(
|
388
|
+
do_sample=False,
|
389
|
+
temperature=None,
|
390
|
+
top_p=None,
|
391
|
+
max_new_tokens=max_new_tokens,
|
392
|
+
return_dict_in_generate=True,
|
393
|
+
output_scores=(not output_str_only),
|
394
|
+
# make sure to disable compile
|
395
|
+
disable_compile=True,
|
396
|
+
),
|
392
397
|
)
|
393
398
|
|
394
399
|
text = tokenizer.decode(
|
@@ -450,6 +455,7 @@ class SRTRunner:
|
|
450
455
|
torch_dtype: torch.dtype,
|
451
456
|
model_type: str,
|
452
457
|
tp_size: int = 1,
|
458
|
+
impl: str = "auto",
|
453
459
|
port: int = DEFAULT_PORT_FOR_SRT_TEST_RUNNER,
|
454
460
|
lora_paths: List[str] = None,
|
455
461
|
max_loras_per_batch: int = 4,
|
@@ -470,6 +476,7 @@ class SRTRunner:
|
|
470
476
|
speculative_num_draft_tokens: Optional[int] = None,
|
471
477
|
disable_overlap_schedule: bool = False,
|
472
478
|
disable_custom_all_reduce: bool = False,
|
479
|
+
torchao_config: Optional[str] = None,
|
473
480
|
):
|
474
481
|
self.model_type = model_type
|
475
482
|
self.is_generation = model_type == "generation"
|
@@ -488,6 +495,8 @@ class SRTRunner:
|
|
488
495
|
tp_size=tp_size,
|
489
496
|
dtype=get_dtype_str(torch_dtype),
|
490
497
|
port=port,
|
498
|
+
impl=impl,
|
499
|
+
torchao_config=torchao_config,
|
491
500
|
mem_fraction_static=mem_fraction_static,
|
492
501
|
trust_remote_code=trust_remote_code,
|
493
502
|
is_embedding=not self.is_generation,
|
sglang/test/send_one.py
CHANGED
sglang/test/test_cutlass_moe.py
CHANGED
@@ -6,7 +6,7 @@ import triton # Added import
|
|
6
6
|
import triton.testing # Added import
|
7
7
|
from transformers import AutoConfig
|
8
8
|
|
9
|
-
from sglang.srt.layers.moe.cutlass_moe import
|
9
|
+
from sglang.srt.layers.moe.cutlass_moe import cutlass_fused_experts_fp8
|
10
10
|
from sglang.srt.layers.moe.fused_moe_triton.fused_moe import fused_experts
|
11
11
|
|
12
12
|
|
@@ -125,7 +125,7 @@ def run_test(tp_size, batch_size, model_config, check=False):
|
|
125
125
|
problem_sizes2 = torch.empty((E, 3), dtype=torch.int32, device="cuda")
|
126
126
|
|
127
127
|
# --- Lambdas for Benchmarking ---
|
128
|
-
cutlass_lambda = lambda:
|
128
|
+
cutlass_lambda = lambda: cutlass_fused_experts_fp8(
|
129
129
|
x,
|
130
130
|
w1.transpose(1, 2), # Transposed
|
131
131
|
w2.transpose(1, 2), # Transposed
|
@@ -193,7 +193,7 @@ def run_test(tp_size, batch_size, model_config, check=False):
|
|
193
193
|
print("Running correctness check...")
|
194
194
|
with torch.no_grad():
|
195
195
|
# Run CUTLASS version (requires transposed weights)
|
196
|
-
y_cutlass =
|
196
|
+
y_cutlass = cutlass_fused_experts_fp8(
|
197
197
|
x,
|
198
198
|
w1.transpose(1, 2), # Transposed
|
199
199
|
w2.transpose(1, 2), # Transposed
|
@@ -0,0 +1,248 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
import pytest
|
3
|
+
import torch
|
4
|
+
from sgl_kernel import scaled_fp4_quant
|
5
|
+
|
6
|
+
from sglang.srt.layers.activation import SiluAndMul
|
7
|
+
from sglang.srt.layers.moe.cutlass_moe import cutlass_moe_fp4
|
8
|
+
from sglang.srt.layers.moe.cutlass_moe_params import CutlassMoEParams, CutlassMoEType
|
9
|
+
from sglang.srt.layers.moe.topk import select_experts
|
10
|
+
|
11
|
+
if torch.cuda.get_device_capability() < (10, 0):
|
12
|
+
pytest.skip(
|
13
|
+
reason="Nvfp4 Requires compute capability of 10 or above.",
|
14
|
+
allow_module_level=True,
|
15
|
+
)
|
16
|
+
|
17
|
+
kE2M1ToFloat = torch.tensor(
|
18
|
+
[0.0, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0], dtype=torch.float32
|
19
|
+
)
|
20
|
+
|
21
|
+
FLOAT8_E4M3_MAX = 448.0
|
22
|
+
FLOAT4_E2M1_MAX = 6.0
|
23
|
+
|
24
|
+
|
25
|
+
def convert_swizzled_to_linear(a_sf_swizzled: torch.Tensor, m, k, block_size):
|
26
|
+
m_tiles = (m + 128 - 1) // 128
|
27
|
+
f = block_size * 4
|
28
|
+
k_tiles = (k + f - 1) // f
|
29
|
+
tmp = torch.reshape(a_sf_swizzled, (1, m_tiles, k_tiles, 32, 4, 4))
|
30
|
+
tmp = torch.permute(tmp, (0, 1, 4, 3, 2, 5))
|
31
|
+
out = tmp.reshape(m_tiles * 128, k_tiles * f // block_size)
|
32
|
+
return out[0:m, 0:k]
|
33
|
+
|
34
|
+
|
35
|
+
def dequantize_nvfp4_to_dtype(
|
36
|
+
tensor_fp4, tensor_sf, global_scale, dtype, device, block_size=16
|
37
|
+
):
|
38
|
+
"""Dequantize the fp4 tensor back to high precision."""
|
39
|
+
# Two fp4 values are packed into one uint8.
|
40
|
+
assert tensor_fp4.dtype == torch.uint8
|
41
|
+
m, packed_k = tensor_fp4.shape
|
42
|
+
k = packed_k * 2
|
43
|
+
tensor_f32 = break_fp4_bytes(tensor_fp4, dtype)
|
44
|
+
tensor_f32 = tensor_f32.reshape(m, k // block_size, block_size)
|
45
|
+
tensor_sf = tensor_sf.view(torch.float8_e4m3fn)
|
46
|
+
tensor_sf = convert_swizzled_to_linear(tensor_sf, m, k, block_size)
|
47
|
+
tensor_sf_dtype = tensor_sf.to(torch.float32) / global_scale
|
48
|
+
|
49
|
+
# scale the tensor
|
50
|
+
out = (tensor_f32 * tensor_sf_dtype.unsqueeze(-1)).reshape(m, k)
|
51
|
+
return out.to(dtype=dtype)
|
52
|
+
|
53
|
+
|
54
|
+
def break_fp4_bytes(a, dtype):
|
55
|
+
assert a.dtype == torch.uint8
|
56
|
+
m, n = a.shape
|
57
|
+
|
58
|
+
# Vectorized nibble processing
|
59
|
+
a_flat = a.flatten()
|
60
|
+
high = (a_flat & 0xF0) >> 4 # Upper nibbles
|
61
|
+
low = a_flat & 0x0F # Lower nibbles
|
62
|
+
|
63
|
+
# Combine nibbles for batch processing
|
64
|
+
combined = torch.stack((low, high), dim=1).flatten()
|
65
|
+
|
66
|
+
# Vectorized sign and magnitude extraction
|
67
|
+
signs = (combined & 0x08).to(torch.bool) # Sign bits
|
68
|
+
abs_vals = (combined & 0x07).to(torch.long) # Magnitude indices
|
69
|
+
|
70
|
+
# Device-aware lookup and sign application
|
71
|
+
kE2M1 = kE2M1ToFloat.to(device=a.device)
|
72
|
+
values = kE2M1[abs_vals] * torch.where(signs, -1.0, 1.0)
|
73
|
+
|
74
|
+
# Reshape to final form
|
75
|
+
return values.reshape(m, n * 2).to(dtype=dtype)
|
76
|
+
|
77
|
+
|
78
|
+
MNK_FACTORS = [
|
79
|
+
(2, 1024, 1024),
|
80
|
+
(2, 1024, 1536),
|
81
|
+
(2, 3072, 1024),
|
82
|
+
(2, 3072, 1536),
|
83
|
+
(64, 1024, 1024),
|
84
|
+
(64, 1024, 1536),
|
85
|
+
(64, 3072, 1024),
|
86
|
+
(64, 2048, 1024),
|
87
|
+
(224, 1024, 1024),
|
88
|
+
(224, 1024, 1536),
|
89
|
+
]
|
90
|
+
|
91
|
+
|
92
|
+
# Reference implementation of torch_moe
|
93
|
+
def torch_moe(a, w1, w2, score, topk, expert_map):
|
94
|
+
B, D = a.shape
|
95
|
+
a = a.view(B, -1, D).repeat(1, topk, 1).reshape(-1, D)
|
96
|
+
out = torch.zeros(B * topk, w2.shape[1], dtype=a.dtype, device=a.device)
|
97
|
+
score = torch.softmax(score, dim=-1, dtype=torch.float32)
|
98
|
+
topk_weight, topk_ids = torch.topk(score, topk)
|
99
|
+
topk_weight = topk_weight.view(-1)
|
100
|
+
topk_ids = topk_ids.view(-1)
|
101
|
+
if expert_map is not None:
|
102
|
+
topk_ids = expert_map[topk_ids]
|
103
|
+
for i in range(w1.shape[0]):
|
104
|
+
mask = topk_ids == i
|
105
|
+
if mask.sum():
|
106
|
+
out[mask] = SiluAndMul()(a[mask] @ w1[i].transpose(0, 1)) @ w2[i].transpose(
|
107
|
+
0, 1
|
108
|
+
)
|
109
|
+
return (
|
110
|
+
out.view(B, -1, w2.shape[1]) * topk_weight.view(B, -1, 1).to(out.dtype)
|
111
|
+
).sum(dim=1)
|
112
|
+
|
113
|
+
|
114
|
+
@pytest.mark.parametrize("m,n,k", MNK_FACTORS)
|
115
|
+
@pytest.mark.parametrize("e", [40, 64, 256])
|
116
|
+
@pytest.mark.parametrize("topk", [1, 6, 8])
|
117
|
+
@pytest.mark.parametrize("dtype", [torch.half, torch.bfloat16])
|
118
|
+
@torch.inference_mode()
|
119
|
+
def test_cutlass_fp4_moe_no_graph(
|
120
|
+
m: int, n: int, k: int, e: int, topk: int, dtype: torch.dtype
|
121
|
+
):
|
122
|
+
|
123
|
+
torch.manual_seed(7)
|
124
|
+
a = torch.randn((m, k), device="cuda", dtype=dtype) / 10
|
125
|
+
w1 = torch.randn((e, 2 * n, k), device="cuda", dtype=dtype) / 10
|
126
|
+
quant_blocksize = 16
|
127
|
+
round_up = lambda x, y: (x + y - 1) // y * y
|
128
|
+
sf_w1_2n = round_up(2 * n, 128)
|
129
|
+
sf_w1_k = round_up(k // quant_blocksize, 4)
|
130
|
+
w1_blockscale = torch.empty(
|
131
|
+
(e, sf_w1_2n, sf_w1_k), device="cuda", dtype=torch.float8_e4m3fn
|
132
|
+
)
|
133
|
+
|
134
|
+
w2 = torch.randn((e, k, n), device="cuda", dtype=dtype) / 10
|
135
|
+
sf_w2_k = round_up(k, 128)
|
136
|
+
sf_w2_n = round_up(n // quant_blocksize, 4)
|
137
|
+
w2_blockscale = torch.empty(
|
138
|
+
(e, sf_w2_k, sf_w2_n), device="cuda", dtype=torch.float8_e4m3fn
|
139
|
+
)
|
140
|
+
|
141
|
+
w1_q = torch.empty((e, 2 * n, k // 2), device="cuda", dtype=torch.uint8)
|
142
|
+
w2_q = torch.empty((e, k, n // 2), device="cuda", dtype=torch.uint8)
|
143
|
+
w1_gs = torch.empty((e,), device="cuda", dtype=torch.float32)
|
144
|
+
w2_gs = torch.empty((e,), device="cuda", dtype=torch.float32)
|
145
|
+
|
146
|
+
for expert in range(e):
|
147
|
+
w1_amax = torch.abs(w1).max().to(torch.float32)
|
148
|
+
w2_amax = torch.abs(w2).max().to(torch.float32)
|
149
|
+
w1_gs[expert] = FLOAT8_E4M3_MAX * FLOAT4_E2M1_MAX / w1_amax
|
150
|
+
w2_gs[expert] = FLOAT8_E4M3_MAX * FLOAT4_E2M1_MAX / w2_amax
|
151
|
+
|
152
|
+
w1_q[expert], w1_blockscale[expert] = scaled_fp4_quant(
|
153
|
+
w1[expert], w1_gs[expert]
|
154
|
+
)
|
155
|
+
|
156
|
+
w2_q[expert], w2_blockscale[expert] = scaled_fp4_quant(
|
157
|
+
w2[expert], w2_gs[expert]
|
158
|
+
)
|
159
|
+
|
160
|
+
score = torch.randn((m, e), device="cuda", dtype=dtype)
|
161
|
+
|
162
|
+
topk_weights, topk_ids = select_experts(
|
163
|
+
hidden_states=a,
|
164
|
+
router_logits=score,
|
165
|
+
top_k=topk,
|
166
|
+
use_grouped_topk=False,
|
167
|
+
renormalize=False,
|
168
|
+
)
|
169
|
+
|
170
|
+
a1_gs = torch.ones((e,), device="cuda", dtype=torch.float32)
|
171
|
+
a2_gs = torch.ones((e,), device="cuda", dtype=torch.float32)
|
172
|
+
# strides for the cutlass moe_fp4 kernel
|
173
|
+
ab_strides_13 = torch.full(
|
174
|
+
(e,), w1_q.shape[2] * 2, dtype=torch.int64, device=w1_q.device
|
175
|
+
)
|
176
|
+
c_strides_13 = torch.full(
|
177
|
+
(e,), w1_q.shape[1], dtype=torch.int64, device=w1_q.device
|
178
|
+
)
|
179
|
+
ab_strides_2 = torch.full(
|
180
|
+
(e,), w2_q.shape[2] * 2, dtype=torch.int64, device=w2_q.device
|
181
|
+
)
|
182
|
+
c_strides_2 = torch.full((e,), w2_q.shape[1], dtype=torch.int64, device=w2_q.device)
|
183
|
+
params = CutlassMoEParams(
|
184
|
+
CutlassMoEType.BlockscaledFP4,
|
185
|
+
device=a.device,
|
186
|
+
num_experts=e,
|
187
|
+
intermediate_size_per_partition=n, # n
|
188
|
+
hidden_size=k,
|
189
|
+
) # k
|
190
|
+
cutlass_output = cutlass_moe_fp4(
|
191
|
+
a=a,
|
192
|
+
a1_gscale=a1_gs,
|
193
|
+
w1_fp4=w1_q,
|
194
|
+
w1_blockscale=w1_blockscale,
|
195
|
+
w1_alphas=(1 / w1_gs),
|
196
|
+
a2_gscale=a2_gs,
|
197
|
+
w2_fp4=w2_q,
|
198
|
+
w2_blockscale=w2_blockscale,
|
199
|
+
w2_alphas=(1 / w2_gs),
|
200
|
+
topk_weights=topk_weights,
|
201
|
+
topk_ids=topk_ids,
|
202
|
+
params=params,
|
203
|
+
apply_router_weight_on_input=False,
|
204
|
+
)
|
205
|
+
|
206
|
+
# Reference check:
|
207
|
+
a_global_scale = (
|
208
|
+
(FLOAT8_E4M3_MAX * FLOAT4_E2M1_MAX) / torch.amax(a.flatten(), dim=-1)
|
209
|
+
).to(torch.float32)
|
210
|
+
a_fp4, a_scale_interleaved = scaled_fp4_quant(a, a_global_scale)
|
211
|
+
_, m_k = a_fp4.shape
|
212
|
+
a_in_dtype = dequantize_nvfp4_to_dtype(
|
213
|
+
a_fp4,
|
214
|
+
a_scale_interleaved,
|
215
|
+
a_global_scale,
|
216
|
+
dtype=a.dtype,
|
217
|
+
device=a.device,
|
218
|
+
block_size=quant_blocksize,
|
219
|
+
)
|
220
|
+
|
221
|
+
w1_d = torch.empty((e, 2 * n, k), device="cuda", dtype=dtype)
|
222
|
+
w2_d = torch.empty((e, k, n), device="cuda", dtype=dtype)
|
223
|
+
|
224
|
+
for idx in range(0, e):
|
225
|
+
w1_d[idx] = dequantize_nvfp4_to_dtype(
|
226
|
+
w1_q[idx],
|
227
|
+
w1_blockscale[idx],
|
228
|
+
w1_gs[idx],
|
229
|
+
dtype=w1.dtype,
|
230
|
+
device=w1.device,
|
231
|
+
block_size=quant_blocksize,
|
232
|
+
)
|
233
|
+
w2_d[idx] = dequantize_nvfp4_to_dtype(
|
234
|
+
w2_q[idx],
|
235
|
+
w2_blockscale[idx],
|
236
|
+
w2_gs[idx],
|
237
|
+
dtype=w2.dtype,
|
238
|
+
device=w2.device,
|
239
|
+
block_size=quant_blocksize,
|
240
|
+
)
|
241
|
+
|
242
|
+
torch_output = torch_moe(a_in_dtype, w1_d, w2_d, score, topk, None)
|
243
|
+
|
244
|
+
torch.testing.assert_close(torch_output, cutlass_output, atol=1e-1, rtol=1e-1)
|
245
|
+
|
246
|
+
|
247
|
+
if __name__ == "__main__":
|
248
|
+
test_cutlass_fp4_moe_no_graph(224, 1024, 1024, 256, 8, torch.half)
|