sglang 0.3.4.post2__tar.gz → 0.3.5__tar.gz
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-0.3.5/PKG-INFO +344 -0
- sglang-0.3.5/README.md +59 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/pyproject.toml +8 -3
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/api.py +1 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/bench_latency.py +3 -3
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/bench_server_latency.py +2 -3
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/bench_serving.py +92 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/global_config.py +9 -3
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/chat_template.py +50 -25
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/interpreter.py +9 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/ir.py +11 -2
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/launch_server.py +1 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/configs/model_config.py +51 -13
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/constrained/__init__.py +18 -0
- sglang-0.3.5/sglang/srt/constrained/bnf_cache.py +61 -0
- sglang-0.3.5/sglang/srt/constrained/grammar.py +190 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/hf_transformers_utils.py +6 -5
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/triton_ops/decode_attention.py +110 -30
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/triton_ops/prefill_attention.py +1 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/fused_moe/fused_moe.py +4 -3
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/fused_moe/layer.py +28 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/quantization/base_config.py +16 -1
- sglang-0.3.5/sglang/srt/layers/vocab_parallel_embedding.py +486 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/data_parallel_controller.py +7 -6
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/detokenizer_manager.py +9 -11
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/image_processor.py +4 -3
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/io_struct.py +70 -78
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/schedule_batch.py +33 -49
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/schedule_policy.py +24 -13
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/scheduler.py +137 -80
- sglang-0.3.5/sglang/srt/managers/tokenizer_manager.py +582 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/tp_worker.py +5 -5
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/mem_cache/flush_cache.py +1 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/model_executor/cuda_graph_runner.py +7 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/model_executor/model_runner.py +8 -17
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/baichuan.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/chatglm.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/commandr.py +1 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/dbrx.py +5 -5
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/deepseek.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/deepseek_v2.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/exaone.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/gemma.py +1 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/gemma2.py +1 -1
- sglang-0.3.5/sglang/srt/models/gpt2.py +287 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/gpt_bigcode.py +1 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/grok.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/internlm2.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/llama.py +15 -7
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/llama_embedding.py +2 -10
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/llama_reward.py +5 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/minicpm.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/minicpm3.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/mixtral.py +7 -5
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/mixtral_quant.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/mllama.py +5 -5
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/olmo.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/olmoe.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/qwen.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/qwen2.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/qwen2_moe.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/qwen2_vl.py +4 -8
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/stablelm.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/torch_native_llama.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/xverse.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/xverse_moe.py +4 -4
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/openai_api/adapter.py +52 -66
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/sampling_batch_info.py +7 -13
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/server.py +31 -35
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/server_args.py +34 -5
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/utils.py +40 -56
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/runners.py +2 -1
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/test_utils.py +73 -25
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/utils.py +62 -1
- sglang-0.3.5/sglang/version.py +1 -0
- sglang-0.3.5/sglang.egg-info/PKG-INFO +344 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang.egg-info/SOURCES.txt +4 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang.egg-info/requires.txt +16 -0
- sglang-0.3.4.post2/PKG-INFO +0 -899
- sglang-0.3.4.post2/README.md +0 -627
- sglang-0.3.4.post2/sglang/srt/managers/tokenizer_manager.py +0 -694
- sglang-0.3.4.post2/sglang/version.py +0 -1
- sglang-0.3.4.post2/sglang.egg-info/PKG-INFO +0 -899
- {sglang-0.3.4.post2 → sglang-0.3.5}/LICENSE +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/setup.cfg +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/check_env.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/backend/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/backend/anthropic.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/backend/base_backend.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/backend/litellm.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/backend/openai.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/backend/runtime_endpoint.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/backend/vertexai.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/choices.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/compiler.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/lang/tracer.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/launch_server_llavavid.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/configs/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/configs/exaone.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/configs/qwen2vl.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/constrained/base_tool_cache.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/constrained/fsm_cache.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/constrained/jump_forward.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/conversation.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/activation.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/double_sparsity_backend.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/flashinfer_backend.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/triton_backend.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/triton_ops/double_sparsity_attention.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/attention/triton_ops/extend_attention.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/fused_moe/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/fused_moe/patch.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/layernorm.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/linear.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/logits_processor.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/pooler.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/quantization/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/radix_attention.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/rotary_embedding.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/sampler.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/layers/torchao_utils.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/lora/lora.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/lora/lora_config.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/lora/lora_manager.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/managers/tp_worker_overlap_thread.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/mem_cache/base_prefix_cache.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/mem_cache/chunk_cache.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/mem_cache/memory_pool.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/mem_cache/radix_cache.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/mm_utils.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/model_executor/forward_batch_info.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/llama_classification.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/llava.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/llavavid.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/mistral.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/models/yivl.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/openai_api/protocol.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/penaltylib/__init__.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/penaltylib/orchestrator.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/penaltylib/penalizers/frequency_penalty.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/penaltylib/penalizers/min_new_tokens.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/penaltylib/penalizers/presence_penalty.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/penaltylib/penalizers/repetition_penalty.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/srt/sampling/sampling_params.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/few_shot_gsm8k.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/few_shot_gsm8k_engine.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/run_eval.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/simple_eval_common.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/simple_eval_gpqa.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/simple_eval_humaneval.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/simple_eval_math.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/simple_eval_mgsm.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/simple_eval_mmlu.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/srt/sampling/penaltylib/utils.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/test_activation.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/test_layernorm.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang/test/test_programs.py +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang.egg-info/dependency_links.txt +0 -0
- {sglang-0.3.4.post2 → sglang-0.3.5}/sglang.egg-info/top_level.txt +0 -0
sglang-0.3.5/PKG-INFO
ADDED
@@ -0,0 +1,344 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: sglang
|
3
|
+
Version: 0.3.5
|
4
|
+
Summary: SGLang is yet another fast serving framework for large language models and vision language models.
|
5
|
+
License: Apache License
|
6
|
+
Version 2.0, January 2004
|
7
|
+
http://www.apache.org/licenses/
|
8
|
+
|
9
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
10
|
+
|
11
|
+
1. Definitions.
|
12
|
+
|
13
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
14
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
15
|
+
|
16
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
17
|
+
the copyright owner that is granting the License.
|
18
|
+
|
19
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
20
|
+
other entities that control, are controlled by, or are under common
|
21
|
+
control with that entity. For the purposes of this definition,
|
22
|
+
"control" means (i) the power, direct or indirect, to cause the
|
23
|
+
direction or management of such entity, whether by contract or
|
24
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
25
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
26
|
+
|
27
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
28
|
+
exercising permissions granted by this License.
|
29
|
+
|
30
|
+
"Source" form shall mean the preferred form for making modifications,
|
31
|
+
including but not limited to software source code, documentation
|
32
|
+
source, and configuration files.
|
33
|
+
|
34
|
+
"Object" form shall mean any form resulting from mechanical
|
35
|
+
transformation or translation of a Source form, including but
|
36
|
+
not limited to compiled object code, generated documentation,
|
37
|
+
and conversions to other media types.
|
38
|
+
|
39
|
+
"Work" shall mean the work of authorship, whether in Source or
|
40
|
+
Object form, made available under the License, as indicated by a
|
41
|
+
copyright notice that is included in or attached to the work
|
42
|
+
(an example is provided in the Appendix below).
|
43
|
+
|
44
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
45
|
+
form, that is based on (or derived from) the Work and for which the
|
46
|
+
editorial revisions, annotations, elaborations, or other modifications
|
47
|
+
represent, as a whole, an original work of authorship. For the purposes
|
48
|
+
of this License, Derivative Works shall not include works that remain
|
49
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
50
|
+
the Work and Derivative Works thereof.
|
51
|
+
|
52
|
+
"Contribution" shall mean any work of authorship, including
|
53
|
+
the original version of the Work and any modifications or additions
|
54
|
+
to that Work or Derivative Works thereof, that is intentionally
|
55
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
56
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
57
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
58
|
+
means any form of electronic, verbal, or written communication sent
|
59
|
+
to the Licensor or its representatives, including but not limited to
|
60
|
+
communication on electronic mailing lists, source code control systems,
|
61
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
62
|
+
Licensor for the purpose of discussing and improving the Work, but
|
63
|
+
excluding communication that is conspicuously marked or otherwise
|
64
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
65
|
+
|
66
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
67
|
+
on behalf of whom a Contribution has been received by Licensor and
|
68
|
+
subsequently incorporated within the Work.
|
69
|
+
|
70
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
73
|
+
copyright license to reproduce, prepare Derivative Works of,
|
74
|
+
publicly display, publicly perform, sublicense, and distribute the
|
75
|
+
Work and such Derivative Works in Source or Object form.
|
76
|
+
|
77
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
78
|
+
this License, each Contributor hereby grants to You a perpetual,
|
79
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
80
|
+
(except as stated in this section) patent license to make, have made,
|
81
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
82
|
+
where such license applies only to those patent claims licensable
|
83
|
+
by such Contributor that are necessarily infringed by their
|
84
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
85
|
+
with the Work to which such Contribution(s) was submitted. If You
|
86
|
+
institute patent litigation against any entity (including a
|
87
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
88
|
+
or a Contribution incorporated within the Work constitutes direct
|
89
|
+
or contributory patent infringement, then any patent licenses
|
90
|
+
granted to You under this License for that Work shall terminate
|
91
|
+
as of the date such litigation is filed.
|
92
|
+
|
93
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
94
|
+
Work or Derivative Works thereof in any medium, with or without
|
95
|
+
modifications, and in Source or Object form, provided that You
|
96
|
+
meet the following conditions:
|
97
|
+
|
98
|
+
(a) You must give any other recipients of the Work or
|
99
|
+
Derivative Works a copy of this License; and
|
100
|
+
|
101
|
+
(b) You must cause any modified files to carry prominent notices
|
102
|
+
stating that You changed the files; and
|
103
|
+
|
104
|
+
(c) You must retain, in the Source form of any Derivative Works
|
105
|
+
that You distribute, all copyright, patent, trademark, and
|
106
|
+
attribution notices from the Source form of the Work,
|
107
|
+
excluding those notices that do not pertain to any part of
|
108
|
+
the Derivative Works; and
|
109
|
+
|
110
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
111
|
+
distribution, then any Derivative Works that You distribute must
|
112
|
+
include a readable copy of the attribution notices contained
|
113
|
+
within such NOTICE file, excluding those notices that do not
|
114
|
+
pertain to any part of the Derivative Works, in at least one
|
115
|
+
of the following places: within a NOTICE text file distributed
|
116
|
+
as part of the Derivative Works; within the Source form or
|
117
|
+
documentation, if provided along with the Derivative Works; or,
|
118
|
+
within a display generated by the Derivative Works, if and
|
119
|
+
wherever such third-party notices normally appear. The contents
|
120
|
+
of the NOTICE file are for informational purposes only and
|
121
|
+
do not modify the License. You may add Your own attribution
|
122
|
+
notices within Derivative Works that You distribute, alongside
|
123
|
+
or as an addendum to the NOTICE text from the Work, provided
|
124
|
+
that such additional attribution notices cannot be construed
|
125
|
+
as modifying the License.
|
126
|
+
|
127
|
+
You may add Your own copyright statement to Your modifications and
|
128
|
+
may provide additional or different license terms and conditions
|
129
|
+
for use, reproduction, or distribution of Your modifications, or
|
130
|
+
for any such Derivative Works as a whole, provided Your use,
|
131
|
+
reproduction, and distribution of the Work otherwise complies with
|
132
|
+
the conditions stated in this License.
|
133
|
+
|
134
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
135
|
+
any Contribution intentionally submitted for inclusion in the Work
|
136
|
+
by You to the Licensor shall be under the terms and conditions of
|
137
|
+
this License, without any additional terms or conditions.
|
138
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
139
|
+
the terms of any separate license agreement you may have executed
|
140
|
+
with Licensor regarding such Contributions.
|
141
|
+
|
142
|
+
6. Trademarks. This License does not grant permission to use the trade
|
143
|
+
names, trademarks, service marks, or product names of the Licensor,
|
144
|
+
except as required for reasonable and customary use in describing the
|
145
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
146
|
+
|
147
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
148
|
+
agreed to in writing, Licensor provides the Work (and each
|
149
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
150
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
151
|
+
implied, including, without limitation, any warranties or conditions
|
152
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
153
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
154
|
+
appropriateness of using or redistributing the Work and assume any
|
155
|
+
risks associated with Your exercise of permissions under this License.
|
156
|
+
|
157
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
158
|
+
whether in tort (including negligence), contract, or otherwise,
|
159
|
+
unless required by applicable law (such as deliberate and grossly
|
160
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
161
|
+
liable to You for damages, including any direct, indirect, special,
|
162
|
+
incidental, or consequential damages of any character arising as a
|
163
|
+
result of this License or out of the use or inability to use the
|
164
|
+
Work (including but not limited to damages for loss of goodwill,
|
165
|
+
work stoppage, computer failure or malfunction, or any and all
|
166
|
+
other commercial damages or losses), even if such Contributor
|
167
|
+
has been advised of the possibility of such damages.
|
168
|
+
|
169
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
170
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
171
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
172
|
+
or other liability obligations and/or rights consistent with this
|
173
|
+
License. However, in accepting such obligations, You may act only
|
174
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
175
|
+
of any other Contributor, and only if You agree to indemnify,
|
176
|
+
defend, and hold each Contributor harmless for any liability
|
177
|
+
incurred by, or claims asserted against, such Contributor by reason
|
178
|
+
of your accepting any such warranty or additional liability.
|
179
|
+
|
180
|
+
END OF TERMS AND CONDITIONS
|
181
|
+
|
182
|
+
APPENDIX: How to apply the Apache License to your work.
|
183
|
+
|
184
|
+
To apply the Apache License to your work, attach the following
|
185
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
186
|
+
replaced with your own identifying information. (Don't include
|
187
|
+
the brackets!) The text should be enclosed in the appropriate
|
188
|
+
comment syntax for the file format. We also recommend that a
|
189
|
+
file or class name and description of purpose be included on the
|
190
|
+
same "printed page" as the copyright notice for easier
|
191
|
+
identification within third-party archives.
|
192
|
+
|
193
|
+
Copyright [yyyy] [name of copyright owner]
|
194
|
+
|
195
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
196
|
+
you may not use this file except in compliance with the License.
|
197
|
+
You may obtain a copy of the License at
|
198
|
+
|
199
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
200
|
+
|
201
|
+
Unless required by applicable law or agreed to in writing, software
|
202
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
203
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
204
|
+
See the License for the specific language governing permissions and
|
205
|
+
limitations under the License.
|
206
|
+
|
207
|
+
Project-URL: Homepage, https://github.com/sgl-project/sglang
|
208
|
+
Project-URL: Bug Tracker, https://github.com/sgl-project/sglang/issues
|
209
|
+
Classifier: Programming Language :: Python :: 3
|
210
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
211
|
+
Requires-Python: >=3.8
|
212
|
+
Description-Content-Type: text/markdown
|
213
|
+
License-File: LICENSE
|
214
|
+
Requires-Dist: requests
|
215
|
+
Requires-Dist: tqdm
|
216
|
+
Requires-Dist: numpy
|
217
|
+
Requires-Dist: IPython
|
218
|
+
Provides-Extra: runtime-common
|
219
|
+
Requires-Dist: aiohttp; extra == "runtime-common"
|
220
|
+
Requires-Dist: decord; extra == "runtime-common"
|
221
|
+
Requires-Dist: fastapi; extra == "runtime-common"
|
222
|
+
Requires-Dist: hf_transfer; extra == "runtime-common"
|
223
|
+
Requires-Dist: huggingface_hub; extra == "runtime-common"
|
224
|
+
Requires-Dist: interegular; extra == "runtime-common"
|
225
|
+
Requires-Dist: orjson; extra == "runtime-common"
|
226
|
+
Requires-Dist: packaging; extra == "runtime-common"
|
227
|
+
Requires-Dist: pillow; extra == "runtime-common"
|
228
|
+
Requires-Dist: psutil; extra == "runtime-common"
|
229
|
+
Requires-Dist: pydantic; extra == "runtime-common"
|
230
|
+
Requires-Dist: python-multipart; extra == "runtime-common"
|
231
|
+
Requires-Dist: torchao; extra == "runtime-common"
|
232
|
+
Requires-Dist: uvicorn; extra == "runtime-common"
|
233
|
+
Requires-Dist: uvloop; extra == "runtime-common"
|
234
|
+
Requires-Dist: zmq; extra == "runtime-common"
|
235
|
+
Requires-Dist: outlines>=0.0.44; extra == "runtime-common"
|
236
|
+
Requires-Dist: modelscope; extra == "runtime-common"
|
237
|
+
Provides-Extra: srt
|
238
|
+
Requires-Dist: sglang[runtime_common]; extra == "srt"
|
239
|
+
Requires-Dist: torch; extra == "srt"
|
240
|
+
Requires-Dist: vllm==0.6.3.post1; extra == "srt"
|
241
|
+
Provides-Extra: srt-hip
|
242
|
+
Requires-Dist: sglang[runtime_common]; extra == "srt-hip"
|
243
|
+
Requires-Dist: torch; extra == "srt-hip"
|
244
|
+
Requires-Dist: vllm==0.6.3.dev13; extra == "srt-hip"
|
245
|
+
Provides-Extra: srt-xpu
|
246
|
+
Requires-Dist: sglang[runtime_common]; extra == "srt-xpu"
|
247
|
+
Provides-Extra: openai
|
248
|
+
Requires-Dist: openai>=1.0; extra == "openai"
|
249
|
+
Requires-Dist: tiktoken; extra == "openai"
|
250
|
+
Provides-Extra: anthropic
|
251
|
+
Requires-Dist: anthropic>=0.20.0; extra == "anthropic"
|
252
|
+
Provides-Extra: litellm
|
253
|
+
Requires-Dist: litellm>=1.0.0; extra == "litellm"
|
254
|
+
Provides-Extra: test
|
255
|
+
Requires-Dist: jsonlines; extra == "test"
|
256
|
+
Requires-Dist: matplotlib; extra == "test"
|
257
|
+
Requires-Dist: pandas; extra == "test"
|
258
|
+
Requires-Dist: sentence_transformers; extra == "test"
|
259
|
+
Requires-Dist: accelerate; extra == "test"
|
260
|
+
Requires-Dist: peft; extra == "test"
|
261
|
+
Provides-Extra: all
|
262
|
+
Requires-Dist: sglang[srt]; extra == "all"
|
263
|
+
Requires-Dist: sglang[openai]; extra == "all"
|
264
|
+
Requires-Dist: sglang[anthropic]; extra == "all"
|
265
|
+
Requires-Dist: sglang[litellm]; extra == "all"
|
266
|
+
Provides-Extra: all-hip
|
267
|
+
Requires-Dist: sglang[srt_hip]; extra == "all-hip"
|
268
|
+
Requires-Dist: sglang[openai]; extra == "all-hip"
|
269
|
+
Requires-Dist: sglang[anthropic]; extra == "all-hip"
|
270
|
+
Requires-Dist: sglang[litellm]; extra == "all-hip"
|
271
|
+
Provides-Extra: all-xpu
|
272
|
+
Requires-Dist: sglang[srt_xpu]; extra == "all-xpu"
|
273
|
+
Requires-Dist: sglang[openai]; extra == "all-xpu"
|
274
|
+
Requires-Dist: sglang[anthropic]; extra == "all-xpu"
|
275
|
+
Requires-Dist: sglang[litellm]; extra == "all-xpu"
|
276
|
+
Provides-Extra: dev
|
277
|
+
Requires-Dist: sglang[all]; extra == "dev"
|
278
|
+
Requires-Dist: sglang[test]; extra == "dev"
|
279
|
+
Provides-Extra: dev-hip
|
280
|
+
Requires-Dist: sglang[all_hip]; extra == "dev-hip"
|
281
|
+
Requires-Dist: sglang[test]; extra == "dev-hip"
|
282
|
+
Provides-Extra: dev-xpu
|
283
|
+
Requires-Dist: sglang[all_xpu]; extra == "dev-xpu"
|
284
|
+
Requires-Dist: sglang[test]; extra == "dev-xpu"
|
285
|
+
|
286
|
+
<div align="center" id="sglangtop">
|
287
|
+
<img src="https://raw.githubusercontent.com/sgl-project/sglang/main/assets/logo.png" alt="logo" width="400" margin="10px"></img>
|
288
|
+
|
289
|
+
[](https://pypi.org/project/sglang)
|
290
|
+

|
291
|
+
[](https://github.com/sgl-project/sglang/tree/main/LICENSE)
|
292
|
+
[](https://github.com/sgl-project/sglang/issues)
|
293
|
+
[](https://github.com/sgl-project/sglang/issues)
|
294
|
+
|
295
|
+
</div>
|
296
|
+
|
297
|
+
--------------------------------------------------------------------------------
|
298
|
+
|
299
|
+
| [**Blog**](https://lmsys.org/blog/2024-07-25-sglang-llama3/) | [**Documentation**](https://sgl-project.github.io/) | [**Join Slack**](https://join.slack.com/t/sgl-fru7574/shared_invite/zt-2ngly9muu-t37XiH87qvD~6rVBTkTEHw) |
|
300
|
+
[**Join Bi-Weekly Development Meeting**](https://docs.google.com/document/d/1xEow4eIM152xNcRxqZz9VEcOiTQo8-CEuuQ5qTmkt-E/edit?usp=sharing) |
|
301
|
+
|
302
|
+
## News
|
303
|
+
- [2024/10] 🔥 The First SGLang Online Meetup ([slides](https://github.com/sgl-project/sgl-learning-materials?tab=readme-ov-file#the-first-sglang-online-meetup)).
|
304
|
+
- [2024/09] SGLang v0.3 Release: 7x Faster DeepSeek MLA, 1.5x Faster torch.compile, Multi-Image/Video LLaVA-OneVision ([blog](https://lmsys.org/blog/2024-09-04-sglang-v0-3/)).
|
305
|
+
- [2024/07] Faster Llama3 Serving with SGLang Runtime (vs. TensorRT-LLM, vLLM) ([blog](https://lmsys.org/blog/2024-07-25-sglang-llama3/)).
|
306
|
+
|
307
|
+
<details>
|
308
|
+
<summary>More</summary>
|
309
|
+
|
310
|
+
- [2024/02] SGLang enables **3x faster JSON decoding** with compressed finite state machine ([blog](https://lmsys.org/blog/2024-02-05-compressed-fsm/)).
|
311
|
+
- [2024/04] SGLang is used by the official **LLaVA-NeXT (video)** release ([blog](https://llava-vl.github.io/blog/2024-04-30-llava-next-video/)).
|
312
|
+
- [2024/01] SGLang provides up to **5x faster inference** with RadixAttention ([blog](https://lmsys.org/blog/2024-01-17-sglang/)).
|
313
|
+
- [2024/01] SGLang powers the serving of the official **LLaVA v1.6** release demo ([usage](https://github.com/haotian-liu/LLaVA?tab=readme-ov-file#demo)).
|
314
|
+
|
315
|
+
</details>
|
316
|
+
|
317
|
+
## About
|
318
|
+
SGLang is a fast serving framework for large language models and vision language models.
|
319
|
+
It makes your interaction with models faster and more controllable by co-designing the backend runtime and frontend language.
|
320
|
+
The core features include:
|
321
|
+
|
322
|
+
- **Fast Backend Runtime**: Provides efficient serving with RadixAttention for prefix caching, jump-forward constrained decoding, continuous batching, token attention (paged attention), tensor parallelism, FlashInfer kernels, chunked prefill, and quantization (INT4/FP8/AWQ/GPTQ).
|
323
|
+
- **Flexible Frontend Language**: Offers an intuitive interface for programming LLM applications, including chained generation calls, advanced prompting, control flow, multi-modal inputs, parallelism, and external interactions.
|
324
|
+
- **Extensive Model Support**: Supports a wide range of generative models (Llama, Gemma, Mistral, QWen, DeepSeek, LLaVA, etc.) and embedding models (e5-mistral), with easy extensibility for integrating new models.
|
325
|
+
- **Active Community**: SGLang is open-source and backed by an active community with industry adoption.
|
326
|
+
|
327
|
+
## Install
|
328
|
+
See [https://sgl-project.github.io/start/install.html](https://sgl-project.github.io/start/install.html)
|
329
|
+
|
330
|
+
## Backend: SGLang Runtime (SRT)
|
331
|
+
See [https://sgl-project.github.io/backend/backend.html](https://sgl-project.github.io/backend/backend.html)
|
332
|
+
|
333
|
+
## Frontend: Structured Generation Language (SGLang)
|
334
|
+
See [https://sgl-project.github.io/frontend/frontend.html](https://sgl-project.github.io/frontend/frontend.html)
|
335
|
+
|
336
|
+
## Benchmark And Performance
|
337
|
+
Learn more in our release blogs: [v0.2 blog](https://lmsys.org/blog/2024-07-25-sglang-llama3/), [v0.3 blog](https://lmsys.org/blog/2024-09-04-sglang-v0-3/)
|
338
|
+
|
339
|
+
## Roadmap
|
340
|
+
[Development Roadmap (2024 Q4)](https://github.com/sgl-project/sglang/issues/1487)
|
341
|
+
|
342
|
+
## Citation And Acknowledgment
|
343
|
+
Please cite our paper, [SGLang: Efficient Execution of Structured Language Model Programs](https://arxiv.org/abs/2312.07104), if you find the project useful.
|
344
|
+
We also learned from the design and reused code from the following projects: [Guidance](https://github.com/guidance-ai/guidance), [vLLM](https://github.com/vllm-project/vllm), [LightLLM](https://github.com/ModelTC/lightllm), [FlashInfer](https://github.com/flashinfer-ai/flashinfer), [Outlines](https://github.com/outlines-dev/outlines), and [LMQL](https://github.com/eth-sri/lmql).
|
sglang-0.3.5/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
<div align="center" id="sglangtop">
|
2
|
+
<img src="https://raw.githubusercontent.com/sgl-project/sglang/main/assets/logo.png" alt="logo" width="400" margin="10px"></img>
|
3
|
+
|
4
|
+
[](https://pypi.org/project/sglang)
|
5
|
+

|
6
|
+
[](https://github.com/sgl-project/sglang/tree/main/LICENSE)
|
7
|
+
[](https://github.com/sgl-project/sglang/issues)
|
8
|
+
[](https://github.com/sgl-project/sglang/issues)
|
9
|
+
|
10
|
+
</div>
|
11
|
+
|
12
|
+
--------------------------------------------------------------------------------
|
13
|
+
|
14
|
+
| [**Blog**](https://lmsys.org/blog/2024-07-25-sglang-llama3/) | [**Documentation**](https://sgl-project.github.io/) | [**Join Slack**](https://join.slack.com/t/sgl-fru7574/shared_invite/zt-2ngly9muu-t37XiH87qvD~6rVBTkTEHw) |
|
15
|
+
[**Join Bi-Weekly Development Meeting**](https://docs.google.com/document/d/1xEow4eIM152xNcRxqZz9VEcOiTQo8-CEuuQ5qTmkt-E/edit?usp=sharing) |
|
16
|
+
|
17
|
+
## News
|
18
|
+
- [2024/10] 🔥 The First SGLang Online Meetup ([slides](https://github.com/sgl-project/sgl-learning-materials?tab=readme-ov-file#the-first-sglang-online-meetup)).
|
19
|
+
- [2024/09] SGLang v0.3 Release: 7x Faster DeepSeek MLA, 1.5x Faster torch.compile, Multi-Image/Video LLaVA-OneVision ([blog](https://lmsys.org/blog/2024-09-04-sglang-v0-3/)).
|
20
|
+
- [2024/07] Faster Llama3 Serving with SGLang Runtime (vs. TensorRT-LLM, vLLM) ([blog](https://lmsys.org/blog/2024-07-25-sglang-llama3/)).
|
21
|
+
|
22
|
+
<details>
|
23
|
+
<summary>More</summary>
|
24
|
+
|
25
|
+
- [2024/02] SGLang enables **3x faster JSON decoding** with compressed finite state machine ([blog](https://lmsys.org/blog/2024-02-05-compressed-fsm/)).
|
26
|
+
- [2024/04] SGLang is used by the official **LLaVA-NeXT (video)** release ([blog](https://llava-vl.github.io/blog/2024-04-30-llava-next-video/)).
|
27
|
+
- [2024/01] SGLang provides up to **5x faster inference** with RadixAttention ([blog](https://lmsys.org/blog/2024-01-17-sglang/)).
|
28
|
+
- [2024/01] SGLang powers the serving of the official **LLaVA v1.6** release demo ([usage](https://github.com/haotian-liu/LLaVA?tab=readme-ov-file#demo)).
|
29
|
+
|
30
|
+
</details>
|
31
|
+
|
32
|
+
## About
|
33
|
+
SGLang is a fast serving framework for large language models and vision language models.
|
34
|
+
It makes your interaction with models faster and more controllable by co-designing the backend runtime and frontend language.
|
35
|
+
The core features include:
|
36
|
+
|
37
|
+
- **Fast Backend Runtime**: Provides efficient serving with RadixAttention for prefix caching, jump-forward constrained decoding, continuous batching, token attention (paged attention), tensor parallelism, FlashInfer kernels, chunked prefill, and quantization (INT4/FP8/AWQ/GPTQ).
|
38
|
+
- **Flexible Frontend Language**: Offers an intuitive interface for programming LLM applications, including chained generation calls, advanced prompting, control flow, multi-modal inputs, parallelism, and external interactions.
|
39
|
+
- **Extensive Model Support**: Supports a wide range of generative models (Llama, Gemma, Mistral, QWen, DeepSeek, LLaVA, etc.) and embedding models (e5-mistral), with easy extensibility for integrating new models.
|
40
|
+
- **Active Community**: SGLang is open-source and backed by an active community with industry adoption.
|
41
|
+
|
42
|
+
## Install
|
43
|
+
See [https://sgl-project.github.io/start/install.html](https://sgl-project.github.io/start/install.html)
|
44
|
+
|
45
|
+
## Backend: SGLang Runtime (SRT)
|
46
|
+
See [https://sgl-project.github.io/backend/backend.html](https://sgl-project.github.io/backend/backend.html)
|
47
|
+
|
48
|
+
## Frontend: Structured Generation Language (SGLang)
|
49
|
+
See [https://sgl-project.github.io/frontend/frontend.html](https://sgl-project.github.io/frontend/frontend.html)
|
50
|
+
|
51
|
+
## Benchmark And Performance
|
52
|
+
Learn more in our release blogs: [v0.2 blog](https://lmsys.org/blog/2024-07-25-sglang-llama3/), [v0.3 blog](https://lmsys.org/blog/2024-09-04-sglang-v0-3/)
|
53
|
+
|
54
|
+
## Roadmap
|
55
|
+
[Development Roadmap (2024 Q4)](https://github.com/sgl-project/sglang/issues/1487)
|
56
|
+
|
57
|
+
## Citation And Acknowledgment
|
58
|
+
Please cite our paper, [SGLang: Efficient Execution of Structured Language Model Programs](https://arxiv.org/abs/2312.07104), if you find the project useful.
|
59
|
+
We also learned from the design and reused code from the following projects: [Guidance](https://github.com/guidance-ai/guidance), [vLLM](https://github.com/vllm-project/vllm), [LightLLM](https://github.com/ModelTC/lightllm), [FlashInfer](https://github.com/flashinfer-ai/flashinfer), [Outlines](https://github.com/outlines-dev/outlines), and [LMQL](https://github.com/eth-sri/lmql).
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "sglang"
|
7
|
-
version = "0.3.
|
7
|
+
version = "0.3.5"
|
8
8
|
description = "SGLang is yet another fast serving framework for large language models and vision language models."
|
9
9
|
readme = "README.md"
|
10
10
|
requires-python = ">=3.8"
|
@@ -13,16 +13,19 @@ classifiers = [
|
|
13
13
|
"Programming Language :: Python :: 3",
|
14
14
|
"License :: OSI Approved :: Apache Software License",
|
15
15
|
]
|
16
|
-
dependencies = ["requests", "tqdm", "numpy"]
|
16
|
+
dependencies = ["requests", "tqdm", "numpy", "IPython"]
|
17
17
|
|
18
18
|
[project.optional-dependencies]
|
19
19
|
runtime_common = ["aiohttp", "decord", "fastapi", "hf_transfer", "huggingface_hub", "interegular",
|
20
20
|
"orjson", "packaging", "pillow", "psutil", "pydantic", "python-multipart",
|
21
21
|
"torchao", "uvicorn", "uvloop", "zmq",
|
22
22
|
"outlines>=0.0.44", "modelscope"]
|
23
|
+
srt = ["sglang[runtime_common]", "torch", "vllm==0.6.3.post1"]
|
24
|
+
# HIP (Heterogeneous-computing Interface for Portability) for AMD
|
25
|
+
# => base docker rocm/vllm-dev:20241022, not from public vllm whl
|
26
|
+
srt_hip = ["sglang[runtime_common]", "torch", "vllm==0.6.3.dev13"]
|
23
27
|
# xpu is not enabled in public vllm and torch whl,
|
24
28
|
# need to follow https://docs.vllm.ai/en/latest/getting_started/xpu-installation.htmlinstall vllm
|
25
|
-
srt = ["sglang[runtime_common]", "torch", "vllm==0.6.3.post1"]
|
26
29
|
srt_xpu = ["sglang[runtime_common]"]
|
27
30
|
|
28
31
|
openai = ["openai>=1.0", "tiktoken"]
|
@@ -37,8 +40,10 @@ test = [
|
|
37
40
|
"peft",
|
38
41
|
]
|
39
42
|
all = ["sglang[srt]", "sglang[openai]", "sglang[anthropic]", "sglang[litellm]"]
|
43
|
+
all_hip = ["sglang[srt_hip]", "sglang[openai]", "sglang[anthropic]", "sglang[litellm]"]
|
40
44
|
all_xpu = ["sglang[srt_xpu]", "sglang[openai]", "sglang[anthropic]", "sglang[litellm]"]
|
41
45
|
dev = ["sglang[all]", "sglang[test]"]
|
46
|
+
dev_hip = ["sglang[all_hip]", "sglang[test]"]
|
42
47
|
dev_xpu = ["sglang[all_xpu]", "sglang[test]"]
|
43
48
|
|
44
49
|
[project.urls]
|
@@ -99,7 +99,7 @@ def gen(
|
|
99
99
|
regex: Optional[str] = None,
|
100
100
|
json_schema: Optional[str] = None,
|
101
101
|
):
|
102
|
-
"""Call the model to generate. See the meaning of the arguments in docs/
|
102
|
+
"""Call the model to generate. See the meaning of the arguments in docs/sampling_params.md"""
|
103
103
|
|
104
104
|
if choices:
|
105
105
|
return SglSelect(
|
@@ -129,9 +129,9 @@ def load_model(server_args, port_args, tp_rank):
|
|
129
129
|
|
130
130
|
model_config = ModelConfig(
|
131
131
|
server_args.model_path,
|
132
|
-
server_args.trust_remote_code,
|
132
|
+
trust_remote_code=server_args.trust_remote_code,
|
133
133
|
context_length=server_args.context_length,
|
134
|
-
model_override_args=
|
134
|
+
model_override_args=server_args.json_model_override_args,
|
135
135
|
)
|
136
136
|
model_runner = ModelRunner(
|
137
137
|
model_config=model_config,
|
@@ -550,4 +550,4 @@ if __name__ == "__main__":
|
|
550
550
|
except Exception as e:
|
551
551
|
raise e
|
552
552
|
finally:
|
553
|
-
kill_child_process(
|
553
|
+
kill_child_process()
|
@@ -15,7 +15,6 @@ import dataclasses
|
|
15
15
|
import itertools
|
16
16
|
import json
|
17
17
|
import multiprocessing
|
18
|
-
import os
|
19
18
|
import time
|
20
19
|
from typing import Tuple
|
21
20
|
|
@@ -70,7 +69,7 @@ def launch_server_internal(server_args):
|
|
70
69
|
except Exception as e:
|
71
70
|
raise e
|
72
71
|
finally:
|
73
|
-
kill_child_process(
|
72
|
+
kill_child_process()
|
74
73
|
|
75
74
|
|
76
75
|
def launch_server_process(server_args: ServerArgs):
|
@@ -176,7 +175,7 @@ def run_benchmark(server_args: ServerArgs, bench_args: BenchArgs):
|
|
176
175
|
)
|
177
176
|
finally:
|
178
177
|
if proc:
|
179
|
-
kill_child_process(proc.pid)
|
178
|
+
kill_child_process(proc.pid, include_self=True)
|
180
179
|
|
181
180
|
print(f"\nResults are saved to {bench_args.result_filename}")
|
182
181
|
|
@@ -222,6 +222,85 @@ async def async_request_openai_completions(
|
|
222
222
|
return output
|
223
223
|
|
224
224
|
|
225
|
+
async def async_request_truss(
|
226
|
+
request_func_input: RequestFuncInput,
|
227
|
+
pbar: Optional[tqdm] = None,
|
228
|
+
) -> RequestFuncOutput:
|
229
|
+
api_url = request_func_input.api_url
|
230
|
+
|
231
|
+
prompt = request_func_input.prompt
|
232
|
+
|
233
|
+
async with aiohttp.ClientSession(timeout=AIOHTTP_TIMEOUT) as session:
|
234
|
+
payload = {
|
235
|
+
"model": request_func_input.model,
|
236
|
+
"prompt": prompt,
|
237
|
+
"temperature": 0.0,
|
238
|
+
"best_of": 1,
|
239
|
+
"max_tokens": request_func_input.output_len,
|
240
|
+
"stream": not args.disable_stream,
|
241
|
+
"ignore_eos": not args.disable_ignore_eos,
|
242
|
+
**request_func_input.extra_request_body,
|
243
|
+
}
|
244
|
+
headers = {"Authorization": f"Bearer {os.environ.get('OPENAI_API_KEY')}"}
|
245
|
+
|
246
|
+
output = RequestFuncOutput()
|
247
|
+
output.prompt_len = request_func_input.prompt_len
|
248
|
+
|
249
|
+
generated_text = ""
|
250
|
+
ttft = 0.0
|
251
|
+
st = time.perf_counter()
|
252
|
+
most_recent_timestamp = st
|
253
|
+
try:
|
254
|
+
async with session.post(
|
255
|
+
url=api_url, json=payload, headers=headers
|
256
|
+
) as response:
|
257
|
+
if response.status == 200:
|
258
|
+
async for chunk_bytes in response.content:
|
259
|
+
chunk_bytes = chunk_bytes.strip()
|
260
|
+
if not chunk_bytes:
|
261
|
+
continue
|
262
|
+
|
263
|
+
chunk = remove_prefix(chunk_bytes.decode("utf-8"), "data: ")
|
264
|
+
latency = time.perf_counter() - st
|
265
|
+
if chunk == "[DONE]":
|
266
|
+
pass
|
267
|
+
else:
|
268
|
+
data = json.loads(chunk)
|
269
|
+
|
270
|
+
# NOTE: Some completion API might have a last
|
271
|
+
# usage summary response without a token so we
|
272
|
+
# want to check a token was generated
|
273
|
+
if data["choices"][0]["delta"]["content"]:
|
274
|
+
timestamp = time.perf_counter()
|
275
|
+
# First token
|
276
|
+
if ttft == 0.0:
|
277
|
+
ttft = time.perf_counter() - st
|
278
|
+
output.ttft = ttft
|
279
|
+
|
280
|
+
# Decoding phase
|
281
|
+
else:
|
282
|
+
output.itl.append(timestamp - most_recent_timestamp)
|
283
|
+
|
284
|
+
most_recent_timestamp = timestamp
|
285
|
+
generated_text += data["choices"][0]["delta"]["content"]
|
286
|
+
|
287
|
+
output.generated_text = generated_text
|
288
|
+
output.success = True
|
289
|
+
output.latency = latency
|
290
|
+
output.output_len = request_func_input.output_len
|
291
|
+
else:
|
292
|
+
output.error = response.reason or ""
|
293
|
+
output.success = False
|
294
|
+
except Exception:
|
295
|
+
output.success = False
|
296
|
+
exc_info = sys.exc_info()
|
297
|
+
output.error = "".join(traceback.format_exception(*exc_info))
|
298
|
+
|
299
|
+
if pbar:
|
300
|
+
pbar.update(1)
|
301
|
+
return output
|
302
|
+
|
303
|
+
|
225
304
|
async def async_request_sglang_generate(
|
226
305
|
request_func_input: RequestFuncInput,
|
227
306
|
pbar: Optional[tqdm] = None,
|
@@ -350,6 +429,7 @@ ASYNC_REQUEST_FUNCS = {
|
|
350
429
|
"lmdeploy": async_request_openai_completions,
|
351
430
|
"trt": async_request_trt_llm,
|
352
431
|
"gserver": async_request_gserver,
|
432
|
+
"truss": async_request_truss,
|
353
433
|
}
|
354
434
|
|
355
435
|
|
@@ -873,6 +953,7 @@ def run_benchmark(args_: argparse.Namespace):
|
|
873
953
|
"vllm": 8000,
|
874
954
|
"trt": 8000,
|
875
955
|
"gserver": 9988,
|
956
|
+
"truss": 8080,
|
876
957
|
}.get(args.backend, 30000)
|
877
958
|
|
878
959
|
model_url = (
|
@@ -905,9 +986,20 @@ def run_benchmark(args_: argparse.Namespace):
|
|
905
986
|
elif args.backend == "gserver":
|
906
987
|
api_url = args.base_url if args.base_url else f"{args.host}:{args.port}"
|
907
988
|
args.model = args.model or "default"
|
989
|
+
elif args.backend == "truss":
|
990
|
+
api_url = (
|
991
|
+
f"{args.base_url}/v1/models/model:predict"
|
992
|
+
if args.base_url
|
993
|
+
else f"http://{args.host}:{args.port}/v1/models/model:predict"
|
994
|
+
)
|
908
995
|
|
909
996
|
# Get model name
|
910
997
|
if args.model is None:
|
998
|
+
if args.backend == "truss":
|
999
|
+
print(
|
1000
|
+
"Please provide a model with `--model` when using truss backend. e.g. --model meta-llama/Llama-3.1-8B-Instruct"
|
1001
|
+
)
|
1002
|
+
sys.exit(1)
|
911
1003
|
try:
|
912
1004
|
response = requests.get(model_url)
|
913
1005
|
model_list = response.json().get("data", [])
|
@@ -14,9 +14,15 @@ class GlobalConfig:
|
|
14
14
|
self.default_backend = None
|
15
15
|
|
16
16
|
# Runtime constants: New generation token ratio estimation
|
17
|
-
self.
|
18
|
-
|
19
|
-
|
17
|
+
self.default_init_new_token_ratio = float(
|
18
|
+
os.environ.get("SGLANG_INIT_NEW_TOKEN_RATIO", 0.7)
|
19
|
+
)
|
20
|
+
self.default_min_new_token_ratio_factor = float(
|
21
|
+
os.environ.get("SGLANG_MIN_NEW_TOKEN_RATIO_FACTOR", 0.14)
|
22
|
+
)
|
23
|
+
self.default_new_token_ratio_decay_steps = float(
|
24
|
+
os.environ.get("SGLANG_NEW_TOKEN_RATIO_DECAY_STEPS", 600)
|
25
|
+
)
|
20
26
|
|
21
27
|
# Runtime constants: others
|
22
28
|
self.retract_decode_steps = 20
|