sglang 0.4.6.post5__py3-none-any.whl → 0.4.7.post1__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/__init__.py +2 -0
- sglang/api.py +7 -0
- sglang/bench_offline_throughput.py +10 -4
- sglang/bench_one_batch_server.py +67 -11
- sglang/bench_serving.py +86 -75
- sglang/lang/backend/runtime_endpoint.py +24 -1
- sglang/lang/interpreter.py +40 -1
- sglang/lang/ir.py +27 -0
- sglang/math_utils.py +8 -0
- 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 +33 -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 +52 -8
- sglang/srt/custom_op.py +38 -3
- sglang/srt/debug_utils.py +74 -0
- sglang/srt/disaggregation/base/__init__.py +1 -1
- sglang/srt/disaggregation/base/conn.py +25 -11
- sglang/srt/disaggregation/common/__init__.py +5 -0
- sglang/srt/disaggregation/common/conn.py +407 -0
- sglang/srt/disaggregation/common/utils.py +42 -0
- sglang/srt/disaggregation/decode.py +261 -52
- sglang/srt/disaggregation/fake/__init__.py +1 -1
- sglang/srt/disaggregation/fake/conn.py +16 -9
- 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/__init__.py +1 -1
- sglang/srt/disaggregation/mooncake/conn.py +446 -149
- sglang/srt/disaggregation/mooncake/transfer_engine.py +32 -16
- sglang/srt/disaggregation/nixl/__init__.py +6 -1
- sglang/srt/disaggregation/nixl/conn.py +134 -437
- sglang/srt/disaggregation/prefill.py +130 -43
- sglang/srt/disaggregation/utils.py +127 -86
- 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 +116 -5
- sglang/srt/entrypoints/http_server.py +28 -4
- sglang/srt/eplb_simulator/__init__.py +1 -0
- sglang/srt/eplb_simulator/reader.py +51 -0
- 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/activation.py +19 -0
- sglang/srt/layers/attention/aiter_backend.py +503 -125
- sglang/srt/layers/attention/base_attn_backend.py +4 -0
- sglang/srt/layers/attention/cutlass_mla_backend.py +40 -34
- sglang/srt/layers/attention/flashattention_backend.py +137 -63
- sglang/srt/layers/attention/flashinfer_backend.py +46 -3
- sglang/srt/layers/attention/flashinfer_mla_backend.py +59 -25
- sglang/srt/layers/attention/flashmla_backend.py +2 -10
- 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 +304 -65
- sglang/srt/layers/attention/triton_ops/decode_attention.py +2 -7
- sglang/srt/layers/attention/triton_ops/extend_attention.py +12 -4
- sglang/srt/layers/attention/vision.py +51 -24
- sglang/srt/layers/communicator.py +281 -197
- sglang/srt/layers/dp_attention.py +6 -5
- sglang/srt/layers/layernorm.py +30 -19
- sglang/srt/layers/linear.py +0 -4
- sglang/srt/layers/logits_processor.py +0 -12
- 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 +33 -11
- sglang/srt/layers/moe/ep_moe/layer.py +136 -72
- sglang/srt/layers/moe/ep_moe/token_dispatcher.py +24 -45
- 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 +221 -29
- sglang/srt/layers/moe/fused_moe_triton/layer.py +34 -4
- sglang/srt/layers/moe/topk.py +60 -26
- sglang/srt/layers/multimodal.py +3 -3
- sglang/srt/layers/pooler.py +56 -0
- 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_wrapper/__init__.py +1 -0
- sglang/srt/layers/quantization/{deep_gemm.py → deep_gemm_wrapper/compile_utils.py} +69 -127
- sglang/srt/layers/quantization/deep_gemm_wrapper/configurer.py +32 -0
- sglang/srt/layers/quantization/deep_gemm_wrapper/entrypoint.py +110 -0
- sglang/srt/layers/quantization/fp8.py +28 -23
- sglang/srt/layers/quantization/fp8_kernel.py +156 -75
- sglang/srt/layers/quantization/fp8_utils.py +250 -69
- 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/radix_attention.py +2 -3
- 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 +98 -39
- sglang/srt/lora/mem_pool.py +28 -21
- sglang/srt/lora/utils.py +17 -13
- sglang/srt/managers/cache_controller.py +2 -1
- 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 +43 -8
- sglang/srt/managers/mm_utils.py +88 -38
- sglang/srt/managers/multimodal_processors/base_processor.py +190 -18
- 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/multimodal_processors/vila.py +85 -0
- sglang/srt/managers/schedule_batch.py +173 -38
- sglang/srt/managers/scheduler.py +376 -127
- sglang/srt/managers/tokenizer_manager.py +163 -19
- sglang/srt/managers/utils.py +0 -4
- sglang/srt/mem_cache/chunk_cache.py +1 -0
- sglang/srt/mem_cache/hiradix_cache.py +4 -2
- sglang/srt/mem_cache/memory_pool.py +111 -407
- sglang/srt/mem_cache/memory_pool_host.py +380 -0
- sglang/srt/mem_cache/radix_cache.py +36 -12
- sglang/srt/metrics/collector.py +9 -0
- sglang/srt/model_executor/cuda_graph_runner.py +191 -113
- sglang/srt/model_executor/expert_location_updater.py +157 -22
- sglang/srt/model_executor/forward_batch_info.py +52 -22
- sglang/srt/model_executor/model_runner.py +102 -62
- sglang/srt/model_loader/loader.py +8 -1
- sglang/srt/model_loader/utils.py +67 -1
- sglang/srt/models/bert.py +113 -13
- sglang/srt/models/deepseek_nextn.py +1 -1
- sglang/srt/models/deepseek_v2.py +623 -290
- 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/internvl.py +46 -102
- 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/roberta.py +117 -9
- sglang/srt/models/transformers.py +291 -0
- sglang/srt/models/vila.py +305 -0
- sglang/srt/openai_api/adapter.py +248 -28
- sglang/srt/openai_api/protocol.py +68 -3
- 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 +37 -1
- sglang/srt/sampling/sampling_params.py +4 -1
- sglang/srt/server_args.py +381 -209
- sglang/srt/speculative/build_eagle_tree.py +9 -9
- sglang/srt/speculative/eagle_draft_cuda_graph_runner.py +12 -14
- sglang/srt/speculative/eagle_draft_extend_cuda_graph_runner.py +256 -0
- sglang/srt/speculative/eagle_utils.py +440 -200
- sglang/srt/speculative/eagle_worker.py +234 -63
- sglang/srt/two_batch_overlap.py +637 -0
- sglang/srt/utils.py +187 -7
- sglang/test/attention/test_prefix_chunk_info.py +2 -0
- sglang/test/runners.py +54 -10
- sglang/test/send_one.py +4 -0
- sglang/test/test_block_fp8.py +1 -0
- sglang/test/test_block_fp8_deep_gemm_blackwell.py +252 -0
- sglang/test/test_block_fp8_ep.py +1 -0
- sglang/test/test_cutlass_moe.py +3 -3
- sglang/test/test_fp4_moe.py +248 -0
- sglang/test/test_utils.py +82 -7
- sglang/utils.py +9 -0
- sglang/version.py +1 -1
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.post1.dist-info}/METADATA +17 -14
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.post1.dist-info}/RECORD +359 -321
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.post1.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.post1.dist-info}/licenses/LICENSE +0 -0
- {sglang-0.4.6.post5.dist-info → sglang-0.4.7.post1.dist-info}/top_level.txt +0 -0
sglang/lang/interpreter.py
CHANGED
@@ -26,6 +26,7 @@ from sglang.lang.ir import (
|
|
26
26
|
SglRoleBegin,
|
27
27
|
SglRoleEnd,
|
28
28
|
SglSelect,
|
29
|
+
SglSeparateReasoning,
|
29
30
|
SglVariable,
|
30
31
|
SglVarScopeBegin,
|
31
32
|
SglVarScopeEnd,
|
@@ -472,6 +473,8 @@ class StreamExecutor:
|
|
472
473
|
self._execute_concatenate_and_append_kv_cache(other)
|
473
474
|
else:
|
474
475
|
self._execute_concatenate_and_append_text(other)
|
476
|
+
elif isinstance(other, SglSeparateReasoning):
|
477
|
+
self._execute_separate_reasoning(other)
|
475
478
|
else:
|
476
479
|
raise ValueError(f"Unknown type: {type(other)}")
|
477
480
|
|
@@ -724,8 +727,44 @@ class StreamExecutor:
|
|
724
727
|
src_rids = [state.stream_executor.sid for state in expr.states]
|
725
728
|
self.backend.concatenate_and_append(src_rids, self.sid)
|
726
729
|
|
730
|
+
def _execute_separate_reasoning(self, expr: SglSeparateReasoning):
|
731
|
+
if self.stream:
|
732
|
+
# separate reasoning for stream is not supported
|
733
|
+
return
|
734
|
+
|
735
|
+
if (
|
736
|
+
self.cur_role == "assistant"
|
737
|
+
and self.num_api_spec_tokens is not None
|
738
|
+
and self.backend.is_chat_model
|
739
|
+
):
|
740
|
+
# Execute the stored lazy generation calls
|
741
|
+
self.backend.role_end_generate(self)
|
742
|
+
|
743
|
+
from sglang.srt.reasoning_parser import ReasoningParser
|
744
|
+
|
745
|
+
reasoning_parser = ReasoningParser(expr.model_type)
|
746
|
+
other = expr.expr
|
747
|
+
if not other:
|
748
|
+
return
|
749
|
+
elif isinstance(other, SglGen) or isinstance(other, SglSelect):
|
750
|
+
cur_text = self.get_var(other.name)
|
751
|
+
reasoning, normal_text = reasoning_parser.parse_non_stream(cur_text)
|
752
|
+
reasoning_name = expr.process_name_for_reasoning(other.name)
|
753
|
+
self.set_var(other.name, normal_text)
|
754
|
+
self.set_var(reasoning_name, reasoning)
|
755
|
+
# the variable is ready to be used
|
756
|
+
self.variable_event[reasoning_name].set()
|
757
|
+
self.text_ = self.text_[: self.cur_role_begin_pos] + normal_text
|
758
|
+
elif isinstance(other, SglExprList):
|
759
|
+
for x in other.expr_list:
|
760
|
+
self._execute_separate_reasoning(
|
761
|
+
SglSeparateReasoning(expr.model_type, x)
|
762
|
+
)
|
763
|
+
|
727
764
|
def _init_var_event(self, expr):
|
728
|
-
if isinstance(
|
765
|
+
if isinstance(
|
766
|
+
expr, (SglGen, SglSelect, SglVarScopeBegin, SglSeparateReasoning)
|
767
|
+
):
|
729
768
|
self.variable_event[expr.name] = threading.Event()
|
730
769
|
if self.stream:
|
731
770
|
self.stream_var_event[expr.name] = threading.Event()
|
sglang/lang/ir.py
CHANGED
@@ -606,3 +606,30 @@ class SglCommitLazy(SglExpr):
|
|
606
606
|
|
607
607
|
def __repr__(self):
|
608
608
|
return "CommitLazy()"
|
609
|
+
|
610
|
+
|
611
|
+
class SglSeparateReasoning(SglExpr):
|
612
|
+
def __init__(self, model_type: str, expr: SglExpr):
|
613
|
+
super().__init__()
|
614
|
+
self.model_type = model_type
|
615
|
+
|
616
|
+
self.expr = expr
|
617
|
+
self.name = None
|
618
|
+
self._process_expr(expr)
|
619
|
+
|
620
|
+
def process_name_for_reasoning(self, name):
|
621
|
+
if not name:
|
622
|
+
raise ValueError("name must be provided")
|
623
|
+
return f"{name}_reasoning_content"
|
624
|
+
|
625
|
+
def _process_expr(self, expr):
|
626
|
+
if isinstance(expr, SglGen):
|
627
|
+
self.name = self.process_name_for_reasoning(expr.name)
|
628
|
+
elif isinstance(expr, SglSelect):
|
629
|
+
self.name = self.process_name_for_reasoning(expr.name)
|
630
|
+
elif isinstance(expr, SglExprList):
|
631
|
+
for x in expr.expr_list:
|
632
|
+
self._process_expr(x)
|
633
|
+
|
634
|
+
def __repr__(self):
|
635
|
+
return f"SeparateReasoning(model_type={self.model_type}, name={self.name})"
|
sglang/math_utils.py
ADDED
sglang/profiler.py
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
"""
|
2
|
+
Run live profiling.
|
3
|
+
|
4
|
+
Usage:
|
5
|
+
python3 -m sglang.profiler
|
6
|
+
"""
|
7
|
+
|
8
|
+
import argparse
|
9
|
+
import json
|
10
|
+
import os
|
11
|
+
import time
|
12
|
+
import urllib.parse
|
13
|
+
from argparse import ArgumentParser
|
14
|
+
from pathlib import Path
|
15
|
+
from typing import List, Optional
|
16
|
+
|
17
|
+
import requests
|
18
|
+
|
19
|
+
PARENT_FOLDER = "/tmp/sglang-profile"
|
20
|
+
|
21
|
+
|
22
|
+
def _run_profile(
|
23
|
+
url: Optional[str],
|
24
|
+
num_steps: int,
|
25
|
+
activities: List[str],
|
26
|
+
output_dir: Optional[str] = None,
|
27
|
+
profile_name: Optional[str] = None,
|
28
|
+
profile_by_stage: bool = False,
|
29
|
+
) -> str:
|
30
|
+
if output_dir is None:
|
31
|
+
output_dir = PARENT_FOLDER
|
32
|
+
|
33
|
+
output_dir = os.path.normpath(output_dir)
|
34
|
+
output_dir = os.path.abspath(output_dir)
|
35
|
+
output_dir = Path(output_dir)
|
36
|
+
|
37
|
+
# Add "profile_name/timestamp" to the path.
|
38
|
+
if profile_name:
|
39
|
+
output_dir = output_dir / profile_name
|
40
|
+
output_dir = output_dir / str(time.time())
|
41
|
+
output_dir.mkdir(exist_ok=True, parents=True)
|
42
|
+
|
43
|
+
print(f"Dump profiling traces to {output_dir}")
|
44
|
+
print(
|
45
|
+
f"Waiting for {num_steps} steps and the trace to be flushed.... ({profile_by_stage=})"
|
46
|
+
)
|
47
|
+
|
48
|
+
# Dump server args.
|
49
|
+
file_path = Path(output_dir) / "server_args.json"
|
50
|
+
if not file_path.exists():
|
51
|
+
response = requests.get(url + "/get_server_info")
|
52
|
+
response.raise_for_status()
|
53
|
+
server_args_data = response.json()
|
54
|
+
with open(file_path, "w") as file:
|
55
|
+
file.write(json.dumps(server_args_data))
|
56
|
+
|
57
|
+
# Start profiler. The API replies when all steps are processed
|
58
|
+
# and files are generated.
|
59
|
+
json_data = {
|
60
|
+
"output_dir": str(output_dir),
|
61
|
+
"num_steps": str(num_steps),
|
62
|
+
"activities": activities,
|
63
|
+
"profile_by_stage": profile_by_stage,
|
64
|
+
}
|
65
|
+
|
66
|
+
response = requests.post(url=url + "/start_profile", json=json_data)
|
67
|
+
response.raise_for_status()
|
68
|
+
|
69
|
+
trace_link = str(output_dir)
|
70
|
+
return trace_link
|
71
|
+
|
72
|
+
|
73
|
+
def run_profile(
|
74
|
+
url: Optional[str],
|
75
|
+
num_steps: int,
|
76
|
+
activities: List[str],
|
77
|
+
output_dir: Optional[str] = None,
|
78
|
+
profile_name: Optional[str] = None,
|
79
|
+
profile_by_stage: bool = False,
|
80
|
+
):
|
81
|
+
# step based profile will self terminate on num_steps constraints
|
82
|
+
link = _run_profile(
|
83
|
+
url, num_steps, activities, output_dir, profile_name, profile_by_stage
|
84
|
+
)
|
85
|
+
return link
|
86
|
+
|
87
|
+
|
88
|
+
if __name__ == "__main__":
|
89
|
+
parser = ArgumentParser(description="Benchmark the online serving throughput.")
|
90
|
+
parser.add_argument(
|
91
|
+
"--url",
|
92
|
+
type=str,
|
93
|
+
default="http://localhost:30000",
|
94
|
+
help="Server or API base url if not using http host and port.",
|
95
|
+
)
|
96
|
+
parser.add_argument(
|
97
|
+
"--output-dir",
|
98
|
+
type=str,
|
99
|
+
default=None,
|
100
|
+
help="Profile directory to dump profile traces.",
|
101
|
+
)
|
102
|
+
parser.add_argument(
|
103
|
+
"--profile-name",
|
104
|
+
type=str,
|
105
|
+
default=None,
|
106
|
+
help="The name of this profile run.",
|
107
|
+
)
|
108
|
+
parser.add_argument(
|
109
|
+
"--num-steps",
|
110
|
+
type=int,
|
111
|
+
default=5,
|
112
|
+
help="The number of forward steps to profile.",
|
113
|
+
)
|
114
|
+
parser.add_argument(
|
115
|
+
"--profile-by-stage",
|
116
|
+
action=argparse.BooleanOptionalAction,
|
117
|
+
type=bool,
|
118
|
+
default=False,
|
119
|
+
help="The number of forward steps to profile.",
|
120
|
+
)
|
121
|
+
parser.add_argument(
|
122
|
+
"--cpu",
|
123
|
+
action=argparse.BooleanOptionalAction,
|
124
|
+
type=bool,
|
125
|
+
default=True,
|
126
|
+
help="Whether to profile CPU activity",
|
127
|
+
)
|
128
|
+
parser.add_argument(
|
129
|
+
"--gpu",
|
130
|
+
action=argparse.BooleanOptionalAction,
|
131
|
+
type=bool,
|
132
|
+
default=True,
|
133
|
+
help="Whether to profile GPU activity",
|
134
|
+
)
|
135
|
+
parser.add_argument(
|
136
|
+
"--mem",
|
137
|
+
action=argparse.BooleanOptionalAction,
|
138
|
+
type=bool,
|
139
|
+
default=False,
|
140
|
+
help="Whether to memory usage (https://pytorch.org/memory_viz)",
|
141
|
+
)
|
142
|
+
parser.add_argument(
|
143
|
+
"--rpd",
|
144
|
+
action=argparse.BooleanOptionalAction,
|
145
|
+
type=bool,
|
146
|
+
default=False,
|
147
|
+
help="Whether to use rpd profiler (https://github.com/ROCm/rocmProfileData)",
|
148
|
+
)
|
149
|
+
|
150
|
+
args = parser.parse_args()
|
151
|
+
activities = []
|
152
|
+
if args.cpu:
|
153
|
+
activities.append("CPU")
|
154
|
+
if args.gpu:
|
155
|
+
activities.append("GPU")
|
156
|
+
if args.mem:
|
157
|
+
activities.append("MEM")
|
158
|
+
if args.rpd:
|
159
|
+
activities.append("RPD")
|
160
|
+
run_profile(
|
161
|
+
args.url,
|
162
|
+
args.num_steps,
|
163
|
+
activities,
|
164
|
+
args.output_dir,
|
165
|
+
args.profile_name,
|
166
|
+
args.profile_by_stage,
|
167
|
+
)
|
sglang/srt/_custom_ops.py
CHANGED
@@ -113,3 +113,37 @@ else:
|
|
113
113
|
|
114
114
|
def get_meta_buffer_ipc_handle(inp: torch.Tensor) -> torch.Tensor:
|
115
115
|
return sgl_kernel.allreduce.get_meta_buffer_ipc_handle(inp)
|
116
|
+
|
117
|
+
|
118
|
+
def mscclpp_generate_unique_id() -> bytes:
|
119
|
+
return sgl_kernel.allreduce.mscclpp_generate_unique_id()
|
120
|
+
|
121
|
+
|
122
|
+
def mscclpp_init_context(
|
123
|
+
unique_id: bytes,
|
124
|
+
rank: int,
|
125
|
+
world_size: int,
|
126
|
+
scratch: torch.Tensor,
|
127
|
+
put_buffer: torch.Tensor,
|
128
|
+
nranks_per_node: int,
|
129
|
+
rank_to_node: List[int],
|
130
|
+
rank_to_ib: List[int],
|
131
|
+
context_selection: int,
|
132
|
+
) -> int:
|
133
|
+
return sgl_kernel.allreduce.mscclpp_init_context(
|
134
|
+
unique_id,
|
135
|
+
rank,
|
136
|
+
world_size,
|
137
|
+
scratch,
|
138
|
+
put_buffer,
|
139
|
+
nranks_per_node,
|
140
|
+
rank_to_node,
|
141
|
+
rank_to_ib,
|
142
|
+
context_selection,
|
143
|
+
)
|
144
|
+
|
145
|
+
|
146
|
+
def mscclpp_allreduce(
|
147
|
+
context: int, inp: torch.Tensor, out: torch.Tensor, nthreads: int, nblocks: int
|
148
|
+
) -> None:
|
149
|
+
return sgl_kernel.allreduce.mscclpp_allreduce(context, inp, out, nthreads, nblocks)
|
sglang/srt/configs/internvl.py
CHANGED
@@ -7,11 +7,8 @@ import sentencepiece as spm
|
|
7
7
|
from transformers import (
|
8
8
|
TOKENIZER_MAPPING,
|
9
9
|
LlamaConfig,
|
10
|
-
Phi3Config,
|
11
10
|
PretrainedConfig,
|
12
11
|
PreTrainedTokenizer,
|
13
|
-
PreTrainedTokenizerFast,
|
14
|
-
Qwen2Config,
|
15
12
|
)
|
16
13
|
|
17
14
|
from sglang.utils import logger
|
@@ -302,24 +299,23 @@ class InternVLChatConfig(PretrainedConfig):
|
|
302
299
|
)
|
303
300
|
|
304
301
|
if llm_config is None:
|
305
|
-
|
306
|
-
llm_config = {"architectures": [""]}
|
302
|
+
llm_config = {"architectures": ["InternLM2ForCausalLM"]}
|
307
303
|
logger.info(
|
308
304
|
"llm_config is None. Initializing the LlamaConfig config with default values (`LlamaConfig`)."
|
309
305
|
)
|
306
|
+
|
310
307
|
self.vision_config = InternVisionConfig(**vision_config)
|
311
|
-
if llm_config
|
308
|
+
if llm_config.get("architectures")[0] == "LlamaForCausalLM":
|
312
309
|
self.llm_config = LlamaConfig(**llm_config)
|
313
|
-
elif llm_config
|
310
|
+
elif llm_config.get("architectures")[0] == "InternLM2ForCausalLM":
|
314
311
|
self.llm_config = InternLM2Config(**llm_config)
|
315
|
-
elif llm_config["architectures"][0] == "Phi3ForCausalLM":
|
316
|
-
self.llm_config = Phi3Config(**llm_config)
|
317
|
-
elif llm_config["architectures"][0] == "Qwen2ForCausalLM":
|
318
|
-
self.llm_config = Qwen2Config(**llm_config)
|
319
312
|
else:
|
320
313
|
raise ValueError(
|
321
|
-
"Unsupported architecture: {}".format(
|
314
|
+
"Unsupported architecture: {}".format(
|
315
|
+
llm_config.get("architectures")[0]
|
316
|
+
)
|
322
317
|
)
|
318
|
+
|
323
319
|
self.use_backbone_lora = use_backbone_lora
|
324
320
|
self.use_llm_lora = use_llm_lora
|
325
321
|
self.pad2square = pad2square
|
@@ -16,7 +16,7 @@ import json
|
|
16
16
|
import logging
|
17
17
|
import math
|
18
18
|
import os
|
19
|
-
from enum import IntEnum, auto
|
19
|
+
from enum import Enum, IntEnum, auto
|
20
20
|
from typing import List, Optional, Set, Union
|
21
21
|
|
22
22
|
import torch
|
@@ -39,6 +39,12 @@ class AttentionArch(IntEnum):
|
|
39
39
|
MHA = auto()
|
40
40
|
|
41
41
|
|
42
|
+
class ModelImpl(str, Enum):
|
43
|
+
AUTO = "auto"
|
44
|
+
SGLANG = "sglang"
|
45
|
+
TRANSFORMERS = "transformers"
|
46
|
+
|
47
|
+
|
42
48
|
class ModelConfig:
|
43
49
|
def __init__(
|
44
50
|
self,
|
@@ -53,11 +59,13 @@ class ModelConfig:
|
|
53
59
|
quantization: Optional[str] = None,
|
54
60
|
override_config_file: Optional[str] = None,
|
55
61
|
is_draft_model: bool = False,
|
62
|
+
impl: Union[str, ModelImpl] = ModelImpl.AUTO,
|
56
63
|
) -> None:
|
57
64
|
|
58
65
|
self.model_path = model_path
|
59
66
|
self.revision = revision
|
60
67
|
self.quantization = quantization
|
68
|
+
self.impl = impl
|
61
69
|
|
62
70
|
# Parse args
|
63
71
|
self.maybe_pull_model_tokenizer_from_remote()
|
@@ -196,6 +204,22 @@ class ModelConfig:
|
|
196
204
|
self.v_head_dim = self.hf_text_config.v_head_dim
|
197
205
|
self.qk_nope_head_dim = self.hf_text_config.qk_nope_head_dim
|
198
206
|
else:
|
207
|
+
if (
|
208
|
+
"MistralModel" in self.hf_config.architectures
|
209
|
+
or "MixtralForCausalLM" in self.hf_config.architectures
|
210
|
+
or "MistralForCausalLM" in self.hf_config.architectures
|
211
|
+
):
|
212
|
+
if getattr(self, "head_dim", None) is None:
|
213
|
+
self.head_dim = (
|
214
|
+
self.hf_config.hidden_size // self.hf_config.num_attention_heads
|
215
|
+
)
|
216
|
+
# In transformers==4.52.3, the head_dim is null in MistralConfig
|
217
|
+
if (
|
218
|
+
not hasattr(self.hf_text_config, "head_dim")
|
219
|
+
or self.hf_text_config.head_dim is None
|
220
|
+
):
|
221
|
+
setattr(self.hf_text_config, "head_dim", self.head_dim)
|
222
|
+
|
199
223
|
self.attention_arch = AttentionArch.MHA
|
200
224
|
|
201
225
|
self.num_attention_heads = self.hf_text_config.num_attention_heads
|
@@ -240,6 +264,7 @@ class ModelConfig:
|
|
240
264
|
enable_multimodal=server_args.enable_multimodal,
|
241
265
|
dtype=server_args.dtype,
|
242
266
|
quantization=server_args.quantization,
|
267
|
+
impl=server_args.impl,
|
243
268
|
**kwargs,
|
244
269
|
)
|
245
270
|
|
@@ -525,6 +550,11 @@ def is_generation_model(model_architectures: List[str], is_embedding: bool = Fal
|
|
525
550
|
or "Qwen2ForRewardModel" in model_architectures
|
526
551
|
or "Qwen2ForSequenceClassification" in model_architectures
|
527
552
|
or "CLIPModel" in model_architectures
|
553
|
+
or "BertModel" in model_architectures
|
554
|
+
or "Contriever" in model_architectures
|
555
|
+
or "BertForSequenceClassification" in model_architectures
|
556
|
+
or "XLMRobertaModel" in model_architectures
|
557
|
+
or "XLMRobertaForSequenceClassification" in model_architectures
|
528
558
|
):
|
529
559
|
return False
|
530
560
|
else:
|
@@ -552,6 +582,8 @@ multimodal_model_archs = [
|
|
552
582
|
"Qwen2_5_VLForConditionalGeneration",
|
553
583
|
"KimiVLForConditionalGeneration",
|
554
584
|
"InternVLChatModel",
|
585
|
+
"Phi4MMForCausalLM",
|
586
|
+
"VILAForConditionalGeneration",
|
555
587
|
]
|
556
588
|
|
557
589
|
|
@@ -60,7 +60,7 @@ class BaseGrammarObject:
|
|
60
60
|
raise NotImplementedError()
|
61
61
|
|
62
62
|
def copy(self) -> "BaseGrammarObject":
|
63
|
-
|
63
|
+
return self
|
64
64
|
|
65
65
|
@property
|
66
66
|
def finished(self):
|
@@ -99,9 +99,12 @@ class BaseGrammarObject:
|
|
99
99
|
raise NotImplementedError()
|
100
100
|
|
101
101
|
|
102
|
+
INVALID_GRAMMAR_OBJ = BaseGrammarObject()
|
103
|
+
|
104
|
+
|
102
105
|
@dataclass
|
103
106
|
class CacheEntry:
|
104
|
-
value:
|
107
|
+
value: BaseGrammarObject
|
105
108
|
event: Event
|
106
109
|
|
107
110
|
|
@@ -28,6 +28,7 @@ from llguidance.torch import (
|
|
28
28
|
)
|
29
29
|
|
30
30
|
from sglang.srt.constrained.base_grammar_backend import (
|
31
|
+
INVALID_GRAMMAR_OBJ,
|
31
32
|
BaseGrammarBackend,
|
32
33
|
BaseGrammarObject,
|
33
34
|
)
|
@@ -126,8 +127,8 @@ class GuidanceBackend(BaseGrammarBackend):
|
|
126
127
|
serialized_grammar=serialized_grammar,
|
127
128
|
)
|
128
129
|
except Exception as e:
|
129
|
-
logger.
|
130
|
-
return
|
130
|
+
logger.error(f"Hit invalid grammar: {serialized_grammar=}, {e=}")
|
131
|
+
return INVALID_GRAMMAR_OBJ
|
131
132
|
|
132
133
|
def dispatch_json(self, key_string: str) -> Optional[GuidanceGrammar]:
|
133
134
|
try:
|
@@ -138,8 +139,8 @@ class GuidanceBackend(BaseGrammarBackend):
|
|
138
139
|
},
|
139
140
|
)
|
140
141
|
except Exception as e:
|
141
|
-
logger.
|
142
|
-
return
|
142
|
+
logger.error(f"Hit invalid json_schema: {key_string=}, {e=}")
|
143
|
+
return INVALID_GRAMMAR_OBJ
|
143
144
|
return self._from_serialized(serialized_grammar)
|
144
145
|
|
145
146
|
def dispatch_regex(self, key_string: str) -> Optional[GuidanceGrammar]:
|
@@ -151,8 +152,8 @@ class GuidanceBackend(BaseGrammarBackend):
|
|
151
152
|
serialized_grammar = grammar_from("ebnf", key_string)
|
152
153
|
return self._from_serialized(serialized_grammar)
|
153
154
|
except ValueError as e:
|
154
|
-
logger.
|
155
|
-
return
|
155
|
+
logger.error(f"Hit invalid ebnf: {key_string=}, {e=}")
|
156
|
+
return INVALID_GRAMMAR_OBJ
|
156
157
|
|
157
158
|
def dispatch_structural_tag(self, key_string: str) -> Optional[GuidanceGrammar]:
|
158
159
|
try:
|
@@ -169,5 +170,5 @@ class GuidanceBackend(BaseGrammarBackend):
|
|
169
170
|
g = StructTag.to_grammar(tags)
|
170
171
|
return self._from_serialized(g)
|
171
172
|
except Exception as e:
|
172
|
-
logging.
|
173
|
-
return
|
173
|
+
logging.error(f"Hit invalid structural_tag: {key_string=}, {e=}")
|
174
|
+
return INVALID_GRAMMAR_OBJ
|
@@ -24,6 +24,7 @@ from outlines.models.transformers import TransformerTokenizer
|
|
24
24
|
from pydantic import BaseModel
|
25
25
|
|
26
26
|
from sglang.srt.constrained.base_grammar_backend import (
|
27
|
+
INVALID_GRAMMAR_OBJ,
|
27
28
|
BaseGrammarBackend,
|
28
29
|
BaseGrammarObject,
|
29
30
|
)
|
@@ -151,8 +152,8 @@ class OutlinesGrammarBackend(BaseGrammarBackend):
|
|
151
152
|
# outlines <= 0.0.46
|
152
153
|
guide = RegexGuide(regex, self.outlines_tokenizer)
|
153
154
|
except interegular.patterns.InvalidSyntax as e:
|
154
|
-
logger.
|
155
|
-
return
|
155
|
+
logger.error(f"Hit invalid regex schema: {regex=}, {e=}")
|
156
|
+
return INVALID_GRAMMAR_OBJ
|
156
157
|
|
157
158
|
jump_forward_map = None
|
158
159
|
return OutlinesGrammar(guide, jump_forward_map)
|
@@ -170,8 +171,8 @@ class OutlinesGrammarBackend(BaseGrammarBackend):
|
|
170
171
|
whitespace_pattern=self.whitespace_pattern,
|
171
172
|
)
|
172
173
|
except (NotImplementedError, json.decoder.JSONDecodeError, ValueError) as e:
|
173
|
-
logger.
|
174
|
-
return
|
174
|
+
logger.error(f"Hit invalid json_schema: {key_string=}, {e=}")
|
175
|
+
return INVALID_GRAMMAR_OBJ
|
175
176
|
return self._compile_regex(regex)
|
176
177
|
|
177
178
|
def dispatch_regex(self, key_string: str):
|
@@ -28,6 +28,7 @@ from xgrammar import (
|
|
28
28
|
)
|
29
29
|
|
30
30
|
from sglang.srt.constrained.base_grammar_backend import (
|
31
|
+
INVALID_GRAMMAR_OBJ,
|
31
32
|
BaseGrammarBackend,
|
32
33
|
BaseGrammarObject,
|
33
34
|
)
|
@@ -152,10 +153,11 @@ class XGrammarGrammarBackend(BaseGrammarBackend):
|
|
152
153
|
):
|
153
154
|
super().__init__()
|
154
155
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
156
|
+
if True:
|
157
|
+
tokenizer_info = TokenizerInfo.from_huggingface(
|
158
|
+
tokenizer, vocab_size=vocab_size
|
159
|
+
)
|
160
|
+
override_stop_tokens = None
|
159
161
|
|
160
162
|
self.grammar_compiler = GrammarCompiler(tokenizer_info=tokenizer_info)
|
161
163
|
self.vocab_size = vocab_size
|
@@ -178,25 +180,26 @@ class XGrammarGrammarBackend(BaseGrammarBackend):
|
|
178
180
|
ctx = self.grammar_compiler.compile_builtin_json_grammar()
|
179
181
|
else:
|
180
182
|
ctx = self.grammar_compiler.compile_json_schema(schema=key_string)
|
181
|
-
|
182
|
-
|
183
|
-
|
183
|
+
|
184
|
+
except (RuntimeError, json.decoder.JSONDecodeError) as e:
|
185
|
+
logging.error(f"Hit invalid json_schema: {key_string=}, {e=}")
|
186
|
+
return INVALID_GRAMMAR_OBJ
|
184
187
|
return self._from_context(ctx, key_string)
|
185
188
|
|
186
189
|
def dispatch_ebnf(self, key_string: str) -> Optional[XGrammarGrammar]:
|
187
190
|
try:
|
188
191
|
ctx = self.grammar_compiler.compile_grammar(key_string)
|
189
192
|
except RuntimeError as e:
|
190
|
-
logging.
|
191
|
-
return
|
193
|
+
logging.error(f"Hit invalid ebnf: {key_string=}, {e=}")
|
194
|
+
return INVALID_GRAMMAR_OBJ
|
192
195
|
return self._from_context(ctx, key_string)
|
193
196
|
|
194
197
|
def dispatch_regex(self, key_string: str) -> Optional[XGrammarGrammar]:
|
195
198
|
try:
|
196
199
|
ctx = self.grammar_compiler.compile_regex(key_string)
|
197
200
|
except RuntimeError as e:
|
198
|
-
logging.
|
199
|
-
return
|
201
|
+
logging.error(f"Hit invalid regex: {key_string=}, {e=}")
|
202
|
+
return INVALID_GRAMMAR_OBJ
|
200
203
|
return self._from_context(ctx, key_string)
|
201
204
|
|
202
205
|
def dispatch_structural_tag(self, key_string: str) -> Optional[XGrammarGrammar]:
|
@@ -213,13 +216,10 @@ class XGrammarGrammarBackend(BaseGrammarBackend):
|
|
213
216
|
ctx = self.grammar_compiler.compile_structural_tag(
|
214
217
|
tags, structural_tag["triggers"]
|
215
218
|
)
|
216
|
-
except RuntimeError as e:
|
217
|
-
logging.
|
218
|
-
|
219
|
-
)
|
220
|
-
return None
|
219
|
+
except (RuntimeError, json.decoder.JSONDecodeError) as e:
|
220
|
+
logging.error(f"Hit invalid structural_tag: {key_string=}, {e=}")
|
221
|
+
return INVALID_GRAMMAR_OBJ
|
221
222
|
return self._from_context(ctx, key_string)
|
222
223
|
|
223
224
|
def reset(self):
|
224
|
-
|
225
|
-
self.grammar_compiler.clear_cache()
|
225
|
+
self.grammar_compiler.clear_cache()
|