sglang 0.4.6.post4__py3-none-any.whl → 0.4.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sglang/bench_offline_throughput.py +16 -10
- sglang/bench_one_batch.py +5 -4
- sglang/bench_one_batch_server.py +86 -22
- sglang/bench_serving.py +197 -110
- sglang/compile_deep_gemm.py +4 -4
- sglang/lang/backend/runtime_endpoint.py +24 -1
- sglang/profiler.py +167 -0
- sglang/srt/_custom_ops.py +34 -0
- sglang/srt/configs/internvl.py +8 -12
- sglang/srt/configs/model_config.py +66 -29
- sglang/srt/constrained/base_grammar_backend.py +5 -2
- sglang/srt/constrained/llguidance_backend.py +9 -8
- sglang/srt/constrained/outlines_backend.py +5 -4
- sglang/srt/constrained/xgrammar_backend.py +18 -18
- sglang/srt/conversation.py +47 -9
- sglang/srt/custom_op.py +38 -3
- sglang/srt/debug_utils.py +74 -0
- sglang/srt/disaggregation/common/__init__.py +1 -0
- sglang/srt/disaggregation/common/conn.py +407 -0
- sglang/srt/disaggregation/decode.py +187 -134
- sglang/srt/disaggregation/decode_schedule_batch_mixin.py +142 -0
- sglang/srt/disaggregation/fake/conn.py +4 -13
- sglang/srt/disaggregation/kv_events.py +412 -0
- sglang/srt/disaggregation/launch_lb.py +140 -0
- sglang/srt/disaggregation/mini_lb.py +84 -70
- sglang/srt/disaggregation/mooncake/conn.py +441 -140
- sglang/srt/disaggregation/mooncake/transfer_engine.py +31 -14
- sglang/srt/disaggregation/nixl/conn.py +124 -442
- sglang/srt/disaggregation/prefill.py +128 -44
- sglang/srt/disaggregation/utils.py +154 -6
- sglang/srt/distributed/device_communicators/pymscclpp.py +315 -0
- sglang/srt/distributed/parallel_state.py +52 -5
- sglang/srt/distributed/utils.py +3 -3
- sglang/srt/entrypoints/EngineBase.py +11 -0
- sglang/srt/entrypoints/engine.py +129 -12
- sglang/srt/entrypoints/http_server.py +21 -6
- sglang/srt/entrypoints/http_server_engine.py +5 -2
- sglang/srt/function_call/base_format_detector.py +302 -0
- sglang/srt/function_call/core_types.py +34 -0
- sglang/srt/function_call/deepseekv3_detector.py +205 -0
- sglang/srt/function_call/ebnf_composer.py +248 -0
- sglang/srt/function_call/function_call_parser.py +202 -0
- sglang/srt/function_call/llama32_detector.py +93 -0
- sglang/srt/function_call/mistral_detector.py +131 -0
- sglang/srt/function_call/pythonic_detector.py +229 -0
- sglang/srt/function_call/qwen25_detector.py +121 -0
- sglang/srt/function_call/utils.py +52 -0
- sglang/srt/hf_transformers_utils.py +50 -7
- sglang/srt/layers/attention/aiter_backend.py +878 -0
- sglang/srt/layers/attention/base_attn_backend.py +4 -0
- sglang/srt/layers/attention/cutlass_mla_backend.py +2 -19
- sglang/srt/layers/attention/flashattention_backend.py +166 -35
- sglang/srt/layers/attention/flashinfer_backend.py +45 -1
- sglang/srt/layers/attention/flashinfer_mla_backend.py +45 -5
- sglang/srt/layers/attention/flashmla_backend.py +340 -78
- sglang/srt/layers/attention/intel_amx_backend.py +128 -0
- sglang/srt/layers/attention/tbo_backend.py +232 -0
- sglang/srt/layers/attention/torch_native_backend.py +3 -0
- sglang/srt/layers/attention/triton_backend.py +247 -5
- sglang/srt/layers/attention/triton_ops/extend_attention.py +12 -4
- sglang/srt/layers/attention/utils.py +2 -2
- sglang/srt/layers/attention/vision.py +1 -1
- sglang/srt/layers/communicator.py +517 -0
- sglang/srt/layers/dp_attention.py +6 -15
- sglang/srt/layers/layernorm.py +30 -19
- sglang/srt/layers/moe/cutlass_moe.py +370 -0
- sglang/srt/layers/moe/cutlass_moe_params.py +169 -0
- sglang/srt/layers/moe/ep_moe/kernels.py +60 -17
- sglang/srt/layers/moe/ep_moe/layer.py +195 -87
- sglang/srt/layers/moe/ep_moe/token_dispatcher.py +88 -8
- sglang/srt/layers/moe/fused_moe_native.py +4 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=257,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_2_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_3_1/E=257,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_3_1/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- sglang/srt/layers/moe/fused_moe_triton/fused_moe.py +220 -25
- sglang/srt/layers/moe/fused_moe_triton/layer.py +48 -4
- sglang/srt/layers/moe/topk.py +107 -24
- sglang/srt/layers/multimodal.py +70 -0
- sglang/srt/layers/quantization/__init__.py +10 -4
- sglang/srt/layers/quantization/blockwise_int8.py +3 -0
- sglang/srt/layers/quantization/compressed_tensors/compressed_tensors_moe.py +5 -0
- sglang/srt/layers/quantization/deep_gemm.py +60 -59
- sglang/srt/layers/quantization/fp8.py +113 -18
- sglang/srt/layers/quantization/fp8_kernel.py +118 -66
- sglang/srt/layers/quantization/fp8_utils.py +165 -43
- sglang/srt/layers/quantization/gptq.py +298 -6
- sglang/srt/layers/quantization/int8_kernel.py +18 -5
- sglang/srt/layers/quantization/modelopt_quant.py +334 -7
- sglang/srt/layers/quantization/moe_wna16.py +3 -0
- sglang/srt/layers/quantization/qoq.py +244 -0
- sglang/srt/layers/quantization/w8a8_fp8.py +3 -0
- sglang/srt/layers/quantization/w8a8_int8.py +3 -0
- sglang/srt/layers/rotary_embedding.py +6 -12
- sglang/srt/layers/sampler.py +80 -79
- sglang/srt/layers/utils.py +6 -0
- sglang/srt/lora/layers.py +12 -15
- sglang/srt/lora/lora.py +49 -5
- sglang/srt/lora/lora_manager.py +20 -8
- sglang/srt/lora/mem_pool.py +24 -16
- sglang/srt/lora/utils.py +17 -13
- sglang/srt/managers/data_parallel_controller.py +13 -5
- sglang/srt/managers/eplb_algorithms/__init__.py +63 -0
- sglang/srt/managers/eplb_algorithms/deepseek.py +223 -0
- sglang/srt/managers/eplb_algorithms/deepseek_vec.py +276 -0
- sglang/srt/managers/eplb_manager.py +96 -0
- sglang/srt/managers/expert_distribution.py +878 -56
- sglang/srt/managers/expert_location.py +448 -0
- sglang/srt/managers/expert_location_dispatch.py +108 -0
- sglang/srt/managers/io_struct.py +29 -5
- sglang/srt/managers/mm_utils.py +355 -151
- sglang/srt/managers/multimodal_processors/base_processor.py +299 -42
- sglang/srt/managers/multimodal_processors/deepseek_vl_v2.py +6 -1
- sglang/srt/managers/multimodal_processors/gemma3.py +15 -17
- sglang/srt/managers/multimodal_processors/internvl.py +18 -5
- sglang/srt/managers/multimodal_processors/janus_pro.py +7 -1
- sglang/srt/managers/multimodal_processors/kimi_vl.py +14 -32
- sglang/srt/managers/multimodal_processors/llava.py +3 -3
- sglang/srt/managers/multimodal_processors/minicpm.py +27 -32
- sglang/srt/managers/multimodal_processors/mllama4.py +6 -0
- sglang/srt/managers/multimodal_processors/phi4mm.py +87 -0
- sglang/srt/managers/multimodal_processors/pixtral.py +9 -9
- sglang/srt/managers/multimodal_processors/qwen_vl.py +35 -35
- sglang/srt/managers/schedule_batch.py +185 -55
- sglang/srt/managers/schedule_policy.py +4 -5
- sglang/srt/managers/scheduler.py +389 -154
- sglang/srt/managers/session_controller.py +1 -1
- sglang/srt/managers/tokenizer_manager.py +231 -39
- sglang/srt/managers/utils.py +0 -4
- sglang/srt/mem_cache/base_prefix_cache.py +3 -0
- sglang/srt/mem_cache/chunk_cache.py +3 -1
- sglang/srt/mem_cache/hiradix_cache.py +4 -4
- sglang/srt/mem_cache/memory_pool.py +74 -52
- sglang/srt/mem_cache/multimodal_cache.py +45 -0
- sglang/srt/mem_cache/radix_cache.py +58 -5
- sglang/srt/metrics/collector.py +11 -2
- sglang/srt/mm_utils.py +10 -0
- sglang/srt/model_executor/cuda_graph_runner.py +87 -65
- sglang/srt/model_executor/expert_location_updater.py +557 -0
- sglang/srt/model_executor/forward_batch_info.py +39 -14
- sglang/srt/model_executor/model_runner.py +231 -101
- sglang/srt/model_loader/loader.py +10 -6
- sglang/srt/model_loader/utils.py +67 -1
- sglang/srt/models/clip.py +5 -1
- sglang/srt/models/deepseek_nextn.py +1 -1
- sglang/srt/models/deepseek_v2.py +732 -403
- sglang/srt/models/exaone.py +8 -3
- sglang/srt/models/gemma3_causal.py +7 -0
- sglang/srt/models/gemma3_mm.py +75 -33
- sglang/srt/models/idefics2.py +342 -0
- sglang/srt/models/kimi_vl.py +4 -4
- sglang/srt/models/llama.py +1 -1
- sglang/srt/models/llama4.py +10 -2
- sglang/srt/models/llava.py +26 -18
- sglang/srt/models/mimo_mtp.py +220 -0
- sglang/srt/models/minicpmo.py +7 -17
- sglang/srt/models/minicpmv.py +3 -295
- sglang/srt/models/mistral.py +71 -1
- sglang/srt/models/mllama.py +3 -3
- sglang/srt/models/phi4mm.py +512 -0
- sglang/srt/models/qwen2.py +133 -35
- sglang/srt/models/qwen2_5_vl.py +5 -3
- sglang/srt/models/qwen2_eagle.py +4 -1
- sglang/srt/models/qwen2_moe.py +206 -69
- sglang/srt/models/qwen2_vl.py +3 -3
- sglang/srt/models/qwen3.py +92 -19
- sglang/srt/models/qwen3_moe.py +457 -55
- sglang/srt/models/registry.py +9 -1
- sglang/srt/models/siglip.py +294 -0
- sglang/srt/models/transformers.py +291 -0
- sglang/srt/openai_api/adapter.py +114 -40
- sglang/srt/openai_api/protocol.py +37 -2
- sglang/srt/openai_api/utils.py +172 -0
- sglang/srt/operations.py +189 -0
- sglang/srt/operations_strategy.py +207 -0
- sglang/srt/sampling/sampling_batch_info.py +13 -1
- sglang/srt/sampling/sampling_params.py +2 -1
- sglang/srt/server_args.py +235 -38
- sglang/srt/speculative/build_eagle_tree.py +8 -8
- sglang/srt/speculative/eagle_draft_cuda_graph_runner.py +8 -11
- sglang/srt/speculative/eagle_draft_extend_cuda_graph_runner.py +253 -0
- sglang/srt/speculative/eagle_utils.py +181 -90
- sglang/srt/speculative/eagle_worker.py +146 -21
- sglang/srt/two_batch_overlap.py +635 -0
- sglang/srt/utils.py +197 -19
- sglang/test/runners.py +16 -7
- sglang/test/send_one.py +4 -0
- sglang/test/test_cutlass_moe.py +278 -0
- sglang/test/test_fp4_moe.py +248 -0
- sglang/test/test_utils.py +81 -42
- sglang/utils.py +2 -2
- sglang/version.py +1 -1
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/METADATA +31 -19
- sglang-0.4.7.dist-info/RECORD +699 -0
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/WHEEL +1 -1
- sglang/srt/function_call_parser.py +0 -858
- sglang/srt/platforms/interface.py +0 -371
- sglang-0.4.6.post4.dist-info/RECORD +0 -646
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=144,N=512,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=144,N=512,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1024,device_name=NVIDIA_H200.json → triton_3_1_0/E=16,N=1024,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json → triton_3_1_0/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=20,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=20,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=24,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=24,N=1024,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H20,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H20,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_L20,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_L20,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=256,N=64,device_name=NVIDIA_L40S,dtype=int8_w8a8.json → triton_3_1_0/E=256,N=64,device_name=NVIDIA_L40S,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=64,N=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=1280,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=1280,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=2560,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=2560,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=320,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=320,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_1_0/E=64,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=64,N=640,device_name=NVIDIA_H200.json → triton_3_1_0/E=64,N=640,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=14336,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=14336,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=14336,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=1792,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=1792,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=1792,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=2048,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=2048,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=3584,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=3584,device_name=NVIDIA_L40S.json → triton_3_1_0/E=8,N=3584,device_name=NVIDIA_L40S.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=4096,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=4096,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Instinct_MI300X.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Instinct_MI300X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Instinct_MI325X.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Instinct_MI325X.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=AMD_Radeon_Graphics.json → triton_3_1_0/E=8,N=7168,device_name=AMD_Radeon_Graphics.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=7168,device_name=NVIDIA_H200.json → triton_3_1_0/E=8,N=7168,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=AMD_Radeon_Graphics,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json → triton_3_1_0/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=192,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=192,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=384,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=384,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H100_80GB_HBM3.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H100_80GB_HBM3.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=768,device_name=NVIDIA_H200.json → triton_3_2_0/E=128,N=768,device_name=NVIDIA_H200.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=128,N=96,device_name=NVIDIA_H20.json → triton_3_2_0/E=128,N=96,device_name=NVIDIA_H20.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_2_0/E=264,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=264,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=264,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json → triton_3_2_0/E=272,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128, 128].json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=272,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=272,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/layers/moe/fused_moe_triton/configs/{E=288,N=64,device_name=NVIDIA_A800-SXM4-80GB.json → triton_3_2_0/E=288,N=64,device_name=NVIDIA_A800-SXM4-80GB.json} +0 -0
- /sglang/srt/models/{xiaomi_mimo.py → mimo.py} +0 -0
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/licenses/LICENSE +0 -0
- {sglang-0.4.6.post4.dist-info → sglang-0.4.7.dist-info}/top_level.txt +0 -0
sglang/srt/models/exaone.py
CHANGED
@@ -307,9 +307,14 @@ class ExaoneForCausalLM(nn.Module):
|
|
307
307
|
self.transformer = ExaoneModel(
|
308
308
|
config, quant_config=quant_config, prefix=add_prefix("transformer", prefix)
|
309
309
|
)
|
310
|
-
self.
|
311
|
-
|
312
|
-
|
310
|
+
if self.config.tie_word_embeddings:
|
311
|
+
self.lm_head = self.transformer.wte
|
312
|
+
else:
|
313
|
+
self.lm_head = ParallelLMHead(
|
314
|
+
config.vocab_size,
|
315
|
+
config.hidden_size,
|
316
|
+
prefix=add_prefix("lm_head", prefix),
|
317
|
+
)
|
313
318
|
self.logits_processor = LogitsProcessor(config)
|
314
319
|
|
315
320
|
@torch.no_grad()
|
@@ -277,6 +277,13 @@ class Gemma3Attention(nn.Module):
|
|
277
277
|
k = k.permute(0, 2, 1, 3)
|
278
278
|
|
279
279
|
attn_output = self.attn(q, k, v, forward_batch=forward_batch)
|
280
|
+
|
281
|
+
# Compatible with triton backend which returns [1, s, h, head_dim]
|
282
|
+
if attn_output.dim() == 4 and attn_output.shape[0] == 1:
|
283
|
+
attn_output = attn_output.squeeze(0)
|
284
|
+
attn_output = attn_output.flatten(-2, -1)
|
285
|
+
# [s, h * head_dim]
|
286
|
+
|
280
287
|
output, _ = self.o_proj(attn_output)
|
281
288
|
return output
|
282
289
|
|
sglang/srt/models/gemma3_mm.py
CHANGED
@@ -21,7 +21,7 @@ from typing import Dict, Iterable, List, Optional, Set, Tuple, TypedDict
|
|
21
21
|
|
22
22
|
import torch
|
23
23
|
from torch import nn
|
24
|
-
from transformers import
|
24
|
+
from transformers import Gemma3Config, PreTrainedModel
|
25
25
|
|
26
26
|
from sglang.srt.hf_transformers_utils import get_processor
|
27
27
|
from sglang.srt.layers.layernorm import Gemma3RMSNorm
|
@@ -42,6 +42,7 @@ from sglang.srt.model_loader.weight_utils import (
|
|
42
42
|
maybe_remap_kv_scale_name,
|
43
43
|
)
|
44
44
|
from sglang.srt.models.gemma3_causal import Gemma3ForCausalLM
|
45
|
+
from sglang.srt.models.siglip import SiglipVisionModel
|
45
46
|
from sglang.srt.utils import add_prefix
|
46
47
|
|
47
48
|
logger = logging.getLogger(__name__)
|
@@ -118,6 +119,7 @@ class Gemma3ForConditionalGeneration(PreTrainedModel):
|
|
118
119
|
".k_proj.",
|
119
120
|
".v_proj.",
|
120
121
|
".o_proj.",
|
122
|
+
".out_proj.",
|
121
123
|
]
|
122
124
|
bitsandbytes_stacked_params_mapping = {
|
123
125
|
# shard_name, weight_name, index
|
@@ -126,6 +128,7 @@ class Gemma3ForConditionalGeneration(PreTrainedModel):
|
|
126
128
|
"v_proj": ("qkv_proj", 2),
|
127
129
|
"gate_proj": ("gate_up_proj", 0),
|
128
130
|
"up_proj": ("gate_up_proj", 1),
|
131
|
+
"out_proj": ("proj", 0),
|
129
132
|
}
|
130
133
|
|
131
134
|
packed_modules_mapping = {
|
@@ -161,20 +164,21 @@ class Gemma3ForConditionalGeneration(PreTrainedModel):
|
|
161
164
|
super().__init__(config=config)
|
162
165
|
self.config = config
|
163
166
|
self.quant_config = quant_config
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
self.vision_tower = AutoModel.from_config(config=config.vision_config)
|
167
|
+
|
168
|
+
self.vision_tower = SiglipVisionModel(
|
169
|
+
config=config.vision_config,
|
170
|
+
quant_config=quant_config,
|
171
|
+
prefix=add_prefix("vision_tower", prefix),
|
172
|
+
)
|
173
|
+
|
172
174
|
self.multi_modal_projector = Gemma3MultiModalProjector(config)
|
173
175
|
self.vocab_size = config.text_config.vocab_size
|
174
176
|
|
175
177
|
# Text model
|
176
178
|
self.language_model = Gemma3ForCausalLM(
|
177
|
-
config.text_config,
|
179
|
+
config.text_config,
|
180
|
+
quant_config,
|
181
|
+
prefix=add_prefix("language_model", prefix),
|
178
182
|
)
|
179
183
|
if self.language_model.logits_processor.logit_scale:
|
180
184
|
logit_scale = getattr(config, "logit_scale", 1.0)
|
@@ -278,13 +282,33 @@ class Gemma3ForConditionalGeneration(PreTrainedModel):
|
|
278
282
|
Returns:
|
279
283
|
image_features (`torch.Tensor`): Image feature tensor of shape `(num_images, image_length, embed_dim)`).
|
280
284
|
"""
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
285
|
+
# Process images one by one to handle flatten_batch=True constraint in vision_tower
|
286
|
+
all_pixel_values = flatten_nested_list([item.pixel_values for item in items])
|
287
|
+
vision_outputs_list = []
|
288
|
+
|
289
|
+
for pixel_values_batch in all_pixel_values:
|
290
|
+
# Normalize input shape to [batch_size, channels, height, width]
|
291
|
+
if pixel_values_batch.dim() == 5:
|
292
|
+
pixel_values_batch = pixel_values_batch.squeeze(0)
|
293
|
+
elif pixel_values_batch.dim() == 3:
|
294
|
+
pixel_values_batch = pixel_values_batch.unsqueeze(0)
|
295
|
+
elif pixel_values_batch.dim() != 4:
|
296
|
+
raise ValueError(
|
297
|
+
f"Unexpected pixel_values shape: {pixel_values_batch.shape}"
|
298
|
+
)
|
299
|
+
|
300
|
+
# Process each image in the batch
|
301
|
+
batch_size = pixel_values_batch.shape[0]
|
302
|
+
for i in range(batch_size):
|
303
|
+
pixel_value = pixel_values_batch[i : i + 1] # Keep batch dimension as 1
|
304
|
+
pixel_value = pixel_value.to(
|
305
|
+
device=self.vision_tower.device, dtype=self.language_model.dtype()
|
306
|
+
)
|
307
|
+
vision_output = self.vision_tower(pixel_values=pixel_value)
|
308
|
+
vision_outputs_list.append(vision_output)
|
286
309
|
|
287
|
-
|
310
|
+
# Concatenate all vision outputs
|
311
|
+
vision_outputs = torch.cat(vision_outputs_list, dim=0)
|
288
312
|
image_features = self.multi_modal_projector(vision_outputs)
|
289
313
|
return image_features
|
290
314
|
|
@@ -360,6 +384,14 @@ class Gemma3ForConditionalGeneration(PreTrainedModel):
|
|
360
384
|
return self.language_model.tie_weights()
|
361
385
|
|
362
386
|
def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
|
387
|
+
stacked_params_mapping = [
|
388
|
+
# (param_name, shard_name, shard_id)
|
389
|
+
(".qkv_proj", ".q_proj", "q"),
|
390
|
+
(".qkv_proj", ".k_proj", "k"),
|
391
|
+
(".qkv_proj", ".v_proj", "v"),
|
392
|
+
("gate_up_proj", "up_proj", 1),
|
393
|
+
("gate_up_proj", "gate_proj", 0),
|
394
|
+
]
|
363
395
|
"""Load weights for the model."""
|
364
396
|
params_dict = dict(self.named_parameters())
|
365
397
|
loaded_params: Set[str] = set()
|
@@ -373,21 +405,33 @@ class Gemma3ForConditionalGeneration(PreTrainedModel):
|
|
373
405
|
loaded_params.update(causal_loaded_params)
|
374
406
|
continue
|
375
407
|
else:
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
408
|
+
for param_name, weight_name, shard_id in stacked_params_mapping:
|
409
|
+
if weight_name not in name:
|
410
|
+
continue
|
411
|
+
name = name.replace(weight_name, param_name)
|
412
|
+
# Skip loading extra bias for GPTQ models.
|
413
|
+
if name.endswith(".bias") and name not in params_dict:
|
414
|
+
continue
|
415
|
+
param = params_dict[name]
|
416
|
+
weight_loader = param.weight_loader
|
417
|
+
weight_loader(param, loaded_weight, shard_id)
|
418
|
+
break
|
419
|
+
else:
|
420
|
+
if "vision_model" in name:
|
421
|
+
# adapt to VisionAttention
|
422
|
+
name = name.replace(".self_attn.out_proj", ".self_attn.proj")
|
423
|
+
# Skip loading extra bias for GPTQ models
|
424
|
+
if name.endswith(".bias") and name not in params_dict:
|
425
|
+
continue
|
426
|
+
# Remapping the name of FP8 kv-scale
|
427
|
+
name = maybe_remap_kv_scale_name(name, params_dict)
|
428
|
+
if name is None:
|
429
|
+
continue
|
430
|
+
param = params_dict[name]
|
431
|
+
weight_loader = getattr(
|
432
|
+
param, "weight_loader", default_weight_loader
|
433
|
+
)
|
434
|
+
weight_loader(param, loaded_weight)
|
391
435
|
loaded_params.add(name)
|
392
436
|
unloaded_params = params_dict.keys() - loaded_params
|
393
437
|
if unloaded_params:
|
@@ -398,5 +442,3 @@ class Gemma3ForConditionalGeneration(PreTrainedModel):
|
|
398
442
|
|
399
443
|
|
400
444
|
EntryClass = Gemma3ForConditionalGeneration
|
401
|
-
|
402
|
-
AutoModel.register(Gemma3Config, Gemma3ForConditionalGeneration, exist_ok=True)
|
@@ -0,0 +1,342 @@
|
|
1
|
+
# Copyright 2023 The SGLang team.
|
2
|
+
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
|
3
|
+
#
|
4
|
+
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
|
5
|
+
# and OPT implementations in this library. It has been modified from its
|
6
|
+
# original forms to accommodate minor architectural differences compared
|
7
|
+
# to GPT-NeoX and OPT used by the Meta AI team that trained the model.
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
|
21
|
+
from typing import Optional
|
22
|
+
|
23
|
+
import torch
|
24
|
+
from torch import nn
|
25
|
+
from transformers import PretrainedConfig
|
26
|
+
|
27
|
+
from sglang.srt.layers.activation import get_act_fn
|
28
|
+
from sglang.srt.layers.attention.vision import VisionAttention
|
29
|
+
from sglang.srt.layers.linear import ColumnParallelLinear, RowParallelLinear
|
30
|
+
from sglang.srt.layers.quantization.base_config import QuantizationConfig
|
31
|
+
from sglang.srt.utils import add_prefix
|
32
|
+
|
33
|
+
|
34
|
+
class Idefics2VisionMLP(nn.Module):
|
35
|
+
|
36
|
+
def __init__(
|
37
|
+
self,
|
38
|
+
config: PretrainedConfig,
|
39
|
+
quant_config: Optional[QuantizationConfig] = None,
|
40
|
+
prefix: str = "",
|
41
|
+
) -> None:
|
42
|
+
super().__init__()
|
43
|
+
self.config = config
|
44
|
+
self.activation_fn = get_act_fn(config.hidden_act)
|
45
|
+
self.fc1 = ColumnParallelLinear(
|
46
|
+
config.hidden_size,
|
47
|
+
config.intermediate_size,
|
48
|
+
bias=True,
|
49
|
+
quant_config=quant_config,
|
50
|
+
prefix=add_prefix("fc1", prefix),
|
51
|
+
)
|
52
|
+
self.fc2 = RowParallelLinear(
|
53
|
+
config.intermediate_size,
|
54
|
+
config.hidden_size,
|
55
|
+
bias=True,
|
56
|
+
quant_config=quant_config,
|
57
|
+
prefix=add_prefix("fc2", prefix),
|
58
|
+
)
|
59
|
+
|
60
|
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
61
|
+
hidden_states, _ = self.fc1(hidden_states)
|
62
|
+
hidden_states = self.activation_fn(hidden_states)
|
63
|
+
hidden_states, _ = self.fc2(hidden_states)
|
64
|
+
return hidden_states
|
65
|
+
|
66
|
+
|
67
|
+
class Idefics2EncoderLayer(nn.Module):
|
68
|
+
|
69
|
+
def __init__(
|
70
|
+
self,
|
71
|
+
config: PretrainedConfig,
|
72
|
+
quant_config: Optional[QuantizationConfig] = None,
|
73
|
+
prefix: str = "",
|
74
|
+
) -> None:
|
75
|
+
super().__init__()
|
76
|
+
self.embed_dim = config.hidden_size
|
77
|
+
self.num_heads = config.num_attention_heads
|
78
|
+
self.self_attn = VisionAttention(
|
79
|
+
embed_dim=config.hidden_size,
|
80
|
+
num_heads=self.num_heads,
|
81
|
+
projection_size=config.intermediate_size,
|
82
|
+
use_qkv_parallel=True,
|
83
|
+
quant_config=quant_config,
|
84
|
+
dropout=config.attention_dropout,
|
85
|
+
qkv_backend="sdpa",
|
86
|
+
softmax_in_single_precision=True,
|
87
|
+
flatten_batch=False,
|
88
|
+
prefix=add_prefix("self_attn", prefix),
|
89
|
+
)
|
90
|
+
self.layer_norm1 = nn.LayerNorm(self.embed_dim, eps=config.layer_norm_eps)
|
91
|
+
self.mlp = Idefics2VisionMLP(
|
92
|
+
config,
|
93
|
+
quant_config=quant_config,
|
94
|
+
prefix=add_prefix("mlp", prefix),
|
95
|
+
)
|
96
|
+
self.layer_norm2 = nn.LayerNorm(self.embed_dim, eps=config.layer_norm_eps)
|
97
|
+
|
98
|
+
def forward(
|
99
|
+
self,
|
100
|
+
hidden_states: torch.Tensor,
|
101
|
+
cu_seqlens: torch.Tensor,
|
102
|
+
) -> torch.Tensor:
|
103
|
+
"""
|
104
|
+
Args:
|
105
|
+
hidden_states (`torch.FloatTensor`):
|
106
|
+
Input to the layer of shape `(batch, seq_len, embed_dim)`.
|
107
|
+
|
108
|
+
"""
|
109
|
+
residual = hidden_states
|
110
|
+
hidden_states = self.layer_norm1(hidden_states)
|
111
|
+
hidden_states = self.self_attn(hidden_states, cu_seqlens=cu_seqlens)
|
112
|
+
|
113
|
+
hidden_states = residual + hidden_states
|
114
|
+
residual = hidden_states
|
115
|
+
hidden_states = self.layer_norm2(hidden_states)
|
116
|
+
hidden_states = self.mlp(hidden_states)
|
117
|
+
hidden_states = residual + hidden_states
|
118
|
+
return hidden_states
|
119
|
+
|
120
|
+
|
121
|
+
class Idefics2Encoder(nn.Module):
|
122
|
+
"""
|
123
|
+
Transformer encoder consisting of `config.num_hidden_layers` self attention
|
124
|
+
layers. Each layer is a
|
125
|
+
[`Idefics2EncoderLayer`].
|
126
|
+
|
127
|
+
Args:
|
128
|
+
config: Idefics2Config
|
129
|
+
"""
|
130
|
+
|
131
|
+
def __init__(
|
132
|
+
self,
|
133
|
+
config: PretrainedConfig,
|
134
|
+
quant_config: Optional[QuantizationConfig] = None,
|
135
|
+
prefix: str = "",
|
136
|
+
) -> None:
|
137
|
+
super().__init__()
|
138
|
+
|
139
|
+
self.config = config
|
140
|
+
self.layers = nn.ModuleList(
|
141
|
+
[
|
142
|
+
Idefics2EncoderLayer(
|
143
|
+
config,
|
144
|
+
quant_config=quant_config,
|
145
|
+
prefix=add_prefix(f"layers.{i}", prefix),
|
146
|
+
)
|
147
|
+
for i in range(config.num_hidden_layers)
|
148
|
+
]
|
149
|
+
)
|
150
|
+
|
151
|
+
def forward(
|
152
|
+
self,
|
153
|
+
inputs_embeds: torch.Tensor,
|
154
|
+
cu_seqlens: torch.Tensor,
|
155
|
+
) -> torch.Tensor:
|
156
|
+
r"""
|
157
|
+
Args:
|
158
|
+
inputs_embeds (torch.Tensor):
|
159
|
+
Optionally, instead of passing `input_ids` you can choose to
|
160
|
+
directly pass an embedded representation.
|
161
|
+
This is useful if you want more control over how to convert
|
162
|
+
`input_ids` indices into associated vectorsthan the model's
|
163
|
+
internal embedding lookup matrix.
|
164
|
+
"""
|
165
|
+
hidden_states = inputs_embeds
|
166
|
+
for encoder_layer in self.layers:
|
167
|
+
layer_outputs = encoder_layer(
|
168
|
+
hidden_states,
|
169
|
+
cu_seqlens=cu_seqlens,
|
170
|
+
)
|
171
|
+
hidden_states = layer_outputs
|
172
|
+
return hidden_states
|
173
|
+
|
174
|
+
|
175
|
+
class Idefics2VisionEmbeddings(nn.Module):
|
176
|
+
"""
|
177
|
+
This is a modified version of `siglip.modelign_siglip.SiglipVisionEmbeddings
|
178
|
+
` to enable images of variable
|
179
|
+
resolution.
|
180
|
+
|
181
|
+
The modifications are adapted from [Patch n' Pack: NaViT, a Vision
|
182
|
+
Transformer for any Aspect Ratio and Resolution](https://arxiv.org/abs/2307.06304)
|
183
|
+
which allows treating images in their native aspect ratio and without the
|
184
|
+
need to resize them to the same fixed size. In particular, we start from the
|
185
|
+
original pre-trained SigLIP model(which uses images of fixed-size square
|
186
|
+
images) and adapt it by training on images of variable resolutions.
|
187
|
+
"""
|
188
|
+
|
189
|
+
def __init__(self, config: PretrainedConfig):
|
190
|
+
super().__init__()
|
191
|
+
self.embed_dim = config.hidden_size
|
192
|
+
self.image_size = config.image_size
|
193
|
+
self.patch_size = config.patch_size
|
194
|
+
self.patch_embedding = nn.Conv2d(
|
195
|
+
in_channels=config.num_channels,
|
196
|
+
out_channels=self.embed_dim,
|
197
|
+
kernel_size=self.patch_size,
|
198
|
+
stride=self.patch_size,
|
199
|
+
padding="valid",
|
200
|
+
)
|
201
|
+
self.num_patches_per_side = self.image_size // self.patch_size
|
202
|
+
self.num_patches = self.num_patches_per_side**2
|
203
|
+
self.num_positions = self.num_patches
|
204
|
+
self.position_embedding = nn.Embedding(self.num_positions, self.embed_dim)
|
205
|
+
|
206
|
+
def get_position_ids(
|
207
|
+
self,
|
208
|
+
pixel_values: torch.FloatTensor,
|
209
|
+
patch_attention_mask: torch.BoolTensor,
|
210
|
+
tgt_sizes: Optional[torch.IntTensor] = None,
|
211
|
+
):
|
212
|
+
batch_size, _, max_im_h, max_im_w = pixel_values.shape
|
213
|
+
|
214
|
+
max_nb_patches_h, max_nb_patches_w = (
|
215
|
+
max_im_h // self.patch_size,
|
216
|
+
max_im_w // self.patch_size,
|
217
|
+
)
|
218
|
+
boundaries = torch.arange(
|
219
|
+
1 / self.num_patches_per_side, 1.0, 1 / self.num_patches_per_side
|
220
|
+
)
|
221
|
+
position_ids = torch.full(
|
222
|
+
size=(batch_size, max_nb_patches_h * max_nb_patches_w), fill_value=0
|
223
|
+
)
|
224
|
+
|
225
|
+
for batch_idx, p_attn_mask in enumerate(patch_attention_mask):
|
226
|
+
|
227
|
+
if tgt_sizes is not None:
|
228
|
+
nb_patches_h = tgt_sizes[batch_idx][0]
|
229
|
+
nb_patches_w = tgt_sizes[batch_idx][1]
|
230
|
+
else:
|
231
|
+
nb_patches_h = p_attn_mask[:, 0].sum()
|
232
|
+
nb_patches_w = p_attn_mask[0].sum()
|
233
|
+
fractional_coords_h = torch.arange(0, 1 - 1e-6, 1 / nb_patches_h)
|
234
|
+
fractional_coords_w = torch.arange(0, 1 - 1e-6, 1 / nb_patches_w)
|
235
|
+
bucket_coords_h = torch.bucketize(
|
236
|
+
fractional_coords_h, boundaries, right=True
|
237
|
+
)
|
238
|
+
bucket_coords_w = torch.bucketize(
|
239
|
+
fractional_coords_w, boundaries, right=True
|
240
|
+
)
|
241
|
+
pos_ids = (
|
242
|
+
bucket_coords_h[:, None] * self.num_patches_per_side + bucket_coords_w
|
243
|
+
).flatten()
|
244
|
+
position_ids[batch_idx][p_attn_mask.view(-1).cpu()] = pos_ids
|
245
|
+
position_ids = position_ids.to(self.position_embedding.weight.device)
|
246
|
+
return position_ids
|
247
|
+
|
248
|
+
def forward(
|
249
|
+
self,
|
250
|
+
pixel_values: torch.FloatTensor,
|
251
|
+
patch_attention_mask: torch.BoolTensor,
|
252
|
+
tgt_sizes: Optional[torch.IntTensor] = None,
|
253
|
+
) -> torch.Tensor:
|
254
|
+
target_dtype = self.patch_embedding.weight.dtype
|
255
|
+
pixel_values = pixel_values.to(
|
256
|
+
device=self.patch_embedding.weight.device, dtype=target_dtype
|
257
|
+
)
|
258
|
+
patch_embeds = self.patch_embedding(pixel_values)
|
259
|
+
embeddings = patch_embeds.flatten(2).transpose(1, 2)
|
260
|
+
position_ids = self.get_position_ids(
|
261
|
+
pixel_values, patch_attention_mask, tgt_sizes
|
262
|
+
)
|
263
|
+
|
264
|
+
embeddings = embeddings + self.position_embedding(position_ids)
|
265
|
+
return embeddings
|
266
|
+
|
267
|
+
|
268
|
+
class Idefics2VisionTransformer(nn.Module):
|
269
|
+
|
270
|
+
def __init__(
|
271
|
+
self,
|
272
|
+
config: PretrainedConfig,
|
273
|
+
quant_config: Optional[QuantizationConfig] = None,
|
274
|
+
require_post_norm: bool = True,
|
275
|
+
prefix: str = "",
|
276
|
+
) -> None:
|
277
|
+
super().__init__()
|
278
|
+
|
279
|
+
embed_dim = config.hidden_size
|
280
|
+
self.config = config
|
281
|
+
self.embeddings = Idefics2VisionEmbeddings(config)
|
282
|
+
self.encoder = Idefics2Encoder(
|
283
|
+
config=config,
|
284
|
+
quant_config=quant_config,
|
285
|
+
prefix=add_prefix("encoder", prefix),
|
286
|
+
)
|
287
|
+
self.post_layernorm = (
|
288
|
+
nn.LayerNorm(embed_dim, eps=config.layer_norm_eps)
|
289
|
+
if require_post_norm
|
290
|
+
else nn.Identity()
|
291
|
+
)
|
292
|
+
|
293
|
+
def get_input_embeddings(self) -> nn.Embedding:
|
294
|
+
return self.embeddings
|
295
|
+
|
296
|
+
def compute_cu_seqlens(
|
297
|
+
self,
|
298
|
+
tgt_sizes: Optional[torch.Tensor] = None,
|
299
|
+
input_embeds: Optional[torch.Tensor] = None,
|
300
|
+
) -> torch.Tensor:
|
301
|
+
# shape: (batch_size,)
|
302
|
+
if tgt_sizes is not None:
|
303
|
+
seqlen = tgt_sizes[:, 0] * tgt_sizes[:, 1]
|
304
|
+
elif input_embeds is not None:
|
305
|
+
seqlen = torch.full(
|
306
|
+
size=(input_embeds.shape[0],),
|
307
|
+
fill_value=input_embeds.shape[1],
|
308
|
+
dtype=torch.int32,
|
309
|
+
device=input_embeds.device,
|
310
|
+
)
|
311
|
+
else:
|
312
|
+
raise ValueError(
|
313
|
+
"Either `tgt_sizes` or `input_embeds` must be provided to compute cu_seqlens."
|
314
|
+
)
|
315
|
+
|
316
|
+
cu_seqlens = torch.cat(
|
317
|
+
[
|
318
|
+
torch.tensor([0], device=seqlen.device, dtype=torch.int32),
|
319
|
+
torch.cumsum(seqlen, dim=0, dtype=torch.int32),
|
320
|
+
],
|
321
|
+
dim=0,
|
322
|
+
).to(seqlen.device)
|
323
|
+
return cu_seqlens
|
324
|
+
|
325
|
+
def forward(
|
326
|
+
self,
|
327
|
+
pixel_values,
|
328
|
+
patch_attention_mask: Optional[torch.BoolTensor] = None,
|
329
|
+
tgt_sizes: Optional[torch.IntTensor] = None,
|
330
|
+
) -> torch.Tensor:
|
331
|
+
hidden_states = self.embeddings(
|
332
|
+
pixel_values=pixel_values,
|
333
|
+
patch_attention_mask=patch_attention_mask,
|
334
|
+
tgt_sizes=tgt_sizes,
|
335
|
+
)
|
336
|
+
cu_seqlens = self.compute_cu_seqlens(tgt_sizes, hidden_states)
|
337
|
+
encoder_outputs = self.encoder(
|
338
|
+
hidden_states,
|
339
|
+
cu_seqlens=cu_seqlens,
|
340
|
+
)
|
341
|
+
last_hidden_state = self.post_layernorm(encoder_outputs)
|
342
|
+
return last_hidden_state
|
sglang/srt/models/kimi_vl.py
CHANGED
@@ -144,10 +144,10 @@ class KimiVLForConditionalGeneration(nn.Module):
|
|
144
144
|
.type(self.vision_tower.dtype)
|
145
145
|
.to(self.vision_tower.device)
|
146
146
|
)
|
147
|
-
|
148
|
-
|
149
|
-
)
|
150
|
-
image_features = self.vision_tower(pixel_values,
|
147
|
+
image_grid_hws = torch.cat([item.image_grid_hws for item in items], dim=0).to(
|
148
|
+
self.vision_tower.device
|
149
|
+
)
|
150
|
+
image_features = self.vision_tower(pixel_values, image_grid_hws)
|
151
151
|
assert isinstance(image_features, list)
|
152
152
|
# lengths = [x.shape[0] for x in image_features]
|
153
153
|
res = self.multi_modal_projector(torch.cat(image_features)) # .split(lengths)
|
sglang/srt/models/llama.py
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
"""Inference-only LLaMA model compatible with HuggingFace weights."""
|
18
18
|
|
19
19
|
import logging
|
20
|
-
from typing import Any, Dict, Iterable, List, Optional,
|
20
|
+
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
|
21
21
|
|
22
22
|
import torch
|
23
23
|
from torch import nn
|
sglang/srt/models/llama4.py
CHANGED
@@ -52,7 +52,15 @@ from sglang.srt.model_executor.forward_batch_info import (
|
|
52
52
|
PPProxyTensors,
|
53
53
|
)
|
54
54
|
from sglang.srt.models.llama import LlamaForCausalLM, LlamaMLP
|
55
|
-
from sglang.srt.utils import
|
55
|
+
from sglang.srt.utils import (
|
56
|
+
add_prefix,
|
57
|
+
fast_topk,
|
58
|
+
get_compiler_backend,
|
59
|
+
is_cuda,
|
60
|
+
make_layers,
|
61
|
+
)
|
62
|
+
|
63
|
+
_is_cuda = is_cuda()
|
56
64
|
|
57
65
|
logger = logging.getLogger(__name__)
|
58
66
|
|
@@ -131,7 +139,7 @@ class Llama4MoE(nn.Module):
|
|
131
139
|
return out_aD
|
132
140
|
|
133
141
|
def _forward_core(self, hidden_states, forward_mode: ForwardMode):
|
134
|
-
if hidden_states.shape[0] < 4:
|
142
|
+
if hidden_states.shape[0] < 4 and _is_cuda:
|
135
143
|
return self._forward_core_shared_routed_overlap(hidden_states)
|
136
144
|
else:
|
137
145
|
return self._forward_core_normal(hidden_states)
|