Unverified Commit 62a4a339 authored by Xuehai Pan's avatar Xuehai Pan Committed by GitHub
Browse files

docs: fix module docstrings and copyright headers (#2077)

parent 2797bc34
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier same "printed page" as the copyright notice for easier
identification within third-party archives. identification within third-party archives.
Copyright [yyyy] [name of copyright owner] Copyright 2023-2024 SGLang Team
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
import argparse import argparse
import asyncio import asyncio
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
import json import json
import logging import logging
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
# TODO(lmzheng): make this an optional dependency # TODO(lmzheng): make this an optional dependency
from sglang.srt.constrained.outlines_backend import build_regex_from_object from sglang.srt.constrained.outlines_backend import build_regex_from_object
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""The baseclass of a backend for grammar-guided constrained decoding.""" """The baseclass of a backend for grammar-guided constrained decoding."""
from concurrent.futures import Future, ThreadPoolExecutor from concurrent.futures import Future, ThreadPoolExecutor
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""Constrained decoding with outlines backend.""" """Constrained decoding with outlines backend."""
import json import json
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
""" """
Faster constrained decoding with jump forward decoding / compressed finite state machine. Faster constrained decoding with jump forward decoding / compressed finite state machine.
Reference: https://lmsys.org/blog/2024-02-05-compressed-fsm/ Reference: https://lmsys.org/blog/2024-02-05-compressed-fsm/
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""Constrained decoding with xgrammar backend.""" """Constrained decoding with xgrammar backend."""
import logging import logging
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""Conversation chat templates.""" """Conversation chat templates."""
# Adapted from # Adapted from
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""Utilities for Huggingface Transformers.""" """Utilities for Huggingface Transformers."""
import contextlib import contextlib
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software #
distributed under the License is distributed on an "AS IS" BASIS, # Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
limitations under the License. # See the License for the specific language governing permissions and
""" # limitations under the License.
# ==============================================================================
"""Fused operators for activation layers.""" """Fused operators for activation layers."""
import logging import logging
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
""" """
Memory-efficient attention for decoding. Memory-efficient attention for decoding.
It supports page size = 1. It supports page size = 1.
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
""" """
Memory-efficient attention for prefill. Memory-efficient attention for prefill.
It supports page size = 1 and prefill with KV cache (i.e. extend). It supports page size = 1 and prefill with KV cache (i.e. extend).
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
""" """
Memory-efficient attention for prefill. Memory-efficient attention for prefill.
It supporst page size = 1. It supporst page size = 1.
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
from vllm.model_executor.custom_op import CustomOp from vllm.model_executor.custom_op import CustomOp
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""Fused operators for normalization layers.""" """Fused operators for normalization layers."""
import logging import logging
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""Logits processing.""" """Logits processing."""
import dataclasses import dataclasses
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
"""Radix attention.""" """Radix attention."""
from torch import nn from torch import nn
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software #
distributed under the License is distributed on an "AS IS" BASIS, # Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
limitations under the License. # See the License for the specific language governing permissions and
""" # limitations under the License.
# ==============================================================================
"""MRotaryEmbedding""" """MRotaryEmbedding"""
from typing import Any, Dict, List, Optional, Tuple, Union from typing import Any, Dict, List, Optional, Tuple, Union
......
""" # Copyright 2023-2024 SGLang Team
Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License. # You may obtain a copy of the License at
You may obtain a copy of the License at #
# http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0 #
# Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
See the License for the specific language governing permissions and # limitations under the License.
limitations under the License. # ==============================================================================
"""
# Integrates "S-LoRA: Serving Thousands of Concurrent LoRA Adapters" # Integrates "S-LoRA: Serving Thousands of Concurrent LoRA Adapters"
# and "Punica: Multi-Tenant LoRA Serving" # and "Punica: Multi-Tenant LoRA Serving"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment