diff --git a/.buildkite/check-wheel-size.py b/.buildkite/check-wheel-size.py index e29eb78a..2e4aecdd 100644 --- a/.buildkite/check-wheel-size.py +++ b/.buildkite/check-wheel-size.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import sys import zipfile diff --git a/.buildkite/generate_index.py b/.buildkite/generate_index.py index 8350e270..36e1b6c0 100644 --- a/.buildkite/generate_index.py +++ b/.buildkite/generate_index.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import os diff --git a/.buildkite/lm-eval-harness/test_lm_eval_correctness.py b/.buildkite/lm-eval-harness/test_lm_eval_correctness.py index afc935c1..96e57dfd 100644 --- a/.buildkite/lm-eval-harness/test_lm_eval_correctness.py +++ b/.buildkite/lm-eval-harness/test_lm_eval_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ LM eval harness on model to compare vs HF baseline computed offline. Configs are found in configs/$MODEL.yaml diff --git a/.buildkite/nightly-benchmarks/scripts/convert-results-json-to-markdown.py b/.buildkite/nightly-benchmarks/scripts/convert-results-json-to-markdown.py index 9d3646e2..e031686c 100644 --- a/.buildkite/nightly-benchmarks/scripts/convert-results-json-to-markdown.py +++ b/.buildkite/nightly-benchmarks/scripts/convert-results-json-to-markdown.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import os from pathlib import Path diff --git a/.buildkite/nightly-benchmarks/scripts/download-tokenizer.py b/.buildkite/nightly-benchmarks/scripts/download-tokenizer.py index 68ac5909..5e17b79d 100644 --- a/.buildkite/nightly-benchmarks/scripts/download-tokenizer.py +++ b/.buildkite/nightly-benchmarks/scripts/download-tokenizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse from transformers import AutoTokenizer diff --git a/.buildkite/nightly-benchmarks/scripts/generate-nightly-markdown.py b/.buildkite/nightly-benchmarks/scripts/generate-nightly-markdown.py index 052060c5..0ff95a09 100644 --- a/.buildkite/nightly-benchmarks/scripts/generate-nightly-markdown.py +++ b/.buildkite/nightly-benchmarks/scripts/generate-nightly-markdown.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import json from pathlib import Path diff --git a/.buildkite/nightly-benchmarks/scripts/get-lmdeploy-modelname.py b/.buildkite/nightly-benchmarks/scripts/get-lmdeploy-modelname.py index 18bcc3a8..e5f179a0 100644 --- a/.buildkite/nightly-benchmarks/scripts/get-lmdeploy-modelname.py +++ b/.buildkite/nightly-benchmarks/scripts/get-lmdeploy-modelname.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from lmdeploy.serve.openai.api_client import APIClient api_client = APIClient("http://localhost:8000") diff --git a/.buildkite/nightly-benchmarks/scripts/summary-nightly-results.py b/.buildkite/nightly-benchmarks/scripts/summary-nightly-results.py index 92d6fad7..62ee5e10 100644 --- a/.buildkite/nightly-benchmarks/scripts/summary-nightly-results.py +++ b/.buildkite/nightly-benchmarks/scripts/summary-nightly-results.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import datetime import json import os diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae518e19..4568efcb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,10 +97,14 @@ repos: language: system verbose: true stages: [commit-msg] + - id: check-spdx-header + name: Check SPDX headers + entry: python tools/check_spdx_header.py + language: python + types: [python] - id: suggestion name: Suggestion entry: bash -c 'echo "To bypass pre-commit hooks, add --no-verify to git commit."' language: system verbose: true pass_filenames: false - diff --git a/benchmarks/backend_request_func.py b/benchmarks/backend_request_func.py index 0612e877..364b087b 100644 --- a/benchmarks/backend_request_func.py +++ b/benchmarks/backend_request_func.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import os import sys diff --git a/benchmarks/benchmark_guided.py b/benchmarks/benchmark_guided.py index 1a0e6259..2b41834b 100644 --- a/benchmarks/benchmark_guided.py +++ b/benchmarks/benchmark_guided.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Benchmark guided decoding throughput.""" import argparse import dataclasses diff --git a/benchmarks/benchmark_latency.py b/benchmarks/benchmark_latency.py index 77c4f6aa..89631294 100644 --- a/benchmarks/benchmark_latency.py +++ b/benchmarks/benchmark_latency.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Benchmark the latency of processing a single batch of requests.""" import argparse import dataclasses diff --git a/benchmarks/benchmark_long_document_qa_throughput.py b/benchmarks/benchmark_long_document_qa_throughput.py index 0b8fba38..21480578 100644 --- a/benchmarks/benchmark_long_document_qa_throughput.py +++ b/benchmarks/benchmark_long_document_qa_throughput.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Offline benchmark to test the long document QA throughput. diff --git a/benchmarks/benchmark_prefix_caching.py b/benchmarks/benchmark_prefix_caching.py index 3ab421a8..23822856 100644 --- a/benchmarks/benchmark_prefix_caching.py +++ b/benchmarks/benchmark_prefix_caching.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Benchmark the efficiency of prefix caching. diff --git a/benchmarks/benchmark_prioritization.py b/benchmarks/benchmark_prioritization.py index e0c9e6a6..a32065e4 100644 --- a/benchmarks/benchmark_prioritization.py +++ b/benchmarks/benchmark_prioritization.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Benchmark offline prioritization.""" import argparse import dataclasses diff --git a/benchmarks/benchmark_serving.py b/benchmarks/benchmark_serving.py index 8b321283..e934d228 100644 --- a/benchmarks/benchmark_serving.py +++ b/benchmarks/benchmark_serving.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 r"""Benchmark online serving throughput. On the server side, run one of the following commands: diff --git a/benchmarks/benchmark_serving_guided.py b/benchmarks/benchmark_serving_guided.py index 4435d87e..561e500d 100644 --- a/benchmarks/benchmark_serving_guided.py +++ b/benchmarks/benchmark_serving_guided.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 r"""Benchmark online serving throughput with guided decoding. On the server side, run one of the following commands: diff --git a/benchmarks/benchmark_throughput.py b/benchmarks/benchmark_throughput.py index c1b10b3c..658eab6a 100644 --- a/benchmarks/benchmark_throughput.py +++ b/benchmarks/benchmark_throughput.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Benchmark offline inference throughput.""" import argparse import dataclasses diff --git a/benchmarks/cutlass_benchmarks/sparse_benchmarks.py b/benchmarks/cutlass_benchmarks/sparse_benchmarks.py index 3d1c5e39..468a1b28 100644 --- a/benchmarks/cutlass_benchmarks/sparse_benchmarks.py +++ b/benchmarks/cutlass_benchmarks/sparse_benchmarks.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import copy import itertools diff --git a/benchmarks/cutlass_benchmarks/utils.py b/benchmarks/cutlass_benchmarks/utils.py index ef06fcd6..bab37780 100644 --- a/benchmarks/cutlass_benchmarks/utils.py +++ b/benchmarks/cutlass_benchmarks/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Cutlass bench utils from typing import Iterable, Tuple diff --git a/benchmarks/cutlass_benchmarks/w8a8_benchmarks.py b/benchmarks/cutlass_benchmarks/w8a8_benchmarks.py index b87496ca..6552b62d 100644 --- a/benchmarks/cutlass_benchmarks/w8a8_benchmarks.py +++ b/benchmarks/cutlass_benchmarks/w8a8_benchmarks.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import copy import itertools diff --git a/benchmarks/cutlass_benchmarks/weight_shapes.py b/benchmarks/cutlass_benchmarks/weight_shapes.py index d58fb0bf..3d1121df 100644 --- a/benchmarks/cutlass_benchmarks/weight_shapes.py +++ b/benchmarks/cutlass_benchmarks/weight_shapes.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Weight Shapes are in the format # ([K, N], TP_SPLIT_DIM) # Example: diff --git a/benchmarks/disagg_benchmarks/disagg_prefill_proxy_server.py b/benchmarks/disagg_benchmarks/disagg_prefill_proxy_server.py index 4058b1c0..980e6866 100644 --- a/benchmarks/disagg_benchmarks/disagg_prefill_proxy_server.py +++ b/benchmarks/disagg_benchmarks/disagg_prefill_proxy_server.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import aiohttp diff --git a/benchmarks/disagg_benchmarks/round_robin_proxy.py b/benchmarks/disagg_benchmarks/round_robin_proxy.py index 6eb5f639..c2ad4916 100644 --- a/benchmarks/disagg_benchmarks/round_robin_proxy.py +++ b/benchmarks/disagg_benchmarks/round_robin_proxy.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import itertools diff --git a/benchmarks/disagg_benchmarks/visualize_benchmark_results.py b/benchmarks/disagg_benchmarks/visualize_benchmark_results.py index e59d8bb0..a7b4b9e8 100644 --- a/benchmarks/disagg_benchmarks/visualize_benchmark_results.py +++ b/benchmarks/disagg_benchmarks/visualize_benchmark_results.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import matplotlib.pyplot as plt diff --git a/benchmarks/fused_kernels/layernorm_rms_benchmarks.py b/benchmarks/fused_kernels/layernorm_rms_benchmarks.py index ef91f9f8..c56cc743 100644 --- a/benchmarks/fused_kernels/layernorm_rms_benchmarks.py +++ b/benchmarks/fused_kernels/layernorm_rms_benchmarks.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pickle as pkl import time from dataclasses import dataclass diff --git a/benchmarks/kernels/benchmark_aqlm.py b/benchmarks/kernels/benchmark_aqlm.py index 601c4ea4..8d20b915 100644 --- a/benchmarks/kernels/benchmark_aqlm.py +++ b/benchmarks/kernels/benchmark_aqlm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import sys from typing import Optional diff --git a/benchmarks/kernels/benchmark_layernorm.py b/benchmarks/kernels/benchmark_layernorm.py index 7acea608..d265c91b 100644 --- a/benchmarks/kernels/benchmark_layernorm.py +++ b/benchmarks/kernels/benchmark_layernorm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time import torch diff --git a/benchmarks/kernels/benchmark_lora.py b/benchmarks/kernels/benchmark_lora.py index e1f613e1..ecde8fba 100644 --- a/benchmarks/kernels/benchmark_lora.py +++ b/benchmarks/kernels/benchmark_lora.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import copy import json diff --git a/benchmarks/kernels/benchmark_machete.py b/benchmarks/kernels/benchmark_machete.py index 46bab74a..0301fee1 100644 --- a/benchmarks/kernels/benchmark_machete.py +++ b/benchmarks/kernels/benchmark_machete.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import copy import itertools diff --git a/benchmarks/kernels/benchmark_marlin.py b/benchmarks/kernels/benchmark_marlin.py index 8fb44e3a..c22e66c0 100644 --- a/benchmarks/kernels/benchmark_marlin.py +++ b/benchmarks/kernels/benchmark_marlin.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import torch diff --git a/benchmarks/kernels/benchmark_moe.py b/benchmarks/kernels/benchmark_moe.py index 068830f0..a4a45c9c 100644 --- a/benchmarks/kernels/benchmark_moe.py +++ b/benchmarks/kernels/benchmark_moe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import time from datetime import datetime diff --git a/benchmarks/kernels/benchmark_paged_attention.py b/benchmarks/kernels/benchmark_paged_attention.py index 219013a3..daedaadb 100644 --- a/benchmarks/kernels/benchmark_paged_attention.py +++ b/benchmarks/kernels/benchmark_paged_attention.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random import time from typing import List, Optional diff --git a/benchmarks/kernels/benchmark_quant.py b/benchmarks/kernels/benchmark_quant.py index 1d624834..0ddea939 100644 --- a/benchmarks/kernels/benchmark_quant.py +++ b/benchmarks/kernels/benchmark_quant.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time import torch diff --git a/benchmarks/kernels/benchmark_rmsnorm.py b/benchmarks/kernels/benchmark_rmsnorm.py index baa5de0f..dba15374 100644 --- a/benchmarks/kernels/benchmark_rmsnorm.py +++ b/benchmarks/kernels/benchmark_rmsnorm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools from typing import Optional, Tuple, Union diff --git a/benchmarks/kernels/benchmark_rope.py b/benchmarks/kernels/benchmark_rope.py index 250d5051..8ee0212a 100644 --- a/benchmarks/kernels/benchmark_rope.py +++ b/benchmarks/kernels/benchmark_rope.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from itertools import accumulate from typing import List, Optional diff --git a/benchmarks/kernels/benchmark_shapes.py b/benchmarks/kernels/benchmark_shapes.py index 4eeeca35..c375e61e 100644 --- a/benchmarks/kernels/benchmark_shapes.py +++ b/benchmarks/kernels/benchmark_shapes.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + WEIGHT_SHAPES = { "ideal": [[4 * 256 * 32, 256 * 32]], "mistralai/Mistral-7B-v0.1/TP1": [ diff --git a/benchmarks/kernels/graph_machete_bench.py b/benchmarks/kernels/graph_machete_bench.py index 7d0bd841..01d97d63 100644 --- a/benchmarks/kernels/graph_machete_bench.py +++ b/benchmarks/kernels/graph_machete_bench.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math import pickle import re diff --git a/benchmarks/kernels/utils.py b/benchmarks/kernels/utils.py index fee877b6..72817074 100644 --- a/benchmarks/kernels/utils.py +++ b/benchmarks/kernels/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import Any, Callable, Iterable, Optional diff --git a/benchmarks/kernels/weight_shapes.py b/benchmarks/kernels/weight_shapes.py index 51f24f3b..89b05d58 100644 --- a/benchmarks/kernels/weight_shapes.py +++ b/benchmarks/kernels/weight_shapes.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Weight Shapes are in the format # ([K, N], TP_SPLIT_DIM) # Example: diff --git a/benchmarks/overheads/benchmark_hashing.py b/benchmarks/overheads/benchmark_hashing.py index d16d6f9f..5f94552e 100644 --- a/benchmarks/overheads/benchmark_hashing.py +++ b/benchmarks/overheads/benchmark_hashing.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import cProfile import pstats diff --git a/cmake/hipify.py b/cmake/hipify.py index 340e41c8..2e0c8a17 100755 --- a/cmake/hipify.py +++ b/cmake/hipify.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + #!/usr/bin/env python3 # diff --git a/collect_env.py b/collect_env.py index 254c19b1..0ec9d4ca 100644 --- a/collect_env.py +++ b/collect_env.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # ruff: noqa # code borrowed from https://github.com/pytorch/pytorch/blob/main/torch/utils/collect_env.py diff --git a/csrc/cutlass_extensions/vllm_cutlass_library_extension.py b/csrc/cutlass_extensions/vllm_cutlass_library_extension.py index b401736c..d5a5e2ef 100644 --- a/csrc/cutlass_extensions/vllm_cutlass_library_extension.py +++ b/csrc/cutlass_extensions/vllm_cutlass_library_extension.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum from typing import Dict, Union diff --git a/csrc/quantization/machete/generate.py b/csrc/quantization/machete/generate.py index a9b5ddf4..02e59fe2 100644 --- a/csrc/quantization/machete/generate.py +++ b/csrc/quantization/machete/generate.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools import math import os diff --git a/docs/source/conf.py b/docs/source/conf.py index 6b0a1dad..ea3b56e0 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full diff --git a/docs/source/generate_examples.py b/docs/source/generate_examples.py index ac592e22..9d4de18a 100644 --- a/docs/source/generate_examples.py +++ b/docs/source/generate_examples.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools import re from dataclasses import dataclass, field diff --git a/examples/offline_inference/aqlm_example.py b/examples/offline_inference/aqlm_example.py index 40f9a21e..e8db3811 100644 --- a/examples/offline_inference/aqlm_example.py +++ b/examples/offline_inference/aqlm_example.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams from vllm.utils import FlexibleArgumentParser diff --git a/examples/offline_inference/arctic.py b/examples/offline_inference/arctic.py index 1fec3c99..90c88446 100644 --- a/examples/offline_inference/arctic.py +++ b/examples/offline_inference/arctic.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams # Sample prompts. diff --git a/examples/offline_inference/audio_language.py b/examples/offline_inference/audio_language.py index 5952ec13..707ca9f8 100644 --- a/examples/offline_inference/audio_language.py +++ b/examples/offline_inference/audio_language.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This example shows how to use vLLM for running offline inference with the correct prompt format on audio language models. diff --git a/examples/offline_inference/basic.py b/examples/offline_inference/basic.py index 23cc6e85..a6e96c0b 100644 --- a/examples/offline_inference/basic.py +++ b/examples/offline_inference/basic.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams # Sample prompts. diff --git a/examples/offline_inference/basic_with_model_default_sampling.py b/examples/offline_inference/basic_with_model_default_sampling.py index 346bb80b..80de9428 100644 --- a/examples/offline_inference/basic_with_model_default_sampling.py +++ b/examples/offline_inference/basic_with_model_default_sampling.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM # Sample prompts. diff --git a/examples/offline_inference/chat.py b/examples/offline_inference/chat.py index 8814f4d7..dbc710cc 100644 --- a/examples/offline_inference/chat.py +++ b/examples/offline_inference/chat.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams llm = LLM(model="meta-llama/Meta-Llama-3-8B-Instruct") diff --git a/examples/offline_inference/chat_with_tools.py b/examples/offline_inference/chat_with_tools.py index e69a6c06..15519bfe 100644 --- a/examples/offline_inference/chat_with_tools.py +++ b/examples/offline_inference/chat_with_tools.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # ruff: noqa import json import random diff --git a/examples/offline_inference/classification.py b/examples/offline_inference/classification.py index de539b63..4a364aeb 100644 --- a/examples/offline_inference/classification.py +++ b/examples/offline_inference/classification.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM # Sample prompts. diff --git a/examples/offline_inference/cli.py b/examples/offline_inference/cli.py index 391ac6b9..bc6833b3 100644 --- a/examples/offline_inference/cli.py +++ b/examples/offline_inference/cli.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import asdict from vllm import LLM, SamplingParams diff --git a/examples/offline_inference/cpu_offload.py b/examples/offline_inference/cpu_offload.py index b152e5bc..5511eb73 100644 --- a/examples/offline_inference/cpu_offload.py +++ b/examples/offline_inference/cpu_offload.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams # Sample prompts. diff --git a/examples/offline_inference/distributed.py b/examples/offline_inference/distributed.py index 67712784..a2df41d4 100644 --- a/examples/offline_inference/distributed.py +++ b/examples/offline_inference/distributed.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This example shows how to use Ray Data for running offline batch inference distributively on a multi-nodes cluster. diff --git a/examples/offline_inference/embedding.py b/examples/offline_inference/embedding.py index 58d00431..f9399329 100644 --- a/examples/offline_inference/embedding.py +++ b/examples/offline_inference/embedding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM # Sample prompts. diff --git a/examples/offline_inference/encoder_decoder.py b/examples/offline_inference/encoder_decoder.py index 0f266d79..8765d181 100644 --- a/examples/offline_inference/encoder_decoder.py +++ b/examples/offline_inference/encoder_decoder.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 ''' Demonstrate prompting of text-to-text encoder/decoder models, specifically BART diff --git a/examples/offline_inference/florence2_inference.py b/examples/offline_inference/florence2_inference.py index c24096e9..58610b0f 100644 --- a/examples/offline_inference/florence2_inference.py +++ b/examples/offline_inference/florence2_inference.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 ''' Demonstrate prompting of text-to-text encoder/decoder models, specifically Florence-2 diff --git a/examples/offline_inference/gguf_inference.py b/examples/offline_inference/gguf_inference.py index aa05c4c0..0447e74e 100644 --- a/examples/offline_inference/gguf_inference.py +++ b/examples/offline_inference/gguf_inference.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from huggingface_hub import hf_hub_download from vllm import LLM, SamplingParams diff --git a/examples/offline_inference/llm_engine_example.py b/examples/offline_inference/llm_engine_example.py index 60d894aa..501034c1 100644 --- a/examples/offline_inference/llm_engine_example.py +++ b/examples/offline_inference/llm_engine_example.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse from typing import List, Tuple diff --git a/examples/offline_inference/lora_with_quantization_inference.py b/examples/offline_inference/lora_with_quantization_inference.py index 0c454ea5..de0734c1 100644 --- a/examples/offline_inference/lora_with_quantization_inference.py +++ b/examples/offline_inference/lora_with_quantization_inference.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This example shows how to use LoRA with different quantization techniques for offline inference. diff --git a/examples/offline_inference/mlpspeculator.py b/examples/offline_inference/mlpspeculator.py index 8f0eb65e..10d9de8c 100644 --- a/examples/offline_inference/mlpspeculator.py +++ b/examples/offline_inference/mlpspeculator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import gc import time from typing import List diff --git a/examples/offline_inference/multilora_inference.py b/examples/offline_inference/multilora_inference.py index 043220d9..630fd1bf 100644 --- a/examples/offline_inference/multilora_inference.py +++ b/examples/offline_inference/multilora_inference.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This example shows how to use the multi-LoRA functionality for offline inference. diff --git a/examples/offline_inference/neuron.py b/examples/offline_inference/neuron.py index f098c8e5..517d1bfc 100644 --- a/examples/offline_inference/neuron.py +++ b/examples/offline_inference/neuron.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams # Sample prompts. diff --git a/examples/offline_inference/neuron_int8_quantization.py b/examples/offline_inference/neuron_int8_quantization.py index 8ec17e34..c899a01a 100644 --- a/examples/offline_inference/neuron_int8_quantization.py +++ b/examples/offline_inference/neuron_int8_quantization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from vllm import LLM, SamplingParams diff --git a/examples/offline_inference/pixtral.py b/examples/offline_inference/pixtral.py index c12ff702..760de114 100644 --- a/examples/offline_inference/pixtral.py +++ b/examples/offline_inference/pixtral.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # ruff: noqa import argparse diff --git a/examples/offline_inference/prefix_caching.py b/examples/offline_inference/prefix_caching.py index 67b755a1..4c326c41 100644 --- a/examples/offline_inference/prefix_caching.py +++ b/examples/offline_inference/prefix_caching.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams from vllm.distributed import cleanup_dist_env_and_memory diff --git a/examples/offline_inference/profiling.py b/examples/offline_inference/profiling.py index 8a94b5c2..c2e072fd 100644 --- a/examples/offline_inference/profiling.py +++ b/examples/offline_inference/profiling.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import inspect import json import os diff --git a/examples/offline_inference/profiling_tpu/profiling.py b/examples/offline_inference/profiling_tpu/profiling.py index d7423e6c..b1fe829b 100644 --- a/examples/offline_inference/profiling_tpu/profiling.py +++ b/examples/offline_inference/profiling_tpu/profiling.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import dataclasses import os diff --git a/examples/offline_inference/rlhf.py b/examples/offline_inference/rlhf.py index 5c491800..5000251c 100644 --- a/examples/offline_inference/rlhf.py +++ b/examples/offline_inference/rlhf.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ a simple demonstration of RLHF with vLLM, inspired by the OpenRLHF framework https://github.com/OpenRLHF/OpenRLHF . diff --git a/examples/offline_inference/save_sharded_state.py b/examples/offline_inference/save_sharded_state.py index 4207f892..86327643 100644 --- a/examples/offline_inference/save_sharded_state.py +++ b/examples/offline_inference/save_sharded_state.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Saves each worker's model state dict directly to a checkpoint, which enables a fast load path for large tensor-parallel models where each worker only needs to diff --git a/examples/offline_inference/scoring.py b/examples/offline_inference/scoring.py index 5da9e710..7daa82b8 100644 --- a/examples/offline_inference/scoring.py +++ b/examples/offline_inference/scoring.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM # Sample prompts. diff --git a/examples/offline_inference/simple_profiling.py b/examples/offline_inference/simple_profiling.py index abcfa8e8..b45954b3 100644 --- a/examples/offline_inference/simple_profiling.py +++ b/examples/offline_inference/simple_profiling.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import time diff --git a/examples/offline_inference/structured_outputs.py b/examples/offline_inference/structured_outputs.py index 00d86460..38ffd7fb 100644 --- a/examples/offline_inference/structured_outputs.py +++ b/examples/offline_inference/structured_outputs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from enum import Enum from pydantic import BaseModel diff --git a/examples/offline_inference/torchrun_example.py b/examples/offline_inference/torchrun_example.py index b6de73eb..35df6011 100644 --- a/examples/offline_inference/torchrun_example.py +++ b/examples/offline_inference/torchrun_example.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ experimental support for tensor-parallel inference with torchrun, see https://github.com/vllm-project/vllm/issues/11400 for diff --git a/examples/offline_inference/tpu.py b/examples/offline_inference/tpu.py index 251629b8..bd0e9846 100644 --- a/examples/offline_inference/tpu.py +++ b/examples/offline_inference/tpu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams prompts = [ diff --git a/examples/offline_inference/vision_language.py b/examples/offline_inference/vision_language.py index 38c2b13d..65940b6a 100644 --- a/examples/offline_inference/vision_language.py +++ b/examples/offline_inference/vision_language.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This example shows how to use vLLM for running offline inference with the correct prompt format on vision language models for text generation. diff --git a/examples/offline_inference/vision_language_embedding.py b/examples/offline_inference/vision_language_embedding.py index 4ce3d496..3075fbbf 100644 --- a/examples/offline_inference/vision_language_embedding.py +++ b/examples/offline_inference/vision_language_embedding.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This example shows how to use vLLM for running offline inference with the correct prompt format on vision language models for multimodal embedding. diff --git a/examples/offline_inference/vision_language_multi_image.py b/examples/offline_inference/vision_language_multi_image.py index 43c44fa8..601ac96e 100644 --- a/examples/offline_inference/vision_language_multi_image.py +++ b/examples/offline_inference/vision_language_multi_image.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This example shows how to use vLLM for running offline inference with multi-image input on vision language models for text generation, diff --git a/examples/offline_inference/whisper.py b/examples/offline_inference/whisper.py index 087ad437..59c119a7 100644 --- a/examples/offline_inference/whisper.py +++ b/examples/offline_inference/whisper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from vllm import LLM, SamplingParams diff --git a/examples/online_serving/api_client.py b/examples/online_serving/api_client.py index 49a085fe..623e0d59 100644 --- a/examples/online_serving/api_client.py +++ b/examples/online_serving/api_client.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Example Python client for `vllm.entrypoints.api_server` NOTE: The API server is used only for demonstration and simple performance benchmarks. It is not intended for production use. diff --git a/examples/online_serving/cohere_rerank_client.py b/examples/online_serving/cohere_rerank_client.py index a07affe3..fc434ada 100644 --- a/examples/online_serving/cohere_rerank_client.py +++ b/examples/online_serving/cohere_rerank_client.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Example of using the OpenAI entrypoint's rerank API which is compatible with the Cohere SDK: https://github.com/cohere-ai/cohere-python diff --git a/examples/online_serving/gradio_openai_chatbot_webserver.py b/examples/online_serving/gradio_openai_chatbot_webserver.py index 8ceb8f68..ee01e1ea 100644 --- a/examples/online_serving/gradio_openai_chatbot_webserver.py +++ b/examples/online_serving/gradio_openai_chatbot_webserver.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import gradio as gr diff --git a/examples/online_serving/gradio_webserver.py b/examples/online_serving/gradio_webserver.py index 54e90758..c619146b 100644 --- a/examples/online_serving/gradio_webserver.py +++ b/examples/online_serving/gradio_webserver.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import json diff --git a/examples/online_serving/jinaai_rerank_client.py b/examples/online_serving/jinaai_rerank_client.py index bf4de76d..3e760e17 100644 --- a/examples/online_serving/jinaai_rerank_client.py +++ b/examples/online_serving/jinaai_rerank_client.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Example of using the OpenAI entrypoint's rerank API which is compatible with Jina and Cohere https://jina.ai/reranker diff --git a/examples/online_serving/openai_chat_completion_client.py b/examples/online_serving/openai_chat_completion_client.py index bbada389..a8156204 100644 --- a/examples/online_serving/openai_chat_completion_client.py +++ b/examples/online_serving/openai_chat_completion_client.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from openai import OpenAI # Modify OpenAI's API key and API base to use vLLM's API server. diff --git a/examples/online_serving/openai_chat_completion_client_for_multimodal.py b/examples/online_serving/openai_chat_completion_client_for_multimodal.py index 03cc037b..d5f798a8 100644 --- a/examples/online_serving/openai_chat_completion_client_for_multimodal.py +++ b/examples/online_serving/openai_chat_completion_client_for_multimodal.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """An example showing how to use vLLM to serve multimodal models and run online serving with OpenAI client. diff --git a/examples/online_serving/openai_chat_completion_client_with_tools.py b/examples/online_serving/openai_chat_completion_client_with_tools.py index 2bbe42b6..416fb61c 100644 --- a/examples/online_serving/openai_chat_completion_client_with_tools.py +++ b/examples/online_serving/openai_chat_completion_client_with_tools.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Set up this example by starting a vLLM OpenAI-compatible server with tool call options enabled. For example: diff --git a/examples/online_serving/openai_chat_completion_structured_outputs.py b/examples/online_serving/openai_chat_completion_structured_outputs.py index 8c059c7c..cddd9318 100644 --- a/examples/online_serving/openai_chat_completion_structured_outputs.py +++ b/examples/online_serving/openai_chat_completion_structured_outputs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from enum import Enum from openai import OpenAI diff --git a/examples/online_serving/openai_chat_completion_with_reasoning.py b/examples/online_serving/openai_chat_completion_with_reasoning.py index 83e51a48..a88c8adb 100644 --- a/examples/online_serving/openai_chat_completion_with_reasoning.py +++ b/examples/online_serving/openai_chat_completion_with_reasoning.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ An example shows how to generate chat completions from reasoning models like DeepSeekR1. diff --git a/examples/online_serving/openai_chat_completion_with_reasoning_streaming.py b/examples/online_serving/openai_chat_completion_with_reasoning_streaming.py index 8c14aac6..489bfcd5 100644 --- a/examples/online_serving/openai_chat_completion_with_reasoning_streaming.py +++ b/examples/online_serving/openai_chat_completion_with_reasoning_streaming.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ An example shows how to generate chat completions from reasoning models like DeepSeekR1. diff --git a/examples/online_serving/openai_chat_embedding_client_for_multimodal.py b/examples/online_serving/openai_chat_embedding_client_for_multimodal.py index a56e7429..f49d7a22 100644 --- a/examples/online_serving/openai_chat_embedding_client_for_multimodal.py +++ b/examples/online_serving/openai_chat_embedding_client_for_multimodal.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import base64 import io diff --git a/examples/online_serving/openai_completion_client.py b/examples/online_serving/openai_completion_client.py index 58519f97..06b93d7d 100644 --- a/examples/online_serving/openai_completion_client.py +++ b/examples/online_serving/openai_completion_client.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from openai import OpenAI # Modify OpenAI's API key and API base to use vLLM's API server. diff --git a/examples/online_serving/openai_cross_encoder_score.py b/examples/online_serving/openai_cross_encoder_score.py index 365a684d..67c5fc91 100644 --- a/examples/online_serving/openai_cross_encoder_score.py +++ b/examples/online_serving/openai_cross_encoder_score.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Example online usage of Score API. diff --git a/examples/online_serving/openai_embedding_client.py b/examples/online_serving/openai_embedding_client.py index 4bd7ca01..cb110997 100644 --- a/examples/online_serving/openai_embedding_client.py +++ b/examples/online_serving/openai_embedding_client.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from openai import OpenAI # Modify OpenAI's API key and API base to use vLLM's API server. diff --git a/examples/online_serving/openai_pooling_client.py b/examples/online_serving/openai_pooling_client.py index 37ec8f2f..e17f9c5e 100644 --- a/examples/online_serving/openai_pooling_client.py +++ b/examples/online_serving/openai_pooling_client.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Example online usage of Pooling API. diff --git a/examples/online_serving/opentelemetry/dummy_client.py b/examples/online_serving/opentelemetry/dummy_client.py index b1a2b3c3..7a605f85 100644 --- a/examples/online_serving/opentelemetry/dummy_client.py +++ b/examples/online_serving/opentelemetry/dummy_client.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import requests from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import ( OTLPSpanExporter) diff --git a/examples/other/tensorize_vllm_model.py b/examples/other/tensorize_vllm_model.py index 5fff1fdf..68345e6c 100644 --- a/examples/other/tensorize_vllm_model.py +++ b/examples/other/tensorize_vllm_model.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import dataclasses import json diff --git a/find_cuda_init.py b/find_cuda_init.py index 51db2310..0d13b2f8 100644 --- a/find_cuda_init.py +++ b/find_cuda_init.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import importlib import traceback from typing import Callable diff --git a/python_only_dev.py b/python_only_dev.py index 7d95ac96..a303697b 100644 --- a/python_only_dev.py +++ b/python_only_dev.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + msg = """Old style python only build (without compilation) is deprecated, please check https://docs.vllm.ai/en/latest/getting_started/installation.html#python-only-build-without-compilation for the new way to do python only build (without compilation). TL;DR: diff --git a/setup.py b/setup.py index 50a2392a..50265d46 100755 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import ctypes import importlib.util import logging diff --git a/tests/async_engine/api_server_async_engine.py b/tests/async_engine/api_server_async_engine.py index a3c9d5c6..d9ac6116 100644 --- a/tests/async_engine/api_server_async_engine.py +++ b/tests/async_engine/api_server_async_engine.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """vllm.entrypoints.api_server with some extra logging for testing.""" from typing import Any, Dict, Iterable diff --git a/tests/async_engine/test_api_server.py b/tests/async_engine/test_api_server.py index 91ac35dd..77f3fb00 100644 --- a/tests/async_engine/test_api_server.py +++ b/tests/async_engine/test_api_server.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import subprocess import sys import time diff --git a/tests/async_engine/test_async_llm_engine.py b/tests/async_engine/test_async_llm_engine.py index 8a04693b..ca29abc9 100644 --- a/tests/async_engine/test_async_llm_engine.py +++ b/tests/async_engine/test_async_llm_engine.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os import uuid diff --git a/tests/async_engine/test_request_tracker.py b/tests/async_engine/test_request_tracker.py index 5668cc30..fd6d89d4 100644 --- a/tests/async_engine/test_request_tracker.py +++ b/tests/async_engine/test_request_tracker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.engine.async_llm_engine import RequestTracker diff --git a/tests/basic_correctness/test_basic_correctness.py b/tests/basic_correctness/test_basic_correctness.py index 23285040..2792dfde 100644 --- a/tests/basic_correctness/test_basic_correctness.py +++ b/tests/basic_correctness/test_basic_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the short outputs of HF and vLLM when using greedy sampling. Run `pytest tests/basic_correctness/test_basic_correctness.py`. diff --git a/tests/basic_correctness/test_chunked_prefill.py b/tests/basic_correctness/test_chunked_prefill.py index 469d18a4..cefd54d1 100644 --- a/tests/basic_correctness/test_chunked_prefill.py +++ b/tests/basic_correctness/test_chunked_prefill.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM when using greedy sampling. It tests chunked prefill. Chunked prefill can be enabled by diff --git a/tests/basic_correctness/test_cpu_offload.py b/tests/basic_correctness/test_cpu_offload.py index d7f36a78..b4d558ce 100644 --- a/tests/basic_correctness/test_cpu_offload.py +++ b/tests/basic_correctness/test_cpu_offload.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from ..utils import compare_two_settings diff --git a/tests/basic_correctness/test_cumem.py b/tests/basic_correctness/test_cumem.py index 53f4ef08..da9239b0 100644 --- a/tests/basic_correctness/test_cumem.py +++ b/tests/basic_correctness/test_cumem.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from vllm import LLM, SamplingParams diff --git a/tests/basic_correctness/test_preemption.py b/tests/basic_correctness/test_preemption.py index 4b27dcbc..6aaec6ee 100644 --- a/tests/basic_correctness/test_preemption.py +++ b/tests/basic_correctness/test_preemption.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the short outputs of HF and vLLM when using greedy sampling. VLLM_TEST_ENABLE_ARTIFICIAL_PREEMPT=1 has to be set before running this test. diff --git a/tests/compile/backend.py b/tests/compile/backend.py index 8fa10e5b..74bc58a2 100644 --- a/tests/compile/backend.py +++ b/tests/compile/backend.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from copy import deepcopy from typing import Callable, Union diff --git a/tests/compile/piecewise/test_simple.py b/tests/compile/piecewise/test_simple.py index aa115248..9d633ad2 100644 --- a/tests/compile/piecewise/test_simple.py +++ b/tests/compile/piecewise/test_simple.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Test the piecewise compilation with a simple model so that we can exactly calculate the expected output and side effects. diff --git a/tests/compile/piecewise/test_toy_llama.py b/tests/compile/piecewise/test_toy_llama.py index d4ede4d2..0404722b 100644 --- a/tests/compile/piecewise/test_toy_llama.py +++ b/tests/compile/piecewise/test_toy_llama.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Test the piecewise compilation with a simple model, comparing the output with and without the piecewise compilation. diff --git a/tests/compile/test_basic_correctness.py b/tests/compile/test_basic_correctness.py index 1945479f..d7acec69 100644 --- a/tests/compile/test_basic_correctness.py +++ b/tests/compile/test_basic_correctness.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import Dict, List, Optional diff --git a/tests/compile/test_full_graph.py b/tests/compile/test_full_graph.py index 4dfdfe21..6e83fa36 100644 --- a/tests/compile/test_full_graph.py +++ b/tests/compile/test_full_graph.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.config import CompilationLevel diff --git a/tests/compile/test_functionalization.py b/tests/compile/test_functionalization.py index ea3aaee9..8f504052 100644 --- a/tests/compile/test_functionalization.py +++ b/tests/compile/test_functionalization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/compile/test_fusion.py b/tests/compile/test_fusion.py index b4266a4a..c14f0caa 100644 --- a/tests/compile/test_fusion.py +++ b/tests/compile/test_fusion.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch from compressed_tensors.quantization import FP8_DTYPE diff --git a/tests/compile/test_pass_manager.py b/tests/compile/test_pass_manager.py index 03e75350..70920ab1 100644 --- a/tests/compile/test_pass_manager.py +++ b/tests/compile/test_pass_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pickle import pytest diff --git a/tests/compile/test_wrapper.py b/tests/compile/test_wrapper.py index 74f66baa..0934c611 100644 --- a/tests/compile/test_wrapper.py +++ b/tests/compile/test_wrapper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional import torch diff --git a/tests/compile/utils.py b/tests/compile/utils.py index 7c92d165..e4a88584 100644 --- a/tests/compile/utils.py +++ b/tests/compile/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import torch diff --git a/tests/conftest.py b/tests/conftest.py index 279c1bf9..85dd5bcb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import os import tempfile diff --git a/tests/core/block/conftest.py b/tests/core/block/conftest.py index 0464d6a7..b7a9863f 100644 --- a/tests/core/block/conftest.py +++ b/tests/core/block/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest diff --git a/tests/core/block/e2e/conftest.py b/tests/core/block/e2e/conftest.py index 70577ec0..7d3ccaad 100644 --- a/tests/core/block/e2e/conftest.py +++ b/tests/core/block/e2e/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, Iterable, Optional import pytest diff --git a/tests/core/block/e2e/test_correctness.py b/tests/core/block/e2e/test_correctness.py index 86502f61..e9b537ed 100644 --- a/tests/core/block/e2e/test_correctness.py +++ b/tests/core/block/e2e/test_correctness.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from itertools import cycle import pytest diff --git a/tests/core/block/e2e/test_correctness_sliding_window.py b/tests/core/block/e2e/test_correctness_sliding_window.py index 415d0bd8..c874608e 100644 --- a/tests/core/block/e2e/test_correctness_sliding_window.py +++ b/tests/core/block/e2e/test_correctness_sliding_window.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import List diff --git a/tests/core/block/test_block_manager.py b/tests/core/block/test_block_manager.py index cfd749ad..68d9618a 100644 --- a/tests/core/block/test_block_manager.py +++ b/tests/core/block/test_block_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.core.block.utils import (STR_NOT_IMPL_ENC_DEC_PREFIX_CACHE, diff --git a/tests/core/block/test_block_table.py b/tests/core/block/test_block_table.py index e2391a56..d8cf0bec 100644 --- a/tests/core/block/test_block_table.py +++ b/tests/core/block/test_block_table.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/core/block/test_common.py b/tests/core/block/test_common.py index cfdd3582..20260873 100644 --- a/tests/core/block/test_common.py +++ b/tests/core/block/test_common.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random import pytest diff --git a/tests/core/block/test_cpu_gpu_block_allocator.py b/tests/core/block/test_cpu_gpu_block_allocator.py index a9e38d40..a1414edd 100644 --- a/tests/core/block/test_cpu_gpu_block_allocator.py +++ b/tests/core/block/test_cpu_gpu_block_allocator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.core.block.cpu_gpu_block_allocator import CpuGpuBlockAllocator diff --git a/tests/core/block/test_naive_block.py b/tests/core/block/test_naive_block.py index 10d5964d..0ca2a0b8 100644 --- a/tests/core/block/test_naive_block.py +++ b/tests/core/block/test_naive_block.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional import pytest diff --git a/tests/core/block/test_prefix_caching_block.py b/tests/core/block/test_prefix_caching_block.py index 6642174c..771627a5 100644 --- a/tests/core/block/test_prefix_caching_block.py +++ b/tests/core/block/test_prefix_caching_block.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math import random from typing import List, Optional diff --git a/tests/core/test_chunked_prefill_scheduler.py b/tests/core/test_chunked_prefill_scheduler.py index eaaf004d..8da25aea 100644 --- a/tests/core/test_chunked_prefill_scheduler.py +++ b/tests/core/test_chunked_prefill_scheduler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List from unittest.mock import MagicMock diff --git a/tests/core/test_num_computed_tokens_update.py b/tests/core/test_num_computed_tokens_update.py index bd4accab..a4a90144 100644 --- a/tests/core/test_num_computed_tokens_update.py +++ b/tests/core/test_num_computed_tokens_update.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from tests.conftest import VllmRunner diff --git a/tests/core/test_scheduler.py b/tests/core/test_scheduler.py index 8f6de84e..dcc97eba 100644 --- a/tests/core/test_scheduler.py +++ b/tests/core/test_scheduler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from collections import deque from typing import List, Set, Tuple diff --git a/tests/core/test_scheduler_encoder_decoder.py b/tests/core/test_scheduler_encoder_decoder.py index 16bea549..a4e3c73a 100644 --- a/tests/core/test_scheduler_encoder_decoder.py +++ b/tests/core/test_scheduler_encoder_decoder.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest # noqa diff --git a/tests/core/test_serialization.py b/tests/core/test_serialization.py index d604e525..64b3e148 100644 --- a/tests/core/test_serialization.py +++ b/tests/core/test_serialization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import msgspec from vllm.executor.msgspec_utils import decode_hook, encode_hook diff --git a/tests/core/utils.py b/tests/core/utils.py index 16703cd1..fb77dccc 100644 --- a/tests/core/utils.py +++ b/tests/core/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from collections import defaultdict from typing import Any, Dict, List, Optional diff --git a/tests/distributed/test_ca_buffer_sharing.py b/tests/distributed/test_ca_buffer_sharing.py index fc4043cd..72e7ebdb 100644 --- a/tests/distributed/test_ca_buffer_sharing.py +++ b/tests/distributed/test_ca_buffer_sharing.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # can only run on machines with p2p access across GPUs # can only run with torchrun: # torchrun --nproc_per_node=2 tests/distributed/test_ca_buffer_sharing.py diff --git a/tests/distributed/test_comm_ops.py b/tests/distributed/test_comm_ops.py index d01f1875..bc916e8d 100644 --- a/tests/distributed/test_comm_ops.py +++ b/tests/distributed/test_comm_ops.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test the communication operators. Run `pytest tests/distributed/test_comm_ops.py`. diff --git a/tests/distributed/test_custom_all_reduce.py b/tests/distributed/test_custom_all_reduce.py index 4072616f..46887bca 100644 --- a/tests/distributed/test_custom_all_reduce.py +++ b/tests/distributed/test_custom_all_reduce.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import random diff --git a/tests/distributed/test_distributed_oot.py b/tests/distributed/test_distributed_oot.py index 62e77a2f..4b0c65d1 100644 --- a/tests/distributed/test_distributed_oot.py +++ b/tests/distributed/test_distributed_oot.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from ..entrypoints.openai.test_oot_registration import ( run_and_test_dummy_opt_api_server) diff --git a/tests/distributed/test_multi_node_assignment.py b/tests/distributed/test_multi_node_assignment.py index 9f9c0ff0..c86d2d8a 100644 --- a/tests/distributed/test_multi_node_assignment.py +++ b/tests/distributed/test_multi_node_assignment.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Make sure ray assigns GPU workers to the correct node. Run: diff --git a/tests/distributed/test_pipeline_parallel.py b/tests/distributed/test_pipeline_parallel.py index ddbf40f0..5b6741d7 100644 --- a/tests/distributed/test_pipeline_parallel.py +++ b/tests/distributed/test_pipeline_parallel.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ WARNING: This test runs in both single-node (4 GPUs) and multi-node (2 node with 2 GPUs each) modes. If the test only uses 2 GPUs, it is diff --git a/tests/distributed/test_pipeline_partition.py b/tests/distributed/test_pipeline_partition.py index 2d4d07dd..3ed10482 100644 --- a/tests/distributed/test_pipeline_partition.py +++ b/tests/distributed/test_pipeline_partition.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pytest diff --git a/tests/distributed/test_pp_cudagraph.py b/tests/distributed/test_pp_cudagraph.py index 4912858d..3bc85b05 100644 --- a/tests/distributed/test_pp_cudagraph.py +++ b/tests/distributed/test_pp_cudagraph.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pytest diff --git a/tests/distributed/test_pynccl.py b/tests/distributed/test_pynccl.py index a8571a11..4c42a0ed 100644 --- a/tests/distributed/test_pynccl.py +++ b/tests/distributed/test_pynccl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import multiprocessing import os from typing import Dict, List diff --git a/tests/distributed/test_same_node.py b/tests/distributed/test_same_node.py index 62311a62..9b1bbd6e 100644 --- a/tests/distributed/test_same_node.py +++ b/tests/distributed/test_same_node.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import torch.distributed as dist diff --git a/tests/distributed/test_shm_broadcast.py b/tests/distributed/test_shm_broadcast.py index 72387268..59fa7cc9 100644 --- a/tests/distributed/test_shm_broadcast.py +++ b/tests/distributed/test_shm_broadcast.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import multiprocessing import random import time diff --git a/tests/distributed/test_torchrun_example.py b/tests/distributed/test_torchrun_example.py index 7aa03d7f..a092a548 100644 --- a/tests/distributed/test_torchrun_example.py +++ b/tests/distributed/test_torchrun_example.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # unit test for `examples/offline_inference/torchrun_example.py` import random diff --git a/tests/distributed/test_utils.py b/tests/distributed/test_utils.py index 5fb1ae7b..4432950f 100644 --- a/tests/distributed/test_utils.py +++ b/tests/distributed/test_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import socket import pytest diff --git a/tests/encoder_decoder/test_e2e_correctness.py b/tests/encoder_decoder/test_e2e_correctness.py index fa5d6a69..d0e4f862 100644 --- a/tests/encoder_decoder/test_e2e_correctness.py +++ b/tests/encoder_decoder/test_e2e_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """E2E tests to verify the correctness of the encoder-decoder framework Run `pytest tests/encoder_decoder/test_e2e_correctness.py`. diff --git a/tests/engine/output_processor/test_multi_step.py b/tests/engine/output_processor/test_multi_step.py index 88f3fad4..3ba3c4ec 100644 --- a/tests/engine/output_processor/test_multi_step.py +++ b/tests/engine/output_processor/test_multi_step.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from unittest.mock import MagicMock diff --git a/tests/engine/output_processor/test_stop_checker.py b/tests/engine/output_processor/test_stop_checker.py index cc14e8cb..e9ad8d16 100644 --- a/tests/engine/output_processor/test_stop_checker.py +++ b/tests/engine/output_processor/test_stop_checker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from unittest.mock import MagicMock import pytest diff --git a/tests/engine/test_arg_utils.py b/tests/engine/test_arg_utils.py index 4e269de9..8698d124 100644 --- a/tests/engine/test_arg_utils.py +++ b/tests/engine/test_arg_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from argparse import ArgumentTypeError import pytest diff --git a/tests/engine/test_computed_prefix_blocks.py b/tests/engine/test_computed_prefix_blocks.py index ed35212c..dca8fa60 100644 --- a/tests/engine/test_computed_prefix_blocks.py +++ b/tests/engine/test_computed_prefix_blocks.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.engine.arg_utils import EngineArgs diff --git a/tests/engine/test_custom_executor.py b/tests/engine/test_custom_executor.py index 0e33f366..3e77faec 100644 --- a/tests/engine/test_custom_executor.py +++ b/tests/engine/test_custom_executor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os from typing import Any, Callable, Dict, List, Optional, Tuple, Union diff --git a/tests/engine/test_detokenization.py b/tests/engine/test_detokenization.py index f77f6d07..742176ea 100644 --- a/tests/engine/test_detokenization.py +++ b/tests/engine/test_detokenization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.entrypoints.llm import LLM diff --git a/tests/engine/test_multiproc_workers.py b/tests/engine/test_multiproc_workers.py index 04505fca..f1fe58e3 100644 --- a/tests/engine/test_multiproc_workers.py +++ b/tests/engine/test_multiproc_workers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from concurrent.futures import ThreadPoolExecutor from functools import partial diff --git a/tests/engine/test_short_mm_context.py b/tests/engine/test_short_mm_context.py index a6ba7a13..d5111e3f 100644 --- a/tests/engine/test_short_mm_context.py +++ b/tests/engine/test_short_mm_context.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from ..conftest import IMAGE_ASSETS diff --git a/tests/engine/test_skip_tokenizer_init.py b/tests/engine/test_skip_tokenizer_init.py index b8818af5..655c8232 100644 --- a/tests/engine/test_skip_tokenizer_init.py +++ b/tests/engine/test_skip_tokenizer_init.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.entrypoints.llm import LLM diff --git a/tests/engine/test_stop_reason.py b/tests/engine/test_stop_reason.py index b0bd6c4a..a50b3880 100644 --- a/tests/engine/test_stop_reason.py +++ b/tests/engine/test_stop_reason.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test the different finish_reason="stop" situations during generation: 1. One of the provided stop strings 2. One of the provided stop tokens diff --git a/tests/engine/test_stop_strings.py b/tests/engine/test_stop_strings.py index 49993562..0f633bb2 100644 --- a/tests/engine/test_stop_strings.py +++ b/tests/engine/test_stop_strings.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, List, Optional import pytest diff --git a/tests/entrypoints/conftest.py b/tests/entrypoints/conftest.py index ef74062c..b00e168d 100644 --- a/tests/entrypoints/conftest.py +++ b/tests/entrypoints/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest diff --git a/tests/entrypoints/llm/test_accuracy.py b/tests/entrypoints/llm/test_accuracy.py index 6bf7190a..29ff00df 100644 --- a/tests/entrypoints/llm/test_accuracy.py +++ b/tests/entrypoints/llm/test_accuracy.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This file test accuracy of the vLLM server via LMEval. It uses local-completions, which interacts with vLLM diff --git a/tests/entrypoints/llm/test_chat.py b/tests/entrypoints/llm/test_chat.py index fc66386f..77c80b2f 100644 --- a/tests/entrypoints/llm/test_chat.py +++ b/tests/entrypoints/llm/test_chat.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/entrypoints/llm/test_collective_rpc.py b/tests/entrypoints/llm/test_collective_rpc.py index 22473ce2..39d4810d 100644 --- a/tests/entrypoints/llm/test_collective_rpc.py +++ b/tests/entrypoints/llm/test_collective_rpc.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm import LLM diff --git a/tests/entrypoints/llm/test_encode.py b/tests/entrypoints/llm/test_encode.py index 3906ad76..ebec8bab 100644 --- a/tests/entrypoints/llm/test_encode.py +++ b/tests/entrypoints/llm/test_encode.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import weakref from typing import List diff --git a/tests/entrypoints/llm/test_generate.py b/tests/entrypoints/llm/test_generate.py index 7d2b3777..4c78c2c8 100644 --- a/tests/entrypoints/llm/test_generate.py +++ b/tests/entrypoints/llm/test_generate.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import weakref from typing import List diff --git a/tests/entrypoints/llm/test_generate_multiple_loras.py b/tests/entrypoints/llm/test_generate_multiple_loras.py index eb211369..90e1d581 100644 --- a/tests/entrypoints/llm/test_generate_multiple_loras.py +++ b/tests/entrypoints/llm/test_generate_multiple_loras.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import weakref import pytest diff --git a/tests/entrypoints/llm/test_gpu_utilization.py b/tests/entrypoints/llm/test_gpu_utilization.py index c2dab300..c2b4a935 100644 --- a/tests/entrypoints/llm/test_gpu_utilization.py +++ b/tests/entrypoints/llm/test_gpu_utilization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams diff --git a/tests/entrypoints/llm/test_guided_generate.py b/tests/entrypoints/llm/test_guided_generate.py index ccb9906f..932a35a9 100644 --- a/tests/entrypoints/llm/test_guided_generate.py +++ b/tests/entrypoints/llm/test_guided_generate.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import re import weakref diff --git a/tests/entrypoints/llm/test_init.py b/tests/entrypoints/llm/test_init.py index c9a4ad44..925bf56a 100644 --- a/tests/entrypoints/llm/test_init.py +++ b/tests/entrypoints/llm/test_init.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm import LLM diff --git a/tests/entrypoints/llm/test_lazy_outlines.py b/tests/entrypoints/llm/test_lazy_outlines.py index bf609b38..b1f9ae14 100644 --- a/tests/entrypoints/llm/test_lazy_outlines.py +++ b/tests/entrypoints/llm/test_lazy_outlines.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import sys from contextlib import nullcontext diff --git a/tests/entrypoints/llm/test_prompt_validation.py b/tests/entrypoints/llm/test_prompt_validation.py index ee7010a2..f2c145fa 100644 --- a/tests/entrypoints/llm/test_prompt_validation.py +++ b/tests/entrypoints/llm/test_prompt_validation.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm import LLM diff --git a/tests/entrypoints/offline_mode/test_offline_mode.py b/tests/entrypoints/offline_mode/test_offline_mode.py index 65699e60..eac76f2b 100644 --- a/tests/entrypoints/offline_mode/test_offline_mode.py +++ b/tests/entrypoints/offline_mode/test_offline_mode.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for HF_HUB_OFFLINE mode""" import importlib import sys diff --git a/tests/entrypoints/openai/reasoning_parsers/test_deepseekr1_reasoning_parser.py b/tests/entrypoints/openai/reasoning_parsers/test_deepseekr1_reasoning_parser.py index 4607e4df..f7b81be4 100644 --- a/tests/entrypoints/openai/reasoning_parsers/test_deepseekr1_reasoning_parser.py +++ b/tests/entrypoints/openai/reasoning_parsers/test_deepseekr1_reasoning_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/entrypoints/openai/reasoning_parsers/utils.py b/tests/entrypoints/openai/reasoning_parsers/utils.py index ac73ad50..2157e059 100644 --- a/tests/entrypoints/openai/reasoning_parsers/utils.py +++ b/tests/entrypoints/openai/reasoning_parsers/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple, Union from vllm.entrypoints.openai.protocol import (ChatCompletionRequest, diff --git a/tests/entrypoints/openai/test_accuracy.py b/tests/entrypoints/openai/test_accuracy.py index b1d4461d..df25780c 100644 --- a/tests/entrypoints/openai/test_accuracy.py +++ b/tests/entrypoints/openai/test_accuracy.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This file test accuracy of the vLLM server via LMEval. It uses local-completions, which interacts with vLLM diff --git a/tests/entrypoints/openai/test_async_tokenization.py b/tests/entrypoints/openai/test_async_tokenization.py index fcce8b46..1f7ba0da 100644 --- a/tests/entrypoints/openai/test_async_tokenization.py +++ b/tests/entrypoints/openai/test_async_tokenization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import contextlib import random diff --git a/tests/entrypoints/openai/test_audio.py b/tests/entrypoints/openai/test_audio.py index 1116c0da..6e206dfd 100644 --- a/tests/entrypoints/openai/test_audio.py +++ b/tests/entrypoints/openai/test_audio.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List import openai diff --git a/tests/entrypoints/openai/test_basic.py b/tests/entrypoints/openai/test_basic.py index 547c1fd0..0d44a761 100644 --- a/tests/entrypoints/openai/test_basic.py +++ b/tests/entrypoints/openai/test_basic.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from http import HTTPStatus from typing import List diff --git a/tests/entrypoints/openai/test_chat.py b/tests/entrypoints/openai/test_chat.py index 5e6499d8..4b5ad55c 100644 --- a/tests/entrypoints/openai/test_chat.py +++ b/tests/entrypoints/openai/test_chat.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # imports for guided decoding tests import json import re diff --git a/tests/entrypoints/openai/test_chat_echo.py b/tests/entrypoints/openai/test_chat_echo.py index 223ac5b4..3e76158a 100644 --- a/tests/entrypoints/openai/test_chat_echo.py +++ b/tests/entrypoints/openai/test_chat_echo.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import NamedTuple import openai # use the official client for correctness check diff --git a/tests/entrypoints/openai/test_chat_template.py b/tests/entrypoints/openai/test_chat_template.py index e1e1dcff..255aba13 100644 --- a/tests/entrypoints/openai/test_chat_template.py +++ b/tests/entrypoints/openai/test_chat_template.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.entrypoints.chat_utils import (apply_hf_chat_template, diff --git a/tests/entrypoints/openai/test_chunked_prompt.py b/tests/entrypoints/openai/test_chunked_prompt.py index 61d66365..0419395f 100644 --- a/tests/entrypoints/openai/test_chunked_prompt.py +++ b/tests/entrypoints/openai/test_chunked_prompt.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import openai # use the official client for correctness check import pytest import pytest_asyncio diff --git a/tests/entrypoints/openai/test_cli_args.py b/tests/entrypoints/openai/test_cli_args.py index 01bcd78a..2f065ec1 100644 --- a/tests/entrypoints/openai/test_cli_args.py +++ b/tests/entrypoints/openai/test_cli_args.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import pytest diff --git a/tests/entrypoints/openai/test_completion.py b/tests/entrypoints/openai/test_completion.py index 183d900c..28671cc2 100644 --- a/tests/entrypoints/openai/test_completion.py +++ b/tests/entrypoints/openai/test_completion.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # imports for guided decoding tests import json import re diff --git a/tests/entrypoints/openai/test_embedding.py b/tests/entrypoints/openai/test_embedding.py index b52a5b28..e86ea87d 100644 --- a/tests/entrypoints/openai/test_embedding.py +++ b/tests/entrypoints/openai/test_embedding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import base64 import numpy as np diff --git a/tests/entrypoints/openai/test_encoder_decoder.py b/tests/entrypoints/openai/test_encoder_decoder.py index 51eba694..52b4df9c 100644 --- a/tests/entrypoints/openai/test_encoder_decoder.py +++ b/tests/entrypoints/openai/test_encoder_decoder.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import openai import pytest import pytest_asyncio diff --git a/tests/entrypoints/openai/test_lora_adapters.py b/tests/entrypoints/openai/test_lora_adapters.py index 6ff99f6f..1a62157a 100644 --- a/tests/entrypoints/openai/test_lora_adapters.py +++ b/tests/entrypoints/openai/test_lora_adapters.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import json import shutil diff --git a/tests/entrypoints/openai/test_metrics.py b/tests/entrypoints/openai/test_metrics.py index 941f4657..a9134be6 100644 --- a/tests/entrypoints/openai/test_metrics.py +++ b/tests/entrypoints/openai/test_metrics.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import subprocess import sys import tempfile diff --git a/tests/entrypoints/openai/test_models.py b/tests/entrypoints/openai/test_models.py index ae5bf404..3d4f1cde 100644 --- a/tests/entrypoints/openai/test_models.py +++ b/tests/entrypoints/openai/test_models.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import openai # use the official client for correctness check import pytest import pytest_asyncio diff --git a/tests/entrypoints/openai/test_oot_registration.py b/tests/entrypoints/openai/test_oot_registration.py index b25cb1d0..a1b7a205 100644 --- a/tests/entrypoints/openai/test_oot_registration.py +++ b/tests/entrypoints/openai/test_oot_registration.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from ...utils import VLLM_PATH, RemoteOpenAIServer chatml_jinja_path = VLLM_PATH / "examples/template_chatml.jinja" diff --git a/tests/entrypoints/openai/test_pooling.py b/tests/entrypoints/openai/test_pooling.py index 9c492393..11d3bfaf 100644 --- a/tests/entrypoints/openai/test_pooling.py +++ b/tests/entrypoints/openai/test_pooling.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import base64 import numpy as np diff --git a/tests/entrypoints/openai/test_prompt_validation.py b/tests/entrypoints/openai/test_prompt_validation.py index 1ae64ef4..64a1eb6a 100644 --- a/tests/entrypoints/openai/test_prompt_validation.py +++ b/tests/entrypoints/openai/test_prompt_validation.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # imports for guided decoding tests import re diff --git a/tests/entrypoints/openai/test_rerank.py b/tests/entrypoints/openai/test_rerank.py index cfd8f331..4c9774a7 100644 --- a/tests/entrypoints/openai/test_rerank.py +++ b/tests/entrypoints/openai/test_rerank.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import requests diff --git a/tests/entrypoints/openai/test_return_tokens_as_ids.py b/tests/entrypoints/openai/test_return_tokens_as_ids.py index 99f6da16..9b33edda 100644 --- a/tests/entrypoints/openai/test_return_tokens_as_ids.py +++ b/tests/entrypoints/openai/test_return_tokens_as_ids.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Separate these tests out from test_completion and test_chat, because they # require launching a second server with a different flag. Running both servers # at the same time on a single node will OOM. diff --git a/tests/entrypoints/openai/test_root_path.py b/tests/entrypoints/openai/test_root_path.py index 20f79606..ad8159af 100644 --- a/tests/entrypoints/openai/test_root_path.py +++ b/tests/entrypoints/openai/test_root_path.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import contextlib import os from typing import Any, List, NamedTuple diff --git a/tests/entrypoints/openai/test_run_batch.py b/tests/entrypoints/openai/test_run_batch.py index 1f8a56bb..db049ee2 100644 --- a/tests/entrypoints/openai/test_run_batch.py +++ b/tests/entrypoints/openai/test_run_batch.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import subprocess import sys diff --git a/tests/entrypoints/openai/test_score.py b/tests/entrypoints/openai/test_score.py index 0d19615b..bcbcb570 100644 --- a/tests/entrypoints/openai/test_score.py +++ b/tests/entrypoints/openai/test_score.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import requests diff --git a/tests/entrypoints/openai/test_serving_chat.py b/tests/entrypoints/openai/test_serving_chat.py index e88d6c3c..1e7dbaf6 100644 --- a/tests/entrypoints/openai/test_serving_chat.py +++ b/tests/entrypoints/openai/test_serving_chat.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from contextlib import suppress from dataclasses import dataclass diff --git a/tests/entrypoints/openai/test_serving_models.py b/tests/entrypoints/openai/test_serving_models.py index 657ea202..70ca8507 100644 --- a/tests/entrypoints/openai/test_serving_models.py +++ b/tests/entrypoints/openai/test_serving_models.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from http import HTTPStatus from unittest.mock import MagicMock diff --git a/tests/entrypoints/openai/test_shutdown.py b/tests/entrypoints/openai/test_shutdown.py index 090523a8..5edf85ab 100644 --- a/tests/entrypoints/openai/test_shutdown.py +++ b/tests/entrypoints/openai/test_shutdown.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import openai import pytest diff --git a/tests/entrypoints/openai/test_tokenization.py b/tests/entrypoints/openai/test_tokenization.py index b1956a8c..663b7224 100644 --- a/tests/entrypoints/openai/test_tokenization.py +++ b/tests/entrypoints/openai/test_tokenization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import pytest_asyncio import requests diff --git a/tests/entrypoints/openai/test_video.py b/tests/entrypoints/openai/test_video.py index e73449e4..ab928540 100644 --- a/tests/entrypoints/openai/test_video.py +++ b/tests/entrypoints/openai/test_video.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List import openai diff --git a/tests/entrypoints/openai/test_vision.py b/tests/entrypoints/openai/test_vision.py index 5f070ba3..029c9b03 100644 --- a/tests/entrypoints/openai/test_vision.py +++ b/tests/entrypoints/openai/test_vision.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List import openai diff --git a/tests/entrypoints/openai/test_vision_embedding.py b/tests/entrypoints/openai/test_vision_embedding.py index c851539c..f2ff4a0b 100644 --- a/tests/entrypoints/openai/test_vision_embedding.py +++ b/tests/entrypoints/openai/test_vision_embedding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict import pytest diff --git a/tests/entrypoints/openai/tool_parsers/test_pythonic_tool_parser.py b/tests/entrypoints/openai/tool_parsers/test_pythonic_tool_parser.py index 47b0b6bb..788efa86 100644 --- a/tests/entrypoints/openai/tool_parsers/test_pythonic_tool_parser.py +++ b/tests/entrypoints/openai/tool_parsers/test_pythonic_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List from unittest.mock import MagicMock diff --git a/tests/entrypoints/openai/tool_parsers/utils.py b/tests/entrypoints/openai/tool_parsers/utils.py index f0a2a32c..57ec9865 100644 --- a/tests/entrypoints/openai/tool_parsers/utils.py +++ b/tests/entrypoints/openai/tool_parsers/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Iterable, List, Tuple, Union from vllm.entrypoints.openai.protocol import (ChatCompletionRequest, diff --git a/tests/entrypoints/test_chat_utils.py b/tests/entrypoints/test_chat_utils.py index 513b466c..737f7330 100644 --- a/tests/entrypoints/test_chat_utils.py +++ b/tests/entrypoints/test_chat_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import warnings from typing import Optional diff --git a/tests/kernels/allclose_default.py b/tests/kernels/allclose_default.py index 175cfe82..97ceffab 100644 --- a/tests/kernels/allclose_default.py +++ b/tests/kernels/allclose_default.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch # Reference default values of atol and rtol are from diff --git a/tests/kernels/conftest.py b/tests/kernels/conftest.py index 4f2f9cc3..4f04ec94 100644 --- a/tests/kernels/conftest.py +++ b/tests/kernels/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.utils import (create_kv_caches_with_random, diff --git a/tests/kernels/quant_utils.py b/tests/kernels/quant_utils.py index f2358940..34dcf91c 100644 --- a/tests/kernels/quant_utils.py +++ b/tests/kernels/quant_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple, Union import torch diff --git a/tests/kernels/test_activation.py b/tests/kernels/test_activation.py index dac26efe..2e70b1db 100644 --- a/tests/kernels/test_activation.py +++ b/tests/kernels/test_activation.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import Type diff --git a/tests/kernels/test_aqlm.py b/tests/kernels/test_aqlm.py index 860fb66b..7d361728 100644 --- a/tests/kernels/test_aqlm.py +++ b/tests/kernels/test_aqlm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from tests.kernels.utils import opcheck diff --git a/tests/kernels/test_attention.py b/tests/kernels/test_attention.py index 574a0f22..b667d8d9 100644 --- a/tests/kernels/test_attention.py +++ b/tests/kernels/test_attention.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import List, Optional, Tuple diff --git a/tests/kernels/test_attention_selector.py b/tests/kernels/test_attention_selector.py index 492acb91..0e874373 100644 --- a/tests/kernels/test_attention_selector.py +++ b/tests/kernels/test_attention_selector.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from unittest.mock import Mock, patch import pytest diff --git a/tests/kernels/test_awq.py b/tests/kernels/test_awq.py index aa7a4308..ace75a33 100644 --- a/tests/kernels/test_awq.py +++ b/tests/kernels/test_awq.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pytest diff --git a/tests/kernels/test_awq_marlin.py b/tests/kernels/test_awq_marlin.py index 238d6426..67595010 100644 --- a/tests/kernels/test_awq_marlin.py +++ b/tests/kernels/test_awq_marlin.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test AWQ with fused MoE Marlin kernels. Run `pytest tests/kernels/test_awq_marlin.py`. diff --git a/tests/kernels/test_awq_triton.py b/tests/kernels/test_awq_triton.py index 406a0c8d..3fc3feaf 100644 --- a/tests/kernels/test_awq_triton.py +++ b/tests/kernels/test_awq_triton.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for the AWQ Triton kernel. Run `pytest tests/kernels/test_awq_triton.py`. diff --git a/tests/kernels/test_block_fp8.py b/tests/kernels/test_block_fp8.py index f28fdf3f..20eff1c2 100644 --- a/tests/kernels/test_block_fp8.py +++ b/tests/kernels/test_block_fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from https://github.com/sgl-project/sglang/pull/2575 import itertools diff --git a/tests/kernels/test_blocksparse_attention.py b/tests/kernels/test_blocksparse_attention.py index 08f31219..e653d34d 100644 --- a/tests/kernels/test_blocksparse_attention.py +++ b/tests/kernels/test_blocksparse_attention.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import List, Optional, Tuple diff --git a/tests/kernels/test_cache.py b/tests/kernels/test_cache.py index c848be4f..6f909b68 100644 --- a/tests/kernels/test_cache.py +++ b/tests/kernels/test_cache.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import List, Tuple diff --git a/tests/kernels/test_cascade_flash_attn.py b/tests/kernels/test_cascade_flash_attn.py index 8edfde42..8cc1a6a1 100755 --- a/tests/kernels/test_cascade_flash_attn.py +++ b/tests/kernels/test_cascade_flash_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple import pytest diff --git a/tests/kernels/test_causal_conv1d.py b/tests/kernels/test_causal_conv1d.py index 51be2425..93064e23 100644 --- a/tests/kernels/test_causal_conv1d.py +++ b/tests/kernels/test_causal_conv1d.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional import pytest diff --git a/tests/kernels/test_cutlass.py b/tests/kernels/test_cutlass.py index f538d492..49fd8ed6 100644 --- a/tests/kernels/test_cutlass.py +++ b/tests/kernels/test_cutlass.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for cutlass kernels Run `pytest tests/kernels/test_cutlass.py`. diff --git a/tests/kernels/test_cutlass_2of4_sparse.py b/tests/kernels/test_cutlass_2of4_sparse.py index 56495df3..4c613b75 100644 --- a/tests/kernels/test_cutlass_2of4_sparse.py +++ b/tests/kernels/test_cutlass_2of4_sparse.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for sparse cutlass kernels Run `pytest tests/kernels/test_semi_structured.py`. diff --git a/tests/kernels/test_encoder_decoder_attn.py b/tests/kernels/test_encoder_decoder_attn.py index e008a56d..0d11e865 100644 --- a/tests/kernels/test_encoder_decoder_attn.py +++ b/tests/kernels/test_encoder_decoder_attn.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Tests: diff --git a/tests/kernels/test_flash_attn.py b/tests/kernels/test_flash_attn.py index 0ee0bf6c..b8af89b6 100644 --- a/tests/kernels/test_flash_attn.py +++ b/tests/kernels/test_flash_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple import pytest diff --git a/tests/kernels/test_flashinfer.py b/tests/kernels/test_flashinfer.py index 1645ef91..212ceb5e 100644 --- a/tests/kernels/test_flashinfer.py +++ b/tests/kernels/test_flashinfer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple import flashinfer diff --git a/tests/kernels/test_fp8_quant.py b/tests/kernels/test_fp8_quant.py index ebaaae23..876cf03f 100644 --- a/tests/kernels/test_fp8_quant.py +++ b/tests/kernels/test_fp8_quant.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/kernels/test_fused_quant_layernorm.py b/tests/kernels/test_fused_quant_layernorm.py index baf8d73f..d4b674b2 100644 --- a/tests/kernels/test_fused_quant_layernorm.py +++ b/tests/kernels/test_fused_quant_layernorm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple, Union import pytest diff --git a/tests/kernels/test_ggml.py b/tests/kernels/test_ggml.py index dddb285b..dc728fd4 100644 --- a/tests/kernels/test_ggml.py +++ b/tests/kernels/test_ggml.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import gguf import pytest import torch diff --git a/tests/kernels/test_gguf.py b/tests/kernels/test_gguf.py index 893af99b..847ca9f4 100644 --- a/tests/kernels/test_gguf.py +++ b/tests/kernels/test_gguf.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import List diff --git a/tests/kernels/test_gptq.py b/tests/kernels/test_gptq.py index c1ca6f1f..fea013d9 100644 --- a/tests/kernels/test_gptq.py +++ b/tests/kernels/test_gptq.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from tests.kernels.utils import opcheck diff --git a/tests/kernels/test_int8_quant.py b/tests/kernels/test_int8_quant.py index 761eb95c..25dcb587 100644 --- a/tests/kernels/test_int8_quant.py +++ b/tests/kernels/test_int8_quant.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/kernels/test_layernorm.py b/tests/kernels/test_layernorm.py index 727769e0..fa4bbe45 100644 --- a/tests/kernels/test_layernorm.py +++ b/tests/kernels/test_layernorm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/kernels/test_machete_mm.py b/tests/kernels/test_machete_mm.py index 1c6eb2dd..bd60526e 100644 --- a/tests/kernels/test_machete_mm.py +++ b/tests/kernels/test_machete_mm.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for the machete kernel. Run `pytest tests/kernels/test_machete_mm.py`. diff --git a/tests/kernels/test_mamba_ssm.py b/tests/kernels/test_mamba_ssm.py index 19d1158c..84d4c347 100644 --- a/tests/kernels/test_mamba_ssm.py +++ b/tests/kernels/test_mamba_ssm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch import torch.nn.functional as F diff --git a/tests/kernels/test_marlin_gemm.py b/tests/kernels/test_marlin_gemm.py index 5e047f4b..b96aca06 100644 --- a/tests/kernels/test_marlin_gemm.py +++ b/tests/kernels/test_marlin_gemm.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for the marlin kernel. Run `pytest tests/kernels/marlin/test_marlin_gemm.py`. diff --git a/tests/kernels/test_mha_attn.py b/tests/kernels/test_mha_attn.py index eab874e9..5a18b791 100644 --- a/tests/kernels/test_mha_attn.py +++ b/tests/kernels/test_mha_attn.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Test: diff --git a/tests/kernels/test_moe.py b/tests/kernels/test_moe.py index 7aa248ed..0f13fbc9 100644 --- a/tests/kernels/test_moe.py +++ b/tests/kernels/test_moe.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for the MOE layers. Run `pytest tests/kernels/test_moe.py`. diff --git a/tests/kernels/test_permute_cols.py b/tests/kernels/test_permute_cols.py index 14ad7a22..35d62079 100644 --- a/tests/kernels/test_permute_cols.py +++ b/tests/kernels/test_permute_cols.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/kernels/test_pos_encoding.py b/tests/kernels/test_pos_encoding.py index eee77c22..5b7b0fda 100644 --- a/tests/kernels/test_pos_encoding.py +++ b/tests/kernels/test_pos_encoding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from itertools import accumulate, product from typing import Dict, List, Optional diff --git a/tests/kernels/test_prefix_prefill.py b/tests/kernels/test_prefix_prefill.py index 10e73ab9..2184c985 100644 --- a/tests/kernels/test_prefix_prefill.py +++ b/tests/kernels/test_prefix_prefill.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math import random import time diff --git a/tests/kernels/test_rotary_embedding.py b/tests/kernels/test_rotary_embedding.py index da879406..362bcb35 100644 --- a/tests/kernels/test_rotary_embedding.py +++ b/tests/kernels/test_rotary_embedding.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Tests for miscellaneous utilities """ diff --git a/tests/kernels/test_triton_decode_attention.py b/tests/kernels/test_triton_decode_attention.py index 14f5a3b7..fd3c9fa4 100644 --- a/tests/kernels/test_triton_decode_attention.py +++ b/tests/kernels/test_triton_decode_attention.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/kernels/test_triton_scaled_mm.py b/tests/kernels/test_triton_scaled_mm.py index a5aab3c2..d878ed6f 100644 --- a/tests/kernels/test_triton_scaled_mm.py +++ b/tests/kernels/test_triton_scaled_mm.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for the triton_scaled_mm kernel Run `pytest tests/kernels/test_triton_scaled_mm.py`. diff --git a/tests/kernels/test_utils.py b/tests/kernels/test_utils.py index 7e5126a7..d3f03200 100644 --- a/tests/kernels/test_utils.py +++ b/tests/kernels/test_utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Tests for miscellaneous utilities """ diff --git a/tests/kernels/utils.py b/tests/kernels/utils.py index c735c5ed..5be111d7 100644 --- a/tests/kernels/utils.py +++ b/tests/kernels/utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Kernel test utils""" import itertools diff --git a/tests/kv_transfer/disagg_test.py b/tests/kv_transfer/disagg_test.py index adc6150e..97e0d6eb 100644 --- a/tests/kv_transfer/disagg_test.py +++ b/tests/kv_transfer/disagg_test.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import subprocess import sys diff --git a/tests/kv_transfer/module_test.py b/tests/kv_transfer/module_test.py index 35546191..8a6490b5 100644 --- a/tests/kv_transfer/module_test.py +++ b/tests/kv_transfer/module_test.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import subprocess import sys diff --git a/tests/kv_transfer/test_lookup_buffer.py b/tests/kv_transfer/test_lookup_buffer.py index 4d689030..c5b34660 100644 --- a/tests/kv_transfer/test_lookup_buffer.py +++ b/tests/kv_transfer/test_lookup_buffer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import random diff --git a/tests/kv_transfer/test_send_recv.py b/tests/kv_transfer/test_send_recv.py index 1cc1ced9..181a5ac2 100644 --- a/tests/kv_transfer/test_send_recv.py +++ b/tests/kv_transfer/test_send_recv.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import time from typing import List diff --git a/tests/lora/conftest.py b/tests/lora/conftest.py index e7378d00..071cdbec 100644 --- a/tests/lora/conftest.py +++ b/tests/lora/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import tempfile from collections import OrderedDict from typing import Dict, List, TypedDict diff --git a/tests/lora/data/long_context_test_data.py b/tests/lora/data/long_context_test_data.py index 61b8899f..2d33f738 100644 --- a/tests/lora/data/long_context_test_data.py +++ b/tests/lora/data/long_context_test_data.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # ruff: noqa """This file contains a dictionary of prompts and golden responses.""" diff --git a/tests/lora/test_baichuan.py b/tests/lora/test_baichuan.py index 0ba2ce36..249f7619 100644 --- a/tests/lora/test_baichuan.py +++ b/tests/lora/test_baichuan.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_chatglm3_tp.py b/tests/lora/test_chatglm3_tp.py index 49a527b9..0aa9fe7a 100644 --- a/tests/lora/test_chatglm3_tp.py +++ b/tests/lora/test_chatglm3_tp.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import vllm diff --git a/tests/lora/test_gemma.py b/tests/lora/test_gemma.py index 5ae705e4..8923aa22 100644 --- a/tests/lora/test_gemma.py +++ b/tests/lora/test_gemma.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_jamba.py b/tests/lora/test_jamba.py index 6aa33926..c0417466 100644 --- a/tests/lora/test_jamba.py +++ b/tests/lora/test_jamba.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_layers.py b/tests/lora/test_layers.py index 08a589d7..0838ca02 100644 --- a/tests/lora/test_layers.py +++ b/tests/lora/test_layers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from copy import deepcopy from dataclasses import dataclass diff --git a/tests/lora/test_llama_tp.py b/tests/lora/test_llama_tp.py index dfeac380..39f779f4 100644 --- a/tests/lora/test_llama_tp.py +++ b/tests/lora/test_llama_tp.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import ray diff --git a/tests/lora/test_long_context.py b/tests/lora/test_long_context.py index e7a34f2c..62005de7 100644 --- a/tests/lora/test_long_context.py +++ b/tests/lora/test_long_context.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import ast from typing import List, Optional, Tuple diff --git a/tests/lora/test_lora_bias_e2e.py b/tests/lora/test_lora_bias_e2e.py index c2520c84..cbdd6883 100644 --- a/tests/lora/test_lora_bias_e2e.py +++ b/tests/lora/test_lora_bias_e2e.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_lora_checkpoints.py b/tests/lora/test_lora_checkpoints.py index b907af47..d2a4b901 100644 --- a/tests/lora/test_lora_checkpoints.py +++ b/tests/lora/test_lora_checkpoints.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_lora_huggingface.py b/tests/lora/test_lora_huggingface.py index 1c0ee01c..273fe9ae 100644 --- a/tests/lora/test_lora_huggingface.py +++ b/tests/lora/test_lora_huggingface.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_lora_manager.py b/tests/lora/test_lora_manager.py index 9a5b9aab..6666f54f 100644 --- a/tests/lora/test_lora_manager.py +++ b/tests/lora/test_lora_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import Dict, List diff --git a/tests/lora/test_minicpmv_tp.py b/tests/lora/test_minicpmv_tp.py index 3b0f1832..2e81bb32 100644 --- a/tests/lora/test_minicpmv_tp.py +++ b/tests/lora/test_minicpmv_tp.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_mixtral.py b/tests/lora/test_mixtral.py index 940a8652..90cf8fd3 100644 --- a/tests/lora/test_mixtral.py +++ b/tests/lora/test_mixtral.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_peft_helper.py b/tests/lora/test_peft_helper.py index a524d5ce..9935472a 100644 --- a/tests/lora/test_peft_helper.py +++ b/tests/lora/test_peft_helper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import math import shutil diff --git a/tests/lora/test_phi.py b/tests/lora/test_phi.py index 5a3fcb8d..651c89ff 100644 --- a/tests/lora/test_phi.py +++ b/tests/lora/test_phi.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import vllm diff --git a/tests/lora/test_punica_ops_sizes.py b/tests/lora/test_punica_ops_sizes.py index 433ca757..ecd3bc49 100644 --- a/tests/lora/test_punica_ops_sizes.py +++ b/tests/lora/test_punica_ops_sizes.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This script is mainly used to tests various hidden_sizes. We have collected the hidden_sizes included in the LoRA models currently supported by vLLM. It tests diff --git a/tests/lora/test_punica_ops_variation.py b/tests/lora/test_punica_ops_variation.py index 2bb84c1c..6d1d3c94 100644 --- a/tests/lora/test_punica_ops_variation.py +++ b/tests/lora/test_punica_ops_variation.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This script is mainly used to test whether trtion kernels can run normally under different conditions, including various batches, numbers of LoRA , and diff --git a/tests/lora/test_quant_model.py b/tests/lora/test_quant_model.py index 26bf770c..5702aa26 100644 --- a/tests/lora/test_quant_model.py +++ b/tests/lora/test_quant_model.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/fmmoret/vllm/blob/fm-support-lora-on-quantized-models/tests/lora/test_llama.py from dataclasses import dataclass diff --git a/tests/lora/test_qwen2vl.py b/tests/lora/test_qwen2vl.py index 570aa386..a988f06a 100644 --- a/tests/lora/test_qwen2vl.py +++ b/tests/lora/test_qwen2vl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/lora/test_tokenizer_group.py b/tests/lora/test_tokenizer_group.py index d225a3f7..589167e8 100644 --- a/tests/lora/test_tokenizer_group.py +++ b/tests/lora/test_tokenizer_group.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from transformers import AutoTokenizer, PreTrainedTokenizerBase diff --git a/tests/lora/test_utils.py b/tests/lora/test_utils.py index 85110b8f..34a26e9e 100644 --- a/tests/lora/test_utils.py +++ b/tests/lora/test_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import OrderedDict from unittest.mock import patch diff --git a/tests/lora/test_worker.py b/tests/lora/test_worker.py index 9d814f65..797141ea 100644 --- a/tests/lora/test_worker.py +++ b/tests/lora/test_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import random import tempfile diff --git a/tests/lora/utils.py b/tests/lora/utils.py index ce47546f..bda00e08 100644 --- a/tests/lora/utils.py +++ b/tests/lora/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List, Optional import torch diff --git a/tests/metrics/test_metrics.py b/tests/metrics/test_metrics.py index b3c78505..0942c8ee 100644 --- a/tests/metrics/test_metrics.py +++ b/tests/metrics/test_metrics.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from typing import List diff --git a/tests/model_executor/conftest.py b/tests/model_executor/conftest.py index 10792b0a..b588a1a9 100644 --- a/tests/model_executor/conftest.py +++ b/tests/model_executor/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest diff --git a/tests/model_executor/test_enabled_custom_ops.py b/tests/model_executor/test_enabled_custom_ops.py index 0a3aba25..2c678084 100644 --- a/tests/model_executor/test_enabled_custom_ops.py +++ b/tests/model_executor/test_enabled_custom_ops.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/model_executor/test_guided_processors.py b/tests/model_executor/test_guided_processors.py index be5282d9..64d0928f 100644 --- a/tests/model_executor/test_guided_processors.py +++ b/tests/model_executor/test_guided_processors.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pickle import pytest diff --git a/tests/model_executor/test_model_load_with_params.py b/tests/model_executor/test_model_load_with_params.py index 9c1f784c..760a1199 100644 --- a/tests/model_executor/test_model_load_with_params.py +++ b/tests/model_executor/test_model_load_with_params.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pytest diff --git a/tests/model_executor/weight_utils.py b/tests/model_executor/weight_utils.py index c8b9bed6..11dfe4d4 100644 --- a/tests/model_executor/weight_utils.py +++ b/tests/model_executor/weight_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import tempfile diff --git a/tests/models/decoder_only/audio_language/test_ultravox.py b/tests/models/decoder_only/audio_language/test_ultravox.py index 1e329dc4..fe9361d1 100644 --- a/tests/models/decoder_only/audio_language/test_ultravox.py +++ b/tests/models/decoder_only/audio_language/test_ultravox.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple, Type import numpy as np diff --git a/tests/models/decoder_only/language/test_aqlm.py b/tests/models/decoder_only/language/test_aqlm.py index a8cb5bbf..85557b30 100644 --- a/tests/models/decoder_only/language/test_aqlm.py +++ b/tests/models/decoder_only/language/test_aqlm.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of a AQLM model between vLLM and HF Transformers Run `pytest tests/models/test_aqlm.py`. diff --git a/tests/models/decoder_only/language/test_fp8.py b/tests/models/decoder_only/language/test_fp8.py index 5f06f1e3..6a0e148d 100644 --- a/tests/models/decoder_only/language/test_fp8.py +++ b/tests/models/decoder_only/language/test_fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # flake8: noqa """Tests fp8 models against ground truth generation Note: these tests will only pass on L4 GPU. diff --git a/tests/models/decoder_only/language/test_gguf.py b/tests/models/decoder_only/language/test_gguf.py index ad8f8a0c..57fe1d5b 100644 --- a/tests/models/decoder_only/language/test_gguf.py +++ b/tests/models/decoder_only/language/test_gguf.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Tests gguf models against unquantized models generations Note: To pass the test, quantization higher than Q4 should be used diff --git a/tests/models/decoder_only/language/test_gptq_marlin.py b/tests/models/decoder_only/language/test_gptq_marlin.py index 037411a1..0f61466c 100644 --- a/tests/models/decoder_only/language/test_gptq_marlin.py +++ b/tests/models/decoder_only/language/test_gptq_marlin.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compares the outputs of gptq vs gptq_marlin Note: GPTQ and Marlin do not have bitwise correctness. As a result, in this test, we just confirm that the top selected tokens of the diff --git a/tests/models/decoder_only/language/test_gptq_marlin_24.py b/tests/models/decoder_only/language/test_gptq_marlin_24.py index 26cb3ec3..c8162614 100644 --- a/tests/models/decoder_only/language/test_gptq_marlin_24.py +++ b/tests/models/decoder_only/language/test_gptq_marlin_24.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of a GPTQ model to a Marlin_24 model. Note: GPTQ and Marlin_24 do not have bitwise correctness. diff --git a/tests/models/decoder_only/language/test_granite.py b/tests/models/decoder_only/language/test_granite.py index 5e93842f..119b79d6 100644 --- a/tests/models/decoder_only/language/test_granite.py +++ b/tests/models/decoder_only/language/test_granite.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM for Granite models using greedy sampling. Run `pytest tests/models/test_granite.py`. diff --git a/tests/models/decoder_only/language/test_jamba.py b/tests/models/decoder_only/language/test_jamba.py index 2e06b10f..cc98f1d7 100644 --- a/tests/models/decoder_only/language/test_jamba.py +++ b/tests/models/decoder_only/language/test_jamba.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from tests.utils import multi_gpu_test diff --git a/tests/models/decoder_only/language/test_mamba.py b/tests/models/decoder_only/language/test_mamba.py index 1ad4f5aa..854f4fe4 100644 --- a/tests/models/decoder_only/language/test_mamba.py +++ b/tests/models/decoder_only/language/test_mamba.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM when using greedy sampling for Mamba. Run `pytest tests/models/test_mamba.py`. diff --git a/tests/models/decoder_only/language/test_mistral.py b/tests/models/decoder_only/language/test_mistral.py index bdc15717..17923673 100644 --- a/tests/models/decoder_only/language/test_mistral.py +++ b/tests/models/decoder_only/language/test_mistral.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM for Mistral models using greedy sampling. Run `pytest tests/models/test_mistral.py`. diff --git a/tests/models/decoder_only/language/test_modelopt.py b/tests/models/decoder_only/language/test_modelopt.py index 077e50e3..66dd9795 100644 --- a/tests/models/decoder_only/language/test_modelopt.py +++ b/tests/models/decoder_only/language/test_modelopt.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # flake8: noqa """Tests Model Optimizer fp8 models against ground truth generation Note: these tests will only pass on H100 diff --git a/tests/models/decoder_only/language/test_models.py b/tests/models/decoder_only/language/test_models.py index c7efa4ed..1ad56241 100644 --- a/tests/models/decoder_only/language/test_models.py +++ b/tests/models/decoder_only/language/test_models.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM when using greedy sampling. Run `pytest tests/models/test_models.py`. diff --git a/tests/models/decoder_only/language/test_phimoe.py b/tests/models/decoder_only/language/test_phimoe.py index c997359a..f9757d6a 100644 --- a/tests/models/decoder_only/language/test_phimoe.py +++ b/tests/models/decoder_only/language/test_phimoe.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM for moe models using greedy sampling. Run `pytest tests/models/test_phimoe.py`. diff --git a/tests/models/decoder_only/vision_language/test_awq.py b/tests/models/decoder_only/vision_language/test_awq.py index 18ceb34a..31a5cd26 100644 --- a/tests/models/decoder_only/vision_language/test_awq.py +++ b/tests/models/decoder_only/vision_language/test_awq.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Type import pytest diff --git a/tests/models/decoder_only/vision_language/test_h2ovl.py b/tests/models/decoder_only/vision_language/test_h2ovl.py index 7406df25..9590adf6 100644 --- a/tests/models/decoder_only/vision_language/test_h2ovl.py +++ b/tests/models/decoder_only/vision_language/test_h2ovl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple import pytest diff --git a/tests/models/decoder_only/vision_language/test_intern_vit.py b/tests/models/decoder_only/vision_language/test_intern_vit.py index 32fcb0bb..a842d14f 100644 --- a/tests/models/decoder_only/vision_language/test_intern_vit.py +++ b/tests/models/decoder_only/vision_language/test_intern_vit.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional import pytest diff --git a/tests/models/decoder_only/vision_language/test_models.py b/tests/models/decoder_only/vision_language/test_models.py index 62c644f7..e3cda897 100644 --- a/tests/models/decoder_only/vision_language/test_models.py +++ b/tests/models/decoder_only/vision_language/test_models.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Common tests for testing .generate() functionality for single / multiple image, embedding, and video support for different VLMs in vLLM. """ diff --git a/tests/models/decoder_only/vision_language/test_phi3v.py b/tests/models/decoder_only/vision_language/test_phi3v.py index 3a8934ad..dd68fe4c 100644 --- a/tests/models/decoder_only/vision_language/test_phi3v.py +++ b/tests/models/decoder_only/vision_language/test_phi3v.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import re from typing import List, Optional, Tuple, Type diff --git a/tests/models/decoder_only/vision_language/test_pixtral.py b/tests/models/decoder_only/vision_language/test_pixtral.py index 8103e530..602da2b5 100644 --- a/tests/models/decoder_only/vision_language/test_pixtral.py +++ b/tests/models/decoder_only/vision_language/test_pixtral.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM for Mistral models using greedy sampling. Run `pytest tests/models/test_mistral.py`. diff --git a/tests/models/decoder_only/vision_language/test_qwen2_vl.py b/tests/models/decoder_only/vision_language/test_qwen2_vl.py index 5a485f3d..de240a90 100644 --- a/tests/models/decoder_only/vision_language/test_qwen2_vl.py +++ b/tests/models/decoder_only/vision_language/test_qwen2_vl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, List, Optional, Tuple, Type, TypedDict, Union import numpy.typing as npt diff --git a/tests/models/decoder_only/vision_language/vlm_utils/builders.py b/tests/models/decoder_only/vision_language/vlm_utils/builders.py index 59773be7..539410d1 100644 --- a/tests/models/decoder_only/vision_language/vlm_utils/builders.py +++ b/tests/models/decoder_only/vision_language/vlm_utils/builders.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Helpers for building inputs that can be leveraged for different test types. """ from pathlib import PosixPath diff --git a/tests/models/decoder_only/vision_language/vlm_utils/case_filtering.py b/tests/models/decoder_only/vision_language/vlm_utils/case_filtering.py index 9bb71341..ca4ec214 100644 --- a/tests/models/decoder_only/vision_language/vlm_utils/case_filtering.py +++ b/tests/models/decoder_only/vision_language/vlm_utils/case_filtering.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utils for determining which subset of model tests belong to a specific modality, getting all combinations (similar to pytest's parametrization), handling multimodal placeholder substitution, and so on. diff --git a/tests/models/decoder_only/vision_language/vlm_utils/core.py b/tests/models/decoder_only/vision_language/vlm_utils/core.py index 54b7b073..0aed2676 100644 --- a/tests/models/decoder_only/vision_language/vlm_utils/core.py +++ b/tests/models/decoder_only/vision_language/vlm_utils/core.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Core test implementation to be shared across modalities.""" from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union @@ -153,4 +154,4 @@ def process_runner_outputs( def process_outputs(output_processor, model, outputs_per_image): """Applies a model specific post-processor function to a runner's output""" return [[output_processor(res, model) for res in outputs] - for outputs in outputs_per_image] \ No newline at end of file + for outputs in outputs_per_image] diff --git a/tests/models/decoder_only/vision_language/vlm_utils/custom_inputs.py b/tests/models/decoder_only/vision_language/vlm_utils/custom_inputs.py index 2291f4fa..2f03a114 100644 --- a/tests/models/decoder_only/vision_language/vlm_utils/custom_inputs.py +++ b/tests/models/decoder_only/vision_language/vlm_utils/custom_inputs.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Custom input builders for edge-cases in different models.""" from typing import Callable diff --git a/tests/models/decoder_only/vision_language/vlm_utils/model_utils.py b/tests/models/decoder_only/vision_language/vlm_utils/model_utils.py index 07bdb2ce..b0a88161 100644 --- a/tests/models/decoder_only/vision_language/vlm_utils/model_utils.py +++ b/tests/models/decoder_only/vision_language/vlm_utils/model_utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Common utility functions relating to different models that are useful for manipulating the input / output of HF & vLLM test runners, which are typically specific to a small subset of models. diff --git a/tests/models/decoder_only/vision_language/vlm_utils/runners.py b/tests/models/decoder_only/vision_language/vlm_utils/runners.py index 2d3b39fe..fb9df37c 100644 --- a/tests/models/decoder_only/vision_language/vlm_utils/runners.py +++ b/tests/models/decoder_only/vision_language/vlm_utils/runners.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Entrypoints for wrapping the core run_test implementation for specific test types / modalities. """ diff --git a/tests/models/decoder_only/vision_language/vlm_utils/types.py b/tests/models/decoder_only/vision_language/vlm_utils/types.py index e2e0c639..ae3b9d59 100644 --- a/tests/models/decoder_only/vision_language/vlm_utils/types.py +++ b/tests/models/decoder_only/vision_language/vlm_utils/types.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Types for writing multimodal model tests.""" from enum import Enum from pathlib import PosixPath diff --git a/tests/models/embedding/language/test_cls_models.py b/tests/models/embedding/language/test_cls_models.py index 0cbe4afe..b0420ff5 100644 --- a/tests/models/embedding/language/test_cls_models.py +++ b/tests/models/embedding/language/test_cls_models.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the classification outputs of HF and vLLM models. Run `pytest tests/models/test_cls_models.py`. diff --git a/tests/models/embedding/language/test_embedding.py b/tests/models/embedding/language/test_embedding.py index e17198e3..ad638537 100644 --- a/tests/models/embedding/language/test_embedding.py +++ b/tests/models/embedding/language/test_embedding.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the embedding outputs of HF and vLLM models. Run `pytest tests/models/embedding/language/test_embedding.py`. diff --git a/tests/models/embedding/language/test_gritlm.py b/tests/models/embedding/language/test_gritlm.py index 55c2e5d4..7ed2fb8a 100644 --- a/tests/models/embedding/language/test_gritlm.py +++ b/tests/models/embedding/language/test_gritlm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import importlib.util import math from array import array diff --git a/tests/models/embedding/language/test_scoring.py b/tests/models/embedding/language/test_scoring.py index 3db27d94..d6408258 100644 --- a/tests/models/embedding/language/test_scoring.py +++ b/tests/models/embedding/language/test_scoring.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the scoring outputs of HF and vLLM models. Run `pytest tests/models/embedding/language/test_scoring.py`. diff --git a/tests/models/embedding/utils.py b/tests/models/embedding/utils.py index f96c7d2b..567aa509 100644 --- a/tests/models/embedding/utils.py +++ b/tests/models/embedding/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Sequence import torch diff --git a/tests/models/embedding/vision_language/test_dse_qwen2_vl.py b/tests/models/embedding/vision_language/test_dse_qwen2_vl.py index 2641987b..82f2bf53 100644 --- a/tests/models/embedding/vision_language/test_dse_qwen2_vl.py +++ b/tests/models/embedding/vision_language/test_dse_qwen2_vl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import partial from typing import Callable, Dict, List, Type diff --git a/tests/models/embedding/vision_language/test_llava_next.py b/tests/models/embedding/vision_language/test_llava_next.py index f4cd8b81..6ba3c540 100644 --- a/tests/models/embedding/vision_language/test_llava_next.py +++ b/tests/models/embedding/vision_language/test_llava_next.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Type import pytest diff --git a/tests/models/embedding/vision_language/test_phi3v.py b/tests/models/embedding/vision_language/test_phi3v.py index 9374c23d..0cb94874 100644 --- a/tests/models/embedding/vision_language/test_phi3v.py +++ b/tests/models/embedding/vision_language/test_phi3v.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Type import pytest diff --git a/tests/models/encoder_decoder/audio_language/test_whisper.py b/tests/models/encoder_decoder/audio_language/test_whisper.py index eb238c53..80d6897d 100644 --- a/tests/models/encoder_decoder/audio_language/test_whisper.py +++ b/tests/models/encoder_decoder/audio_language/test_whisper.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM for Whisper models using greedy sampling. Run `pytest tests/models/encoder_decoder/audio/test_whisper.py`. diff --git a/tests/models/encoder_decoder/language/test_bart.py b/tests/models/encoder_decoder/language/test_bart.py index 10aba842..81b629fd 100644 --- a/tests/models/encoder_decoder/language/test_bart.py +++ b/tests/models/encoder_decoder/language/test_bart.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM for BART models using greedy sampling. Run `pytest tests/models/encoder_decoder/language/test_bart.py`. diff --git a/tests/models/encoder_decoder/vision_language/test_broadcast.py b/tests/models/encoder_decoder/vision_language/test_broadcast.py index 542f41a3..8d986414 100644 --- a/tests/models/encoder_decoder/vision_language/test_broadcast.py +++ b/tests/models/encoder_decoder/vision_language/test_broadcast.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from ....utils import multi_gpu_test diff --git a/tests/models/encoder_decoder/vision_language/test_florence2.py b/tests/models/encoder_decoder/vision_language/test_florence2.py index d686f1da..a1d15679 100644 --- a/tests/models/encoder_decoder/vision_language/test_florence2.py +++ b/tests/models/encoder_decoder/vision_language/test_florence2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import partial from typing import List, Optional, Tuple, Type diff --git a/tests/models/encoder_decoder/vision_language/test_mllama.py b/tests/models/encoder_decoder/vision_language/test_mllama.py index 16c71228..4cd2dbdb 100644 --- a/tests/models/encoder_decoder/vision_language/test_mllama.py +++ b/tests/models/encoder_decoder/vision_language/test_mllama.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple, Type, overload import pytest diff --git a/tests/models/multimodal/processing/test_common.py b/tests/models/multimodal/processing/test_common.py index ca28da26..3921d4e1 100644 --- a/tests/models/multimodal/processing/test_common.py +++ b/tests/models/multimodal/processing/test_common.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import partial import numpy as np diff --git a/tests/models/multimodal/processing/test_idefics3.py b/tests/models/multimodal/processing/test_idefics3.py index 69b91ad4..00c1dae5 100644 --- a/tests/models/multimodal/processing/test_idefics3.py +++ b/tests/models/multimodal/processing/test_idefics3.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for Idefics3's multimodal preprocessing kwargs.""" from typing import Optional diff --git a/tests/models/multimodal/processing/test_internvl.py b/tests/models/multimodal/processing/test_internvl.py index d6c60595..0d921e9d 100644 --- a/tests/models/multimodal/processing/test_internvl.py +++ b/tests/models/multimodal/processing/test_internvl.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for InternVL's multimodal preprocessing kwargs.""" from typing import Callable, Optional diff --git a/tests/models/multimodal/processing/test_llava_next.py b/tests/models/multimodal/processing/test_llava_next.py index 6de649f8..d2497e62 100644 --- a/tests/models/multimodal/processing/test_llava_next.py +++ b/tests/models/multimodal/processing/test_llava_next.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools from functools import partial diff --git a/tests/models/multimodal/processing/test_llava_onevision.py b/tests/models/multimodal/processing/test_llava_onevision.py index 806437d3..bd4dbd46 100644 --- a/tests/models/multimodal/processing/test_llava_onevision.py +++ b/tests/models/multimodal/processing/test_llava_onevision.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools from functools import partial diff --git a/tests/models/multimodal/processing/test_phi3v.py b/tests/models/multimodal/processing/test_phi3v.py index 7f82a8f1..44edec45 100644 --- a/tests/models/multimodal/processing/test_phi3v.py +++ b/tests/models/multimodal/processing/test_phi3v.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for phi3v's multimodal preprocessing kwargs.""" import pytest diff --git a/tests/models/multimodal/processing/test_qwen2_vl.py b/tests/models/multimodal/processing/test_qwen2_vl.py index de14fbbf..47c9b0ad 100644 --- a/tests/models/multimodal/processing/test_qwen2_vl.py +++ b/tests/models/multimodal/processing/test_qwen2_vl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.multimodal import MULTIMODAL_REGISTRY diff --git a/tests/models/registry.py b/tests/models/registry.py index 7952e65a..d0dbbf00 100644 --- a/tests/models/registry.py +++ b/tests/models/registry.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass, field from typing import AbstractSet, Any, Literal, Mapping, Optional diff --git a/tests/models/test_initialization.py b/tests/models/test_initialization.py index d3a3aaf6..64928a65 100644 --- a/tests/models/test_initialization.py +++ b/tests/models/test_initialization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from unittest.mock import patch import pytest diff --git a/tests/models/test_oot_registration.py b/tests/models/test_oot_registration.py index 2c413a63..ef665baa 100644 --- a/tests/models/test_oot_registration.py +++ b/tests/models/test_oot_registration.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pytest diff --git a/tests/models/test_registry.py b/tests/models/test_registry.py index ac036684..80d3f78f 100644 --- a/tests/models/test_registry.py +++ b/tests/models/test_registry.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import warnings import pytest diff --git a/tests/models/utils.py b/tests/models/utils.py index 0eb3f61f..e2be43c1 100644 --- a/tests/models/utils.py +++ b/tests/models/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import warnings from typing import Dict, List, Optional, Sequence, Tuple, Union diff --git a/tests/mq_llm_engine/test_abort.py b/tests/mq_llm_engine/test_abort.py index 782b508a..808346b5 100644 --- a/tests/mq_llm_engine/test_abort.py +++ b/tests/mq_llm_engine/test_abort.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test that aborting is handled properly.""" import asyncio diff --git a/tests/mq_llm_engine/test_error_handling.py b/tests/mq_llm_engine/test_error_handling.py index 83bc4e7c..35d00178 100644 --- a/tests/mq_llm_engine/test_error_handling.py +++ b/tests/mq_llm_engine/test_error_handling.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test that various errors are handled properly.""" import asyncio diff --git a/tests/mq_llm_engine/test_load.py b/tests/mq_llm_engine/test_load.py index 630c112d..2069ff98 100644 --- a/tests/mq_llm_engine/test_load.py +++ b/tests/mq_llm_engine/test_load.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test that the MQLLMEngine is able to handle 10k concurrent requests.""" import asyncio diff --git a/tests/mq_llm_engine/utils.py b/tests/mq_llm_engine/utils.py index f717c135..11e44f12 100644 --- a/tests/mq_llm_engine/utils.py +++ b/tests/mq_llm_engine/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import multiprocessing from typing import Callable, Tuple, Union diff --git a/tests/multi_step/test_correctness_async_llm.py b/tests/multi_step/test_correctness_async_llm.py index b8524ed8..9822cee1 100644 --- a/tests/multi_step/test_correctness_async_llm.py +++ b/tests/multi_step/test_correctness_async_llm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Test the AsyncLLMEngine with multi-step-decoding from typing import List, Optional diff --git a/tests/multi_step/test_correctness_llm.py b/tests/multi_step/test_correctness_llm.py index 34030d9d..29d5ffd4 100644 --- a/tests/multi_step/test_correctness_llm.py +++ b/tests/multi_step/test_correctness_llm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Test the LLMEngine with multi-step-decoding import copy diff --git a/tests/multimodal/test_inputs.py b/tests/multimodal/test_inputs.py index 678bbb52..f5d3e282 100644 --- a/tests/multimodal/test_inputs.py +++ b/tests/multimodal/test_inputs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from vllm.multimodal.inputs import MultiModalKwargs, NestedTensors diff --git a/tests/multimodal/test_processing.py b/tests/multimodal/test_processing.py index 13f820d0..6cccd2aa 100644 --- a/tests/multimodal/test_processing.py +++ b/tests/multimodal/test_processing.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from contextlib import nullcontext from typing import cast from unittest.mock import MagicMock diff --git a/tests/multimodal/test_processor_kwargs.py b/tests/multimodal/test_processor_kwargs.py index d141cdf1..5d18b2ed 100644 --- a/tests/multimodal/test_processor_kwargs.py +++ b/tests/multimodal/test_processor_kwargs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from array import array from typing import Callable, Dict, Mapping, Optional from unittest.mock import patch diff --git a/tests/multimodal/test_utils.py b/tests/multimodal/test_utils.py index 198344e5..f9e0f507 100644 --- a/tests/multimodal/test_utils.py +++ b/tests/multimodal/test_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import base64 import mimetypes import os diff --git a/tests/multimodal/utils.py b/tests/multimodal/utils.py index 29aeca60..9a336b7e 100644 --- a/tests/multimodal/utils.py +++ b/tests/multimodal/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import numpy as np from PIL import Image diff --git a/tests/neuron/test_prefix_prefill.py b/tests/neuron/test_prefix_prefill.py index 77b707a7..dfbcfc15 100644 --- a/tests/neuron/test_prefix_prefill.py +++ b/tests/neuron/test_prefix_prefill.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import Optional diff --git a/tests/plugins/vllm_add_dummy_model/setup.py b/tests/plugins/vllm_add_dummy_model/setup.py index 9b535127..e3fb6efb 100644 --- a/tests/plugins/vllm_add_dummy_model/setup.py +++ b/tests/plugins/vllm_add_dummy_model/setup.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from setuptools import setup setup(name='vllm_add_dummy_model', diff --git a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/__init__.py b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/__init__.py index 62a8f871..0c431cb3 100644 --- a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/__init__.py +++ b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import ModelRegistry diff --git a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_gemma_embedding.py b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_gemma_embedding.py index 5e7d7d18..3af62b28 100644 --- a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_gemma_embedding.py +++ b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_gemma_embedding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Iterable, List, Optional, Tuple, Union import torch diff --git a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_llava.py b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_llava.py index ac64edfd..c23ab643 100644 --- a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_llava.py +++ b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_llava.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional import torch diff --git a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_opt.py b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_opt.py index 569ef216..bbd11ed4 100644 --- a/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_opt.py +++ b/tests/plugins/vllm_add_dummy_model/vllm_add_dummy_model/my_opt.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional import torch diff --git a/tests/plugins/vllm_add_dummy_platform/setup.py b/tests/plugins/vllm_add_dummy_platform/setup.py index 31639906..10df0b5e 100644 --- a/tests/plugins/vllm_add_dummy_platform/setup.py +++ b/tests/plugins/vllm_add_dummy_platform/setup.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from setuptools import setup setup( diff --git a/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/__init__.py b/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/__init__.py index 594cef52..0d1b062a 100644 --- a/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/__init__.py +++ b/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional diff --git a/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_attention_backend.py b/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_attention_backend.py index 5634be3c..33425bbc 100644 --- a/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_attention_backend.py +++ b/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_attention_backend.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.attention.backends.flash_attn import FlashAttentionBackend diff --git a/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_platform.py b/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_platform.py index d7c6bdd7..5cefafc7 100644 --- a/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_platform.py +++ b/tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_platform.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.platforms.cuda import CudaPlatform diff --git a/tests/plugins_tests/test_platform_plugins.py b/tests/plugins_tests/test_platform_plugins.py index 661aa5f6..ed50fe53 100644 --- a/tests/plugins_tests/test_platform_plugins.py +++ b/tests/plugins_tests/test_platform_plugins.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from tests.kernels.utils import override_backend_env_variable diff --git a/tests/prefix_caching/test_disable_sliding_window.py b/tests/prefix_caching/test_disable_sliding_window.py index 5a28943b..19f393e0 100644 --- a/tests/prefix_caching/test_disable_sliding_window.py +++ b/tests/prefix_caching/test_disable_sliding_window.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the with and without prefix caching. Run `pytest tests/prefix_caching/test_prefix_caching.py`. diff --git a/tests/prefix_caching/test_prefix_caching.py b/tests/prefix_caching/test_prefix_caching.py index 8d16710f..90d424fe 100644 --- a/tests/prefix_caching/test_prefix_caching.py +++ b/tests/prefix_caching/test_prefix_caching.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the with and without prefix caching. Run `pytest tests/prefix_caching/test_prefix_caching.py`. diff --git a/tests/prompt_adapter/test_bloom.py b/tests/prompt_adapter/test_bloom.py index 6528b300..a31d8e87 100644 --- a/tests/prompt_adapter/test_bloom.py +++ b/tests/prompt_adapter/test_bloom.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import vllm diff --git a/tests/prompt_adapter/test_multi_adapter_inference.py b/tests/prompt_adapter/test_multi_adapter_inference.py index 39a79bec..e249a6e6 100644 --- a/tests/prompt_adapter/test_multi_adapter_inference.py +++ b/tests/prompt_adapter/test_multi_adapter_inference.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import EngineArgs, LLMEngine, SamplingParams from vllm.prompt_adapter.request import PromptAdapterRequest diff --git a/tests/prompt_adapter/test_pa_lora.py b/tests/prompt_adapter/test_pa_lora.py index 2a5f23f7..fb4c3e14 100644 --- a/tests/prompt_adapter/test_pa_lora.py +++ b/tests/prompt_adapter/test_pa_lora.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from huggingface_hub import snapshot_download from vllm import EngineArgs, LLMEngine, SamplingParams diff --git a/tests/quantization/test_bitsandbytes.py b/tests/quantization/test_bitsandbytes.py index 569fc8df..4b5210cd 100644 --- a/tests/quantization/test_bitsandbytes.py +++ b/tests/quantization/test_bitsandbytes.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 '''Tests whether bitsandbytes computation is enabled correctly. Run `pytest tests/quantization/test_bitsandbytes.py`. diff --git a/tests/quantization/test_compressed_tensors.py b/tests/quantization/test_compressed_tensors.py index 1072697e..7e2e6f6e 100644 --- a/tests/quantization/test_compressed_tensors.py +++ b/tests/quantization/test_compressed_tensors.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test model set-up and weight loading for llmcompressor-quantized models. Run `pytest tests/quantization/test_compressed_tensors.py`. diff --git a/tests/quantization/test_configs.py b/tests/quantization/test_configs.py index cf77ccec..0abbd8eb 100644 --- a/tests/quantization/test_configs.py +++ b/tests/quantization/test_configs.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests whether Marlin models can be loaded from the autogptq config. Run `pytest tests/quantization/test_configs.py --forked`. diff --git a/tests/quantization/test_cpu_offload.py b/tests/quantization/test_cpu_offload.py index 21ce5174..29a5721e 100644 --- a/tests/quantization/test_cpu_offload.py +++ b/tests/quantization/test_cpu_offload.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Expanded quantized model tests for CPU offloading # Base tests: tests/basic_correctness/test_cpu_offload.py diff --git a/tests/quantization/test_experts_int8.py b/tests/quantization/test_experts_int8.py index ec31c94e..b6db6d5f 100644 --- a/tests/quantization/test_experts_int8.py +++ b/tests/quantization/test_experts_int8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # flake8: noqa """Tests experts_int8 quantization startup and generation, doesn't test correctness diff --git a/tests/quantization/test_fp8.py b/tests/quantization/test_fp8.py index 4bff7347..5616935e 100644 --- a/tests/quantization/test_fp8.py +++ b/tests/quantization/test_fp8.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests whether FP8 computation is enabled correctly. Run `pytest tests/quantization/test_fp8.py --forked`. diff --git a/tests/quantization/test_ipex_quant.py b/tests/quantization/test_ipex_quant.py index 68a73f0f..0e391367 100644 --- a/tests/quantization/test_ipex_quant.py +++ b/tests/quantization/test_ipex_quant.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test model set-up and inference for quantized HF models supported on the CPU/GPU backend using IPEX (including AWQ/GPTQ). diff --git a/tests/quantization/test_lm_head.py b/tests/quantization/test_lm_head.py index fa2d9645..ec60d8a5 100644 --- a/tests/quantization/test_lm_head.py +++ b/tests/quantization/test_lm_head.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests whether gptq models with quantized lm_head can be loaded. Run `pytest tests/quantization/test_quant_lm_head_true.py --forked`. diff --git a/tests/quantization/test_quark.py b/tests/quantization/test_quark.py index 11382ad7..491370c7 100644 --- a/tests/quantization/test_quark.py +++ b/tests/quantization/test_quark.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test model set-up and weight loading for quark-quantized models. Run `pytest tests/quantization/test_quark.py`. diff --git a/tests/quantization/test_register_quantization_config.py b/tests/quantization/test_register_quantization_config.py index 8e7f44a3..9e1867f9 100644 --- a/tests/quantization/test_register_quantization_config.py +++ b/tests/quantization/test_register_quantization_config.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests register custom quantization config. See https://github.com/vllm-project/vllm/issues/11926 for more details. diff --git a/tests/quantization/utils.py b/tests/quantization/utils.py index 8ebd8dd2..7a339c16 100644 --- a/tests/quantization/utils.py +++ b/tests/quantization/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.model_executor.layers.quantization import get_quantization_config from vllm.platforms import current_platform diff --git a/tests/runai_model_streamer/test_runai_model_streamer_loader.py b/tests/runai_model_streamer/test_runai_model_streamer_loader.py index c5722fba..aa91fa8e 100644 --- a/tests/runai_model_streamer/test_runai_model_streamer_loader.py +++ b/tests/runai_model_streamer/test_runai_model_streamer_loader.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import SamplingParams from vllm.config import LoadConfig, LoadFormat from vllm.model_executor.model_loader.loader import (RunaiModelStreamerLoader, diff --git a/tests/runai_model_streamer/test_weight_utils.py b/tests/runai_model_streamer/test_weight_utils.py index 5c89bd78..4afa76c5 100644 --- a/tests/runai_model_streamer/test_weight_utils.py +++ b/tests/runai_model_streamer/test_weight_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import glob import tempfile diff --git a/tests/samplers/test_beam_search.py b/tests/samplers/test_beam_search.py index 4d1a6978..39feb189 100644 --- a/tests/samplers/test_beam_search.py +++ b/tests/samplers/test_beam_search.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the outputs of HF and vLLM when using beam search. Run `pytest tests/samplers/test_beam_search.py`. diff --git a/tests/samplers/test_ignore_eos.py b/tests/samplers/test_ignore_eos.py index dc2482d8..7f26698c 100644 --- a/tests/samplers/test_ignore_eos.py +++ b/tests/samplers/test_ignore_eos.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Make sure ignore_eos works. Run `pytest tests/samplers/test_ignore_eos.py`. diff --git a/tests/samplers/test_logits_processor.py b/tests/samplers/test_logits_processor.py index 29794701..3b95b038 100644 --- a/tests/samplers/test_logits_processor.py +++ b/tests/samplers/test_logits_processor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/samplers/test_logprobs.py b/tests/samplers/test_logprobs.py index c07c71e3..59d36099 100644 --- a/tests/samplers/test_logprobs.py +++ b/tests/samplers/test_logprobs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/samplers/test_no_bad_words.py b/tests/samplers/test_no_bad_words.py index 4190cf7c..cc655769 100644 --- a/tests/samplers/test_no_bad_words.py +++ b/tests/samplers/test_no_bad_words.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Make sure bad_words works. Run `pytest tests/samplers/test_no_bad_words.py`. diff --git a/tests/samplers/test_ranks.py b/tests/samplers/test_ranks.py index ed2fee1a..c74c1c02 100644 --- a/tests/samplers/test_ranks.py +++ b/tests/samplers/test_ranks.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm import SamplingParams diff --git a/tests/samplers/test_rejection_sampler.py b/tests/samplers/test_rejection_sampler.py index dcb1b27b..cc199bf6 100644 --- a/tests/samplers/test_rejection_sampler.py +++ b/tests/samplers/test_rejection_sampler.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for rejection sampling.""" from typing import List, Tuple diff --git a/tests/samplers/test_sampler.py b/tests/samplers/test_sampler.py index 28c34064..ca09e536 100644 --- a/tests/samplers/test_sampler.py +++ b/tests/samplers/test_sampler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools import random from dataclasses import dataclass diff --git a/tests/samplers/test_seeded_generate.py b/tests/samplers/test_seeded_generate.py index bf1ee6c3..4e828256 100644 --- a/tests/samplers/test_seeded_generate.py +++ b/tests/samplers/test_seeded_generate.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Verify that seeded random sampling is deterministic. Run `pytest tests/samplers/test_seeded_generate.py`. diff --git a/tests/samplers/test_typical_acceptance_sampler.py b/tests/samplers/test_typical_acceptance_sampler.py index 4ddad66d..ecf98179 100644 --- a/tests/samplers/test_typical_acceptance_sampler.py +++ b/tests/samplers/test_typical_acceptance_sampler.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for rejection sampling.""" import pytest diff --git a/tests/spec_decode/e2e/conftest.py b/tests/spec_decode/e2e/conftest.py index 5cb982a0..53c88881 100644 --- a/tests/spec_decode/e2e/conftest.py +++ b/tests/spec_decode/e2e/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from itertools import cycle from typing import List, Optional, Sequence, Tuple, Union diff --git a/tests/spec_decode/e2e/test_compatibility.py b/tests/spec_decode/e2e/test_compatibility.py index af8397c2..14a0ebf1 100644 --- a/tests/spec_decode/e2e/test_compatibility.py +++ b/tests/spec_decode/e2e/test_compatibility.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm import SamplingParams diff --git a/tests/spec_decode/e2e/test_eagle_correctness.py b/tests/spec_decode/e2e/test_eagle_correctness.py index 5bc70de9..6d1803f8 100644 --- a/tests/spec_decode/e2e/test_eagle_correctness.py +++ b/tests/spec_decode/e2e/test_eagle_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """This docstring details important information on the testing methodology. Most of the tests rely on "greedy equality", where we expect the output of diff --git a/tests/spec_decode/e2e/test_integration.py b/tests/spec_decode/e2e/test_integration.py index b89e5849..c67fa851 100644 --- a/tests/spec_decode/e2e/test_integration.py +++ b/tests/spec_decode/e2e/test_integration.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests which cover integration of the speculative decoding framework with other features, e.g. cuda graphs. """ diff --git a/tests/spec_decode/e2e/test_integration_dist_tp2.py b/tests/spec_decode/e2e/test_integration_dist_tp2.py index 7001ee4c..e5a542b6 100644 --- a/tests/spec_decode/e2e/test_integration_dist_tp2.py +++ b/tests/spec_decode/e2e/test_integration_dist_tp2.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests which cover integration of the speculative decoding framework with tensor parallelism. """ diff --git a/tests/spec_decode/e2e/test_integration_dist_tp4.py b/tests/spec_decode/e2e/test_integration_dist_tp4.py index 2cb10de1..cb9c46dc 100644 --- a/tests/spec_decode/e2e/test_integration_dist_tp4.py +++ b/tests/spec_decode/e2e/test_integration_dist_tp4.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests which cover integration of the speculative decoding framework with tensor parallelism. """ diff --git a/tests/spec_decode/e2e/test_logprobs.py b/tests/spec_decode/e2e/test_logprobs.py index 1a543606..5991a8b0 100644 --- a/tests/spec_decode/e2e/test_logprobs.py +++ b/tests/spec_decode/e2e/test_logprobs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from itertools import cycle import pytest diff --git a/tests/spec_decode/e2e/test_medusa_correctness.py b/tests/spec_decode/e2e/test_medusa_correctness.py index dbcbc0db..807f41cc 100644 --- a/tests/spec_decode/e2e/test_medusa_correctness.py +++ b/tests/spec_decode/e2e/test_medusa_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """This docstring details important information on the testing methodology. Most of the tests rely on "greedy equality", where we expect the output of diff --git a/tests/spec_decode/e2e/test_mlp_correctness.py b/tests/spec_decode/e2e/test_mlp_correctness.py index 1fa1104f..a2b84b90 100644 --- a/tests/spec_decode/e2e/test_mlp_correctness.py +++ b/tests/spec_decode/e2e/test_mlp_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """This docstring details important information on the testing methodology. Most of the tests rely on "greedy equality", where we expect the output of diff --git a/tests/spec_decode/e2e/test_multistep_correctness.py b/tests/spec_decode/e2e/test_multistep_correctness.py index 05ad468d..d396e52a 100644 --- a/tests/spec_decode/e2e/test_multistep_correctness.py +++ b/tests/spec_decode/e2e/test_multistep_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """The tests in this file verify end-to-end speculative decoding correctness. This docstring details important information on the testing methodology. diff --git a/tests/spec_decode/e2e/test_ngram_correctness.py b/tests/spec_decode/e2e/test_ngram_correctness.py index 77f8b899..1aff53cb 100644 --- a/tests/spec_decode/e2e/test_ngram_correctness.py +++ b/tests/spec_decode/e2e/test_ngram_correctness.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """This docstring details important information on the testing methodology. Most of the tests rely on "greedy equality", where we expect the output of diff --git a/tests/spec_decode/e2e/test_seed.py b/tests/spec_decode/e2e/test_seed.py index e42cf416..b7d279f2 100644 --- a/tests/spec_decode/e2e/test_seed.py +++ b/tests/spec_decode/e2e/test_seed.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from .conftest import run_equality_correctness_test diff --git a/tests/spec_decode/test_batch_expansion.py b/tests/spec_decode/test_batch_expansion.py index 3504fcf4..fe95ff9b 100644 --- a/tests/spec_decode/test_batch_expansion.py +++ b/tests/spec_decode/test_batch_expansion.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/spec_decode/test_dynamic_spec_decode.py b/tests/spec_decode/test_dynamic_spec_decode.py index aa49a3ae..0bff0ea1 100644 --- a/tests/spec_decode/test_dynamic_spec_decode.py +++ b/tests/spec_decode/test_dynamic_spec_decode.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from unittest.mock import MagicMock, patch import pytest diff --git a/tests/spec_decode/test_metrics.py b/tests/spec_decode/test_metrics.py index 7477486a..1a6693e1 100644 --- a/tests/spec_decode/test_metrics.py +++ b/tests/spec_decode/test_metrics.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from unittest.mock import MagicMock diff --git a/tests/spec_decode/test_multi_step_worker.py b/tests/spec_decode/test_multi_step_worker.py index 0b5d82b6..2bf40161 100644 --- a/tests/spec_decode/test_multi_step_worker.py +++ b/tests/spec_decode/test_multi_step_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import Dict, List from unittest.mock import MagicMock diff --git a/tests/spec_decode/test_ngram_worker.py b/tests/spec_decode/test_ngram_worker.py index f66e9571..7de54b3e 100644 --- a/tests/spec_decode/test_ngram_worker.py +++ b/tests/spec_decode/test_ngram_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from vllm.sequence import ExecuteModelRequest diff --git a/tests/spec_decode/test_scorer.py b/tests/spec_decode/test_scorer.py index 5a093dea..7bbbb023 100644 --- a/tests/spec_decode/test_scorer.py +++ b/tests/spec_decode/test_scorer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import List diff --git a/tests/spec_decode/test_spec_decode_worker.py b/tests/spec_decode/test_spec_decode_worker.py index d8c3af4c..eee0f4c8 100644 --- a/tests/spec_decode/test_spec_decode_worker.py +++ b/tests/spec_decode/test_spec_decode_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from collections import defaultdict from types import SimpleNamespace diff --git a/tests/spec_decode/test_utils.py b/tests/spec_decode/test_utils.py index 195fce64..24573e22 100644 --- a/tests/spec_decode/test_utils.py +++ b/tests/spec_decode/test_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from unittest.mock import MagicMock import pytest diff --git a/tests/spec_decode/utils.py b/tests/spec_decode/utils.py index 2f883c2f..38f57e99 100644 --- a/tests/spec_decode/utils.py +++ b/tests/spec_decode/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from itertools import count from typing import Callable, Dict, List, Optional from typing import Sequence as GenericSequence diff --git a/tests/standalone_tests/lazy_torch_compile.py b/tests/standalone_tests/lazy_torch_compile.py index b950877a..b3b58095 100644 --- a/tests/standalone_tests/lazy_torch_compile.py +++ b/tests/standalone_tests/lazy_torch_compile.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Description: Test the lazy import module # The utility function cannot be placed in `vllm.utils` # this needs to be a standalone script diff --git a/tests/tensorizer_loader/conftest.py b/tests/tensorizer_loader/conftest.py index 2a456536..694bb5fb 100644 --- a/tests/tensorizer_loader/conftest.py +++ b/tests/tensorizer_loader/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import functools import gc from typing import Callable, TypeVar diff --git a/tests/tensorizer_loader/test_tensorizer.py b/tests/tensorizer_loader/test_tensorizer.py index 6e7eec1c..b268d4bf 100644 --- a/tests/tensorizer_loader/test_tensorizer.py +++ b/tests/tensorizer_loader/test_tensorizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import gc import json import os diff --git a/tests/test_cache_block_hashing.py b/tests/test_cache_block_hashing.py index e8f8499a..17c128a1 100644 --- a/tests/test_cache_block_hashing.py +++ b/tests/test_cache_block_hashing.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Test hashing of cache blocks. Run `pytest tests/test_cache_block_hashing.py`. diff --git a/tests/test_config.py b/tests/test_config.py index ec366b93..2dfae218 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import asdict import pytest diff --git a/tests/test_embedded_commit.py b/tests/test_embedded_commit.py index ffeacf34..a9b4f5cb 100644 --- a/tests/test_embedded_commit.py +++ b/tests/test_embedded_commit.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import vllm diff --git a/tests/test_inputs.py b/tests/test_inputs.py index fff7c5fc..fff90915 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/test_logger.py b/tests/test_logger.py index e3749616..993822e9 100644 --- a/tests/test_logger.py +++ b/tests/test_logger.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import logging import os diff --git a/tests/test_logits_processor.py b/tests/test_logits_processor.py index 39c1c381..487fbb8f 100644 --- a/tests/test_logits_processor.py +++ b/tests/test_logits_processor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import random from typing import Tuple from unittest.mock import patch diff --git a/tests/test_regression.py b/tests/test_regression.py index 5d27d357..f781b311 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Containing tests that check for regressions in vLLM's behavior. It should include tests that are reported by users and making sure they diff --git a/tests/test_sampling_params.py b/tests/test_sampling_params.py index 01cbe0c9..40e26ed5 100644 --- a/tests/test_sampling_params.py +++ b/tests/test_sampling_params.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Tests for the SamplingParams class. """ from vllm import SamplingParams diff --git a/tests/test_scalartype.py b/tests/test_scalartype.py index a9221f08..6e36f2c3 100644 --- a/tests/test_scalartype.py +++ b/tests/test_scalartype.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import torch diff --git a/tests/test_sequence.py b/tests/test_sequence.py index 30e53a18..902de109 100644 --- a/tests/test_sequence.py +++ b/tests/test_sequence.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.model_executor.layers.sampler import SamplerOutput diff --git a/tests/test_sharded_state_loader.py b/tests/test_sharded_state_loader.py index 2412da50..088b95be 100644 --- a/tests/test_sharded_state_loader.py +++ b/tests/test_sharded_state_loader.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import multiprocessing as mp import os import shutil diff --git a/tests/test_utils.py b/tests/test_utils.py index d5dc4464..5b69ffd1 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os import socket diff --git a/tests/tokenization/test_cached_tokenizer.py b/tests/tokenization/test_cached_tokenizer.py index 4c8238fd..cd60cefd 100644 --- a/tests/tokenization/test_cached_tokenizer.py +++ b/tests/tokenization/test_cached_tokenizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from copy import deepcopy from transformers import AutoTokenizer diff --git a/tests/tokenization/test_detokenize.py b/tests/tokenization/test_detokenize.py index 84348cbc..57832394 100644 --- a/tests/tokenization/test_detokenize.py +++ b/tests/tokenization/test_detokenize.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, Generator, List, Optional import pytest diff --git a/tests/tokenization/test_get_eos.py b/tests/tokenization/test_get_eos.py index 875ca19d..787fb6ea 100644 --- a/tests/tokenization/test_get_eos.py +++ b/tests/tokenization/test_get_eos.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This test file includes some cases where it is inappropriate to only get the `eos_token_id` from the tokenizer as defined by diff --git a/tests/tokenization/test_tokenizer.py b/tests/tokenization/test_tokenizer.py index 8db7204f..eddc6309 100644 --- a/tests/tokenization/test_tokenizer.py +++ b/tests/tokenization/test_tokenizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from transformers import PreTrainedTokenizerBase diff --git a/tests/tokenization/test_tokenizer_group.py b/tests/tokenization/test_tokenizer_group.py index 3faaf326..8e99f869 100644 --- a/tests/tokenization/test_tokenizer_group.py +++ b/tests/tokenization/test_tokenizer_group.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os import sys diff --git a/tests/tool_use/conftest.py b/tests/tool_use/conftest.py index 294acf20..39ab01c9 100644 --- a/tests/tool_use/conftest.py +++ b/tests/tool_use/conftest.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest import pytest_asyncio from huggingface_hub import snapshot_download diff --git a/tests/tool_use/test_chat_completion_request_validations.py b/tests/tool_use/test_chat_completion_request_validations.py index 3d0fe8f0..7bee5628 100644 --- a/tests/tool_use/test_chat_completion_request_validations.py +++ b/tests/tool_use/test_chat_completion_request_validations.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.entrypoints.openai.protocol import ChatCompletionRequest diff --git a/tests/tool_use/test_chat_completions.py b/tests/tool_use/test_chat_completions.py index 75bbfbb7..da033fa1 100644 --- a/tests/tool_use/test_chat_completions.py +++ b/tests/tool_use/test_chat_completions.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import openai diff --git a/tests/tool_use/test_jamba_tool_parser.py b/tests/tool_use/test_jamba_tool_parser.py index 3095ef45..7e349c51 100644 --- a/tests/tool_use/test_jamba_tool_parser.py +++ b/tests/tool_use/test_jamba_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json from typing import Generator, List, Optional diff --git a/tests/tool_use/test_parallel_tool_calls.py b/tests/tool_use/test_parallel_tool_calls.py index c294cb04..b49a5e8e 100644 --- a/tests/tool_use/test_parallel_tool_calls.py +++ b/tests/tool_use/test_parallel_tool_calls.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json from typing import Dict, List, Optional diff --git a/tests/tool_use/test_tool_calls.py b/tests/tool_use/test_tool_calls.py index fe8cb496..45f1bfc4 100644 --- a/tests/tool_use/test_tool_calls.py +++ b/tests/tool_use/test_tool_calls.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json from typing import Dict, List, Optional diff --git a/tests/tool_use/utils.py b/tests/tool_use/utils.py index 2241f184..a7dfb107 100644 --- a/tests/tool_use/utils.py +++ b/tests/tool_use/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from copy import deepcopy from typing import Any, Dict, List, Optional diff --git a/tests/tpu/test_compilation.py b/tests/tpu/test_compilation.py index b7124ebc..6ed83f30 100644 --- a/tests/tpu/test_compilation.py +++ b/tests/tpu/test_compilation.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import glob import os import tempfile diff --git a/tests/tpu/test_custom_dispatcher.py b/tests/tpu/test_custom_dispatcher.py index bb1379de..e94bbd28 100644 --- a/tests/tpu/test_custom_dispatcher.py +++ b/tests/tpu/test_custom_dispatcher.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from vllm.config import CompilationLevel diff --git a/tests/tpu/test_quantization_accuracy.py b/tests/tpu/test_quantization_accuracy.py index 6cd5615c..3db9bc73 100644 --- a/tests/tpu/test_quantization_accuracy.py +++ b/tests/tpu/test_quantization_accuracy.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass import lm_eval diff --git a/tests/tracing/test_tracing.py b/tests/tracing/test_tracing.py index 49a16d16..592775e8 100644 --- a/tests/tracing/test_tracing.py +++ b/tests/tracing/test_tracing.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import threading from concurrent import futures diff --git a/tests/utils.py b/tests/utils.py index f4eecf19..3b32052f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import copy import functools diff --git a/tests/v1/core/test_kv_cache_utils.py b/tests/v1/core/test_kv_cache_utils.py index 0a5ba1f9..60cf4384 100644 --- a/tests/v1/core/test_kv_cache_utils.py +++ b/tests/v1/core/test_kv_cache_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.multimodal.inputs import MultiModalKwargs diff --git a/tests/v1/core/test_prefix_caching.py b/tests/v1/core/test_prefix_caching.py index 5c1cda28..2e16d7d2 100644 --- a/tests/v1/core/test_prefix_caching.py +++ b/tests/v1/core/test_prefix_caching.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Compare the with and without prefix caching.""" import pytest diff --git a/tests/v1/e2e/test_cascade_attention.py b/tests/v1/e2e/test_cascade_attention.py index 8ec9f1ba..a8079dcc 100644 --- a/tests/v1/e2e/test_cascade_attention.py +++ b/tests/v1/e2e/test_cascade_attention.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm import LLM, SamplingParams diff --git a/tests/v1/engine/test_async_llm.py b/tests/v1/engine/test_async_llm.py index 10f783b2..4b5bc9ce 100644 --- a/tests/v1/engine/test_async_llm.py +++ b/tests/v1/engine/test_async_llm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from contextlib import ExitStack from typing import List, Tuple diff --git a/tests/v1/engine/test_engine_args.py b/tests/v1/engine/test_engine_args.py index ff38a456..a3540582 100644 --- a/tests/v1/engine/test_engine_args.py +++ b/tests/v1/engine/test_engine_args.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm import envs diff --git a/tests/v1/engine/test_engine_core.py b/tests/v1/engine/test_engine_core.py index 033bbcfc..6a91f190 100644 --- a/tests/v1/engine/test_engine_core.py +++ b/tests/v1/engine/test_engine_core.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time import uuid diff --git a/tests/v1/engine/test_engine_core_client.py b/tests/v1/engine/test_engine_core_client.py index e2c728b2..b2539132 100644 --- a/tests/v1/engine/test_engine_core_client.py +++ b/tests/v1/engine/test_engine_core_client.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import time import uuid diff --git a/tests/v1/engine/test_output_processor.py b/tests/v1/engine/test_output_processor.py index 4735c6f9..5782a249 100644 --- a/tests/v1/engine/test_output_processor.py +++ b/tests/v1/engine/test_output_processor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/v1/sample/test_sampler.py b/tests/v1/sample/test_sampler.py index 5ebf7292..f7eedcb9 100644 --- a/tests/v1/sample/test_sampler.py +++ b/tests/v1/sample/test_sampler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Set, Tuple import numpy as np diff --git a/tests/v1/test_stats.py b/tests/v1/test_stats.py index 580392ac..48419d8a 100644 --- a/tests/v1/test_stats.py +++ b/tests/v1/test_stats.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pytest from vllm.sampling_params import SamplingParams diff --git a/tests/v1/test_utils.py b/tests/v1/test_utils.py index ac773b61..9b669ae0 100644 --- a/tests/v1/test_utils.py +++ b/tests/v1/test_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import torch diff --git a/tests/v1/worker/test_gpu_input_batch.py b/tests/v1/worker/test_gpu_input_batch.py index 694ce81f..5b40fbff 100644 --- a/tests/v1/worker/test_gpu_input_batch.py +++ b/tests/v1/worker/test_gpu_input_batch.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List, Set, Tuple import numpy as np diff --git a/tests/vllm_test_utils/setup.py b/tests/vllm_test_utils/setup.py index 790e891e..c0394314 100644 --- a/tests/vllm_test_utils/setup.py +++ b/tests/vllm_test_utils/setup.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from setuptools import setup setup( diff --git a/tests/vllm_test_utils/vllm_test_utils/__init__.py b/tests/vllm_test_utils/vllm_test_utils/__init__.py index 6505c815..1d1219fb 100644 --- a/tests/vllm_test_utils/vllm_test_utils/__init__.py +++ b/tests/vllm_test_utils/vllm_test_utils/__init__.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ vllm_utils is a package for vLLM testing utilities. It does not import any vLLM modules. diff --git a/tests/vllm_test_utils/vllm_test_utils/blame.py b/tests/vllm_test_utils/vllm_test_utils/blame.py index 1ddd3471..392fd270 100644 --- a/tests/vllm_test_utils/vllm_test_utils/blame.py +++ b/tests/vllm_test_utils/vllm_test_utils/blame.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import contextlib import dataclasses import sys diff --git a/tests/vllm_test_utils/vllm_test_utils/monitor.py b/tests/vllm_test_utils/vllm_test_utils/monitor.py index a237f53a..44d45f26 100644 --- a/tests/vllm_test_utils/vllm_test_utils/monitor.py +++ b/tests/vllm_test_utils/vllm_test_utils/monitor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import contextlib import dataclasses import sys diff --git a/tests/weight_loading/test_weight_loading.py b/tests/weight_loading/test_weight_loading.py index 7a378645..e456bfab 100644 --- a/tests/weight_loading/test_weight_loading.py +++ b/tests/weight_loading/test_weight_loading.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pytest diff --git a/tests/worker/test_encoder_decoder_model_runner.py b/tests/worker/test_encoder_decoder_model_runner.py index a6b3cb57..0ce0465a 100644 --- a/tests/worker/test_encoder_decoder_model_runner.py +++ b/tests/worker/test_encoder_decoder_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools from typing import List diff --git a/tests/worker/test_model_input.py b/tests/worker/test_model_input.py index 57f1fd47..eb341fb1 100644 --- a/tests/worker/test_model_input.py +++ b/tests/worker/test_model_input.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import List, Tuple, Type diff --git a/tests/worker/test_model_runner.py b/tests/worker/test_model_runner.py index aabe913c..c32ceb4f 100644 --- a/tests/worker/test_model_runner.py +++ b/tests/worker/test_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import pytest diff --git a/tests/worker/test_profile.py b/tests/worker/test_profile.py index 79233c75..22466105 100644 --- a/tests/worker/test_profile.py +++ b/tests/worker/test_profile.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from vllm.engine.arg_utils import EngineArgs diff --git a/tests/worker/test_swap.py b/tests/worker/test_swap.py index acede959..7ae0f4bb 100644 --- a/tests/worker/test_swap.py +++ b/tests/worker/test_swap.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from vllm.engine.arg_utils import EngineArgs diff --git a/tools/check_spdx_header.py b/tools/check_spdx_header.py new file mode 100644 index 00000000..3f7fd66b --- /dev/null +++ b/tools/check_spdx_header.py @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: Apache-2.0 + +import sys + +SPDX_HEADER = "# SPDX-License-Identifier: Apache-2.0" +SPDX_HEADER_PREFIX = "# SPDX-License-Identifier:" + + +def check_spdx_header(file_path): + with open(file_path, encoding='UTF-8') as file: + lines = file.readlines() + if not lines: + # not necessary for an empty file like __init__.py + return True + if not lines[0].strip().startswith(SPDX_HEADER_PREFIX): + return False + return True + + +def add_header(file_path): + with open(file_path, 'r+', encoding='UTF-8') as file: + lines = file.readlines() + file.seek(0, 0) + file.write(SPDX_HEADER + '\n\n' + ''.join(lines)) + + +def main(): + files_with_missing_header = [] + for file_path in sys.argv[1:]: + if not check_spdx_header(file_path): + files_with_missing_header.append(file_path) + + if files_with_missing_header: + print("The following files are missing the SPDX header:") + for file_path in files_with_missing_header: + print(f" {file_path}") + add_header(file_path) + + sys.exit(1 if files_with_missing_header else 0) + + +if __name__ == "__main__": + main() diff --git a/tools/profiler/print_layerwise_table.py b/tools/profiler/print_layerwise_table.py index 54cd60c2..adbb7301 100644 --- a/tools/profiler/print_layerwise_table.py +++ b/tools/profiler/print_layerwise_table.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import json from typing import Dict diff --git a/tools/profiler/visualize_layerwise_profile.py b/tools/profiler/visualize_layerwise_profile.py index cb56ebd6..c527cdbe 100644 --- a/tools/profiler/visualize_layerwise_profile.py +++ b/tools/profiler/visualize_layerwise_profile.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import copy import json diff --git a/tools/report_build_time_ninja.py b/tools/report_build_time_ninja.py index 9dc19f5f..33e85b9f 100644 --- a/tools/report_build_time_ninja.py +++ b/tools/report_build_time_ninja.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + #!/usr/bin/env python3 # Copyright (c) 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/use_existing_torch.py b/use_existing_torch.py index 319d2628..a578328b 100644 --- a/use_existing_torch.py +++ b/use_existing_torch.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import glob requires_files = glob.glob('requirements*.txt') diff --git a/vllm/__init__.py b/vllm/__init__.py index 2aabe820..566c5116 100644 --- a/vllm/__init__.py +++ b/vllm/__init__.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """vLLM: a high-throughput and memory-efficient inference engine for LLMs""" import os diff --git a/vllm/_custom_ops.py b/vllm/_custom_ops.py index da237da2..ce4f7534 100644 --- a/vllm/_custom_ops.py +++ b/vllm/_custom_ops.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import contextlib import importlib from typing import TYPE_CHECKING, List, Optional, Tuple, Union diff --git a/vllm/_ipex_ops.py b/vllm/_ipex_ops.py index 28b804f7..ccb67baa 100644 --- a/vllm/_ipex_ops.py +++ b/vllm/_ipex_ops.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple import torch diff --git a/vllm/adapter_commons/layers.py b/vllm/adapter_commons/layers.py index 3ed60678..18e0c522 100644 --- a/vllm/adapter_commons/layers.py +++ b/vllm/adapter_commons/layers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Tuple diff --git a/vllm/adapter_commons/models.py b/vllm/adapter_commons/models.py index 468904c9..f9a5d2ff 100644 --- a/vllm/adapter_commons/models.py +++ b/vllm/adapter_commons/models.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import Any, Callable, Dict, Optional, TypeVar diff --git a/vllm/adapter_commons/request.py b/vllm/adapter_commons/request.py index 2bb17fdc..2b604b91 100644 --- a/vllm/adapter_commons/request.py +++ b/vllm/adapter_commons/request.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod diff --git a/vllm/adapter_commons/utils.py b/vllm/adapter_commons/utils.py index 1e9adca5..c2dc5433 100644 --- a/vllm/adapter_commons/utils.py +++ b/vllm/adapter_commons/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, Dict, Optional, Set diff --git a/vllm/adapter_commons/worker_manager.py b/vllm/adapter_commons/worker_manager.py index 83929e82..ce24e08a 100644 --- a/vllm/adapter_commons/worker_manager.py +++ b/vllm/adapter_commons/worker_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import Any, Optional, Set diff --git a/vllm/assets/audio.py b/vllm/assets/audio.py index a46c67ad..d9e51082 100644 --- a/vllm/assets/audio.py +++ b/vllm/assets/audio.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Literal from urllib.parse import urljoin diff --git a/vllm/assets/base.py b/vllm/assets/base.py index 24917314..03f3b9da 100644 --- a/vllm/assets/base.py +++ b/vllm/assets/base.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import lru_cache from pathlib import Path from typing import Optional diff --git a/vllm/assets/image.py b/vllm/assets/image.py index 0a55506f..2b1d258d 100644 --- a/vllm/assets/image.py +++ b/vllm/assets/image.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Literal diff --git a/vllm/assets/video.py b/vllm/assets/video.py index eca2ccc5..494cfc38 100644 --- a/vllm/assets/video.py +++ b/vllm/assets/video.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from functools import lru_cache from typing import List, Literal diff --git a/vllm/attention/__init__.py b/vllm/attention/__init__.py index 2cd4ad3e..85c5715f 100644 --- a/vllm/attention/__init__.py +++ b/vllm/attention/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.attention.backends.abstract import (AttentionBackend, AttentionMetadata, AttentionMetadataBuilder, diff --git a/vllm/attention/backends/abstract.py b/vllm/attention/backends/abstract.py index b9425f65..5f0a5401 100644 --- a/vllm/attention/backends/abstract.py +++ b/vllm/attention/backends/abstract.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from contextlib import contextmanager from dataclasses import dataclass, fields diff --git a/vllm/attention/backends/blocksparse_attn.py b/vllm/attention/backends/blocksparse_attn.py index 20e9a3f1..9765e788 100644 --- a/vllm/attention/backends/blocksparse_attn.py +++ b/vllm/attention/backends/blocksparse_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass, field from typing import Any, Dict, List, Optional, Tuple, Type diff --git a/vllm/attention/backends/flash_attn.py b/vllm/attention/backends/flash_attn.py index 4a9aa1e2..6a82127a 100755 --- a/vllm/attention/backends/flash_attn.py +++ b/vllm/attention/backends/flash_attn.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Attention layer with FlashAttention.""" from collections import defaultdict from dataclasses import dataclass diff --git a/vllm/attention/backends/flashinfer.py b/vllm/attention/backends/flashinfer.py index 7cccef96..715ed674 100644 --- a/vllm/attention/backends/flashinfer.py +++ b/vllm/attention/backends/flashinfer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from collections import defaultdict from contextlib import contextmanager diff --git a/vllm/attention/backends/hpu_attn.py b/vllm/attention/backends/hpu_attn.py index 80c132c0..1518e518 100644 --- a/vllm/attention/backends/hpu_attn.py +++ b/vllm/attention/backends/hpu_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + ############################################################################### # Copyright (C) 2024 Habana Labs, Ltd. an Intel Company ############################################################################### diff --git a/vllm/attention/backends/ipex_attn.py b/vllm/attention/backends/ipex_attn.py index 57916a3c..b4879af4 100644 --- a/vllm/attention/backends/ipex_attn.py +++ b/vllm/attention/backends/ipex_attn.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Attention layer with torch scaled_dot_product_attention and PagedAttention.""" from dataclasses import dataclass diff --git a/vllm/attention/backends/mla/utils.py b/vllm/attention/backends/mla/utils.py index e8fec234..9b63192e 100644 --- a/vllm/attention/backends/mla/utils.py +++ b/vllm/attention/backends/mla/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import abstractmethod from dataclasses import dataclass from typing import Any, Dict, Generic, List, Optional, Tuple diff --git a/vllm/attention/backends/openvino.py b/vllm/attention/backends/openvino.py index be06d160..f58528db 100644 --- a/vllm/attention/backends/openvino.py +++ b/vllm/attention/backends/openvino.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Dict, List, Optional, Tuple, Type diff --git a/vllm/attention/backends/pallas.py b/vllm/attention/backends/pallas.py index 209a623b..b61dfe63 100644 --- a/vllm/attention/backends/pallas.py +++ b/vllm/attention/backends/pallas.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple, Type diff --git a/vllm/attention/backends/placeholder_attn.py b/vllm/attention/backends/placeholder_attn.py index 82631189..9f6e731a 100644 --- a/vllm/attention/backends/placeholder_attn.py +++ b/vllm/attention/backends/placeholder_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import defaultdict from dataclasses import dataclass from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type diff --git a/vllm/attention/backends/rocm_flash_attn.py b/vllm/attention/backends/rocm_flash_attn.py index 12110ec7..02bff57a 100644 --- a/vllm/attention/backends/rocm_flash_attn.py +++ b/vllm/attention/backends/rocm_flash_attn.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Attention layer ROCm GPUs.""" from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type diff --git a/vllm/attention/backends/torch_sdpa.py b/vllm/attention/backends/torch_sdpa.py index c3b2398b..25fe6ed9 100644 --- a/vllm/attention/backends/torch_sdpa.py +++ b/vllm/attention/backends/torch_sdpa.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Attention layer with torch scaled_dot_product_attention and PagedAttention.""" from dataclasses import dataclass diff --git a/vllm/attention/backends/triton_mla.py b/vllm/attention/backends/triton_mla.py index 95dc119a..20d7ef0f 100644 --- a/vllm/attention/backends/triton_mla.py +++ b/vllm/attention/backends/triton_mla.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import defaultdict from contextlib import contextmanager from dataclasses import dataclass diff --git a/vllm/attention/backends/utils.py b/vllm/attention/backends/utils.py index 7f2fe7e8..ad53e4e7 100644 --- a/vllm/attention/backends/utils.py +++ b/vllm/attention/backends/utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Attention backend utils""" from collections import defaultdict from contextlib import contextmanager diff --git a/vllm/attention/backends/xformers.py b/vllm/attention/backends/xformers.py index 49f47f9c..723a4558 100644 --- a/vllm/attention/backends/xformers.py +++ b/vllm/attention/backends/xformers.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Attention layer with xFormers and PagedAttention.""" from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple, Type diff --git a/vllm/attention/layer.py b/vllm/attention/layer.py index b97165f6..19ee8963 100644 --- a/vllm/attention/layer.py +++ b/vllm/attention/layer.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Attention layer.""" from typing import Any, Dict, List, Optional diff --git a/vllm/attention/ops/blocksparse_attention/blocksparse_attention_kernel.py b/vllm/attention/ops/blocksparse_attention/blocksparse_attention_kernel.py index 727a470b..71caf3cb 100644 --- a/vllm/attention/ops/blocksparse_attention/blocksparse_attention_kernel.py +++ b/vllm/attention/ops/blocksparse_attention/blocksparse_attention_kernel.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch import triton import triton.language as tl diff --git a/vllm/attention/ops/blocksparse_attention/interface.py b/vllm/attention/ops/blocksparse_attention/interface.py index 350f88c8..6ab69ea5 100644 --- a/vllm/attention/ops/blocksparse_attention/interface.py +++ b/vllm/attention/ops/blocksparse_attention/interface.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math import torch diff --git a/vllm/attention/ops/blocksparse_attention/utils.py b/vllm/attention/ops/blocksparse_attention/utils.py index 78d75223..4de9bd53 100644 --- a/vllm/attention/ops/blocksparse_attention/utils.py +++ b/vllm/attention/ops/blocksparse_attention/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Helper functions for 3D sparse pattern # These function are not optimized and very inefficient. # Avoid calling them too frequent or use a cache mechanism. diff --git a/vllm/attention/ops/hpu_paged_attn.py b/vllm/attention/ops/hpu_paged_attn.py index 4c0fb2a6..8bb53634 100644 --- a/vllm/attention/ops/hpu_paged_attn.py +++ b/vllm/attention/ops/hpu_paged_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + ############################################################################### # Copyright (C) 2024 Habana Labs, Ltd. an Intel Company ############################################################################### diff --git a/vllm/attention/ops/ipex_attn.py b/vllm/attention/ops/ipex_attn.py index 3a07184e..598ceea1 100644 --- a/vllm/attention/ops/ipex_attn.py +++ b/vllm/attention/ops/ipex_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List, Optional, Tuple try: diff --git a/vllm/attention/ops/nki_flash_attn.py b/vllm/attention/ops/nki_flash_attn.py index 9de4ef7f..68aa63f5 100644 --- a/vllm/attention/ops/nki_flash_attn.py +++ b/vllm/attention/ops/nki_flash_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass import neuronxcc.nki.isa as nisa diff --git a/vllm/attention/ops/paged_attn.py b/vllm/attention/ops/paged_attn.py index fd623291..2c60bd0c 100644 --- a/vllm/attention/ops/paged_attn.py +++ b/vllm/attention/ops/paged_attn.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import List, Optional, Tuple diff --git a/vllm/attention/ops/prefix_prefill.py b/vllm/attention/ops/prefix_prefill.py index ec3c8459..fbb6757e 100644 --- a/vllm/attention/ops/prefix_prefill.py +++ b/vllm/attention/ops/prefix_prefill.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # The kernels in this file are adapted from LightLLM's context_attention_fwd: # https://github.com/ModelTC/lightllm/blob/main/lightllm/models/llama/triton_kernel/context_flashattention_nopad.py diff --git a/vllm/attention/ops/triton_decode_attention.py b/vllm/attention/ops/triton_decode_attention.py index 675df109..ec5ec4ce 100644 --- a/vllm/attention/ops/triton_decode_attention.py +++ b/vllm/attention/ops/triton_decode_attention.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/sgl-project/sglang/blob/9f635ea50de920aa507f486daafba26a5b837574/python/sglang/srt/layers/attention/triton_ops/decode_attention.py # which was originally adapted from diff --git a/vllm/attention/ops/triton_flash_attention.py b/vllm/attention/ops/triton_flash_attention.py index ef04603f..ab8fb895 100644 --- a/vllm/attention/ops/triton_flash_attention.py +++ b/vllm/attention/ops/triton_flash_attention.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + #!/usr/bin/env python """ Fused Attention diff --git a/vllm/attention/selector.py b/vllm/attention/selector.py index 4c6bbc72..26c6ac81 100644 --- a/vllm/attention/selector.py +++ b/vllm/attention/selector.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from contextlib import contextmanager from functools import cache diff --git a/vllm/beam_search.py b/vllm/beam_search.py index 026037e5..97b2b630 100644 --- a/vllm/beam_search.py +++ b/vllm/beam_search.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union diff --git a/vllm/compilation/backends.py b/vllm/compilation/backends.py index 7f4f9746..97989017 100644 --- a/vllm/compilation/backends.py +++ b/vllm/compilation/backends.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import ast import copy import dataclasses diff --git a/vllm/compilation/counter.py b/vllm/compilation/counter.py index 6385f1c5..a6f11a3a 100644 --- a/vllm/compilation/counter.py +++ b/vllm/compilation/counter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import copy import dataclasses from contextlib import contextmanager diff --git a/vllm/compilation/decorators.py b/vllm/compilation/decorators.py index 17eb0592..20afe696 100644 --- a/vllm/compilation/decorators.py +++ b/vllm/compilation/decorators.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import inspect from typing import Callable, Dict, List, Optional, TypeVar, Union, overload from unittest.mock import patch diff --git a/vllm/compilation/fix_functionalization.py b/vllm/compilation/fix_functionalization.py index e15d7b31..9b0e9c5d 100644 --- a/vllm/compilation/fix_functionalization.py +++ b/vllm/compilation/fix_functionalization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import operator from typing import Dict, Iterable, List, Optional, Tuple, Union diff --git a/vllm/compilation/fusion.py b/vllm/compilation/fusion.py index cde27bd1..0c3d8697 100644 --- a/vllm/compilation/fusion.py +++ b/vllm/compilation/fusion.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, Dict, List, NamedTuple, Optional, Tuple import torch diff --git a/vllm/compilation/fx_utils.py b/vllm/compilation/fx_utils.py index 924e26f2..b9a8d311 100644 --- a/vllm/compilation/fx_utils.py +++ b/vllm/compilation/fx_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import operator from typing import Iterable, Optional diff --git a/vllm/compilation/inductor_pass.py b/vllm/compilation/inductor_pass.py index f6846c08..be663946 100644 --- a/vllm/compilation/inductor_pass.py +++ b/vllm/compilation/inductor_pass.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import hashlib import inspect import types diff --git a/vllm/compilation/monitor.py b/vllm/compilation/monitor.py index b97e4041..786c7c1e 100644 --- a/vllm/compilation/monitor.py +++ b/vllm/compilation/monitor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import time diff --git a/vllm/compilation/multi_output_match.py b/vllm/compilation/multi_output_match.py index b6bcecdc..e6f6a60b 100644 --- a/vllm/compilation/multi_output_match.py +++ b/vllm/compilation/multi_output_match.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import abc import operator from abc import abstractmethod diff --git a/vllm/compilation/pass_manager.py b/vllm/compilation/pass_manager.py index 34f5f355..c7387fb7 100644 --- a/vllm/compilation/pass_manager.py +++ b/vllm/compilation/pass_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List from torch import fx as fx diff --git a/vllm/compilation/reshapes.py b/vllm/compilation/reshapes.py index ba28b1f0..292baae8 100644 --- a/vllm/compilation/reshapes.py +++ b/vllm/compilation/reshapes.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Union import torch.fx diff --git a/vllm/compilation/vllm_inductor_pass.py b/vllm/compilation/vllm_inductor_pass.py index b8c52a7f..1d2597e4 100644 --- a/vllm/compilation/vllm_inductor_pass.py +++ b/vllm/compilation/vllm_inductor_pass.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time import torch diff --git a/vllm/compilation/wrapper.py b/vllm/compilation/wrapper.py index 58a8fa76..a8a283dd 100644 --- a/vllm/compilation/wrapper.py +++ b/vllm/compilation/wrapper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import sys from abc import abstractmethod diff --git a/vllm/config.py b/vllm/config.py index a13700ab..d2d59c70 100644 --- a/vllm/config.py +++ b/vllm/config.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import ast import copy import enum diff --git a/vllm/connections.py b/vllm/connections.py index 4c9f4f40..dc060bb6 100644 --- a/vllm/connections.py +++ b/vllm/connections.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Mapping, MutableMapping, Optional from urllib.parse import urlparse diff --git a/vllm/core/block/block_table.py b/vllm/core/block/block_table.py index 90c1438e..d4d31c58 100644 --- a/vllm/core/block/block_table.py +++ b/vllm/core/block/block_table.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from typing import List, Optional diff --git a/vllm/core/block/common.py b/vllm/core/block/common.py index 115f663e..1966eac1 100644 --- a/vllm/core/block/common.py +++ b/vllm/core/block/common.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import deque from dataclasses import dataclass from typing import Deque, Dict, Iterable, List, Optional, Protocol, Tuple diff --git a/vllm/core/block/cpu_gpu_block_allocator.py b/vllm/core/block/cpu_gpu_block_allocator.py index c3e1665b..359b5b26 100644 --- a/vllm/core/block/cpu_gpu_block_allocator.py +++ b/vllm/core/block/cpu_gpu_block_allocator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, FrozenSet, List, Optional, Tuple from vllm.core.block.interfaces import (Block, BlockAllocator, BlockId, diff --git a/vllm/core/block/interfaces.py b/vllm/core/block/interfaces.py index cb432db9..0b0197de 100644 --- a/vllm/core/block/interfaces.py +++ b/vllm/core/block/interfaces.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import Dict, FrozenSet, List, Optional, Protocol, Tuple diff --git a/vllm/core/block/naive_block.py b/vllm/core/block/naive_block.py index c38ae2dd..c388366b 100644 --- a/vllm/core/block/naive_block.py +++ b/vllm/core/block/naive_block.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import deque from typing import Deque, FrozenSet, Iterable, List, Optional, Tuple, Union diff --git a/vllm/core/block/prefix_caching_block.py b/vllm/core/block/prefix_caching_block.py index ccdc5daa..fbf19e1b 100644 --- a/vllm/core/block/prefix_caching_block.py +++ b/vllm/core/block/prefix_caching_block.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Token blocks.""" import sys from bisect import bisect_left diff --git a/vllm/core/block/utils.py b/vllm/core/block/utils.py index 1c6578e4..910afdd9 100644 --- a/vllm/core/block/utils.py +++ b/vllm/core/block/utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Block manager utils.""" from vllm.sequence import SequenceGroup from vllm.utils import (STR_NOT_IMPL_ENC_DEC_PREFIX_CACHE, diff --git a/vllm/core/block_manager.py b/vllm/core/block_manager.py index 2d6a132e..c5b3b04f 100644 --- a/vllm/core/block_manager.py +++ b/vllm/core/block_manager.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A block manager that manages token blocks.""" from typing import Dict, List, Optional from typing import Sequence as GenericSequence diff --git a/vllm/core/evictor.py b/vllm/core/evictor.py index c9306518..0e363edd 100644 --- a/vllm/core/evictor.py +++ b/vllm/core/evictor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum import heapq from abc import ABC, abstractmethod diff --git a/vllm/core/interfaces.py b/vllm/core/interfaces.py index 9c7e246e..b48ba87e 100644 --- a/vllm/core/interfaces.py +++ b/vllm/core/interfaces.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum from abc import ABC, abstractmethod from typing import List diff --git a/vllm/core/placeholder_block_space_manager.py b/vllm/core/placeholder_block_space_manager.py index f9924be4..70c22afa 100644 --- a/vllm/core/placeholder_block_space_manager.py +++ b/vllm/core/placeholder_block_space_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Tuple from vllm.core.interfaces import AllocStatus, BlockSpaceManager diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index 2bb96148..f507847a 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum import os import random diff --git a/vllm/device_allocator/cumem.py b/vllm/device_allocator/cumem.py index a43418db..f74ad9ac 100644 --- a/vllm/device_allocator/cumem.py +++ b/vllm/device_allocator/cumem.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # cumem-based pytorch pluggable allocator to implement sleep mode. # other approaches tried but failed: # - cuda-python package binding diff --git a/vllm/distributed/__init__.py b/vllm/distributed/__init__.py index db325cfa..39955dda 100644 --- a/vllm/distributed/__init__.py +++ b/vllm/distributed/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .communication_op import * from .parallel_state import * from .utils import * diff --git a/vllm/distributed/communication_op.py b/vllm/distributed/communication_op.py index e13505dc..0228264f 100644 --- a/vllm/distributed/communication_op.py +++ b/vllm/distributed/communication_op.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, Optional, Union import torch diff --git a/vllm/distributed/device_communicators/cuda_wrapper.py b/vllm/distributed/device_communicators/cuda_wrapper.py index d5a53381..010caf7e 100644 --- a/vllm/distributed/device_communicators/cuda_wrapper.py +++ b/vllm/distributed/device_communicators/cuda_wrapper.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """This file is a pure Python wrapper for the cudart library. It avoids the need to compile a separate shared library, and is convenient for use when we just need to call a few functions. diff --git a/vllm/distributed/device_communicators/custom_all_reduce.py b/vllm/distributed/device_communicators/custom_all_reduce.py index 62929dc0..a2614ed5 100644 --- a/vllm/distributed/device_communicators/custom_all_reduce.py +++ b/vllm/distributed/device_communicators/custom_all_reduce.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import ctypes from contextlib import contextmanager from typing import List, Optional, Union diff --git a/vllm/distributed/device_communicators/custom_all_reduce_utils.py b/vllm/distributed/device_communicators/custom_all_reduce_utils.py index 1f78e10c..d8d6eed2 100644 --- a/vllm/distributed/device_communicators/custom_all_reduce_utils.py +++ b/vllm/distributed/device_communicators/custom_all_reduce_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import ctypes import json import os diff --git a/vllm/distributed/device_communicators/hpu_communicator.py b/vllm/distributed/device_communicators/hpu_communicator.py index cc9b19ce..3f85da98 100644 --- a/vllm/distributed/device_communicators/hpu_communicator.py +++ b/vllm/distributed/device_communicators/hpu_communicator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch import torch.distributed as dist from torch.distributed import ProcessGroup diff --git a/vllm/distributed/device_communicators/pynccl.py b/vllm/distributed/device_communicators/pynccl.py index efc59987..0ccd4231 100644 --- a/vllm/distributed/device_communicators/pynccl.py +++ b/vllm/distributed/device_communicators/pynccl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Union # ===================== import region ===================== diff --git a/vllm/distributed/device_communicators/pynccl_wrapper.py b/vllm/distributed/device_communicators/pynccl_wrapper.py index 7dea61b6..03c3b0be 100644 --- a/vllm/distributed/device_communicators/pynccl_wrapper.py +++ b/vllm/distributed/device_communicators/pynccl_wrapper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # This file is a pure Python wrapper for the NCCL library. # The main purpose is to use NCCL combined with CUDA graph. # Before writing this script, we tried the following approach: diff --git a/vllm/distributed/device_communicators/shm_broadcast.py b/vllm/distributed/device_communicators/shm_broadcast.py index 268edc09..48ac81ac 100644 --- a/vllm/distributed/device_communicators/shm_broadcast.py +++ b/vllm/distributed/device_communicators/shm_broadcast.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pickle import sys diff --git a/vllm/distributed/device_communicators/tpu_communicator.py b/vllm/distributed/device_communicators/tpu_communicator.py index 765a0f9c..7af7c65f 100644 --- a/vllm/distributed/device_communicators/tpu_communicator.py +++ b/vllm/distributed/device_communicators/tpu_communicator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import torch diff --git a/vllm/distributed/device_communicators/xpu_communicator.py b/vllm/distributed/device_communicators/xpu_communicator.py index eafd3c2f..79ccc101 100644 --- a/vllm/distributed/device_communicators/xpu_communicator.py +++ b/vllm/distributed/device_communicators/xpu_communicator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch import torch.distributed as dist from torch.distributed import ProcessGroup diff --git a/vllm/distributed/kv_transfer/kv_connector/base.py b/vllm/distributed/kv_transfer/kv_connector/base.py index 6089e3ba..57c764b4 100644 --- a/vllm/distributed/kv_transfer/kv_connector/base.py +++ b/vllm/distributed/kv_transfer/kv_connector/base.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ KVConnectorBase Class for Distributed KV Cache & Hidden State communication diff --git a/vllm/distributed/kv_transfer/kv_connector/factory.py b/vllm/distributed/kv_transfer/kv_connector/factory.py index 6372dab7..fe480533 100644 --- a/vllm/distributed/kv_transfer/kv_connector/factory.py +++ b/vllm/distributed/kv_transfer/kv_connector/factory.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import importlib from typing import TYPE_CHECKING, Callable, Dict, Type diff --git a/vllm/distributed/kv_transfer/kv_connector/simple_connector.py b/vllm/distributed/kv_transfer/kv_connector/simple_connector.py index 7780e2df..2033e976 100644 --- a/vllm/distributed/kv_transfer/kv_connector/simple_connector.py +++ b/vllm/distributed/kv_transfer/kv_connector/simple_connector.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Simple KV Cache Connector for Distributed Machine Learning Inference diff --git a/vllm/distributed/kv_transfer/kv_lookup_buffer/base.py b/vllm/distributed/kv_transfer/kv_lookup_buffer/base.py index bad119a1..845da7c5 100644 --- a/vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +++ b/vllm/distributed/kv_transfer/kv_lookup_buffer/base.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This file contains a new class `KVLookupBufferBase` that allows developers to think of KV cache operations as inserting new KV cache entries (`insert`) diff --git a/vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py b/vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py index fe8d8d73..5e1b6235 100644 --- a/vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +++ b/vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Implements a distributed key-value (KV) cache transfer mechanism. diff --git a/vllm/distributed/kv_transfer/kv_pipe/base.py b/vllm/distributed/kv_transfer/kv_pipe/base.py index 4b0cb44c..40589fb3 100644 --- a/vllm/distributed/kv_transfer/kv_pipe/base.py +++ b/vllm/distributed/kv_transfer/kv_pipe/base.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This file defines an interface `KVPipeBase` that provides an abstraction for sending and receiving tensors, or None, via diff --git a/vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py b/vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py index 8e435867..58ab7f0b 100644 --- a/vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py +++ b/vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import os import pickle diff --git a/vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py b/vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py index 98222fa6..7aa53d07 100644 --- a/vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +++ b/vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This module implements a PyNccl pipe for sending and receiving Optional[torch.Tensor] between distributed ranks with advanced diff --git a/vllm/distributed/kv_transfer/kv_transfer_agent.py b/vllm/distributed/kv_transfer/kv_transfer_agent.py index 9ce97851..1e80e0bd 100644 --- a/vllm/distributed/kv_transfer/kv_transfer_agent.py +++ b/vllm/distributed/kv_transfer/kv_transfer_agent.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A centralized entrypoint to perform distributed KV cache transfer. This implementation is a shim wrapper on two APIs exposed by `kv_connector`: diff --git a/vllm/distributed/parallel_state.py b/vllm/distributed/parallel_state.py index 7fe9b68d..c5c5dfbb 100644 --- a/vllm/distributed/parallel_state.py +++ b/vllm/distributed/parallel_state.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2023 The vLLM team. # Adapted from # https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/core/parallel_state.py diff --git a/vllm/distributed/utils.py b/vllm/distributed/utils.py index dcfcb848..84f8c0a8 100644 --- a/vllm/distributed/utils.py +++ b/vllm/distributed/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2023 The vLLM team. # Adapted from # https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/core/tensor_parallel/utils.py diff --git a/vllm/engine/arg_utils.py b/vllm/engine/arg_utils.py index cc7c99e5..7c0e8c21 100644 --- a/vllm/engine/arg_utils.py +++ b/vllm/engine/arg_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import dataclasses import json diff --git a/vllm/engine/async_llm_engine.py b/vllm/engine/async_llm_engine.py index 739ea06a..053635a2 100644 --- a/vllm/engine/async_llm_engine.py +++ b/vllm/engine/async_llm_engine.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import copy import time diff --git a/vllm/engine/async_timeout.py b/vllm/engine/async_timeout.py index 4b184262..aa54c069 100644 --- a/vllm/engine/async_timeout.py +++ b/vllm/engine/async_timeout.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Workaround for https://github.com/python/cpython/issues/86296 # # From https://github.com/aio-libs/async-timeout/blob/master/async_timeout/__init__.py diff --git a/vllm/engine/llm_engine.py b/vllm/engine/llm_engine.py index dd677300..d82d9ad9 100644 --- a/vllm/engine/llm_engine.py +++ b/vllm/engine/llm_engine.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import copy import time from collections import Counter as collectionsCounter diff --git a/vllm/engine/metrics.py b/vllm/engine/metrics.py index b771c190..ce806b4a 100644 --- a/vllm/engine/metrics.py +++ b/vllm/engine/metrics.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from typing import TYPE_CHECKING from typing import Counter as CollectionsCounter diff --git a/vllm/engine/metrics_types.py b/vllm/engine/metrics_types.py index 5c7a430d..7f0c2fa7 100644 --- a/vllm/engine/metrics_types.py +++ b/vllm/engine/metrics_types.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ These types are defined in this file to avoid importing vllm.engine.metrics and therefore importing prometheus_client. diff --git a/vllm/engine/multiprocessing/__init__.py b/vllm/engine/multiprocessing/__init__.py index d9703b82..3cf1850e 100644 --- a/vllm/engine/multiprocessing/__init__.py +++ b/vllm/engine/multiprocessing/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import uuid from dataclasses import dataclass, field from enum import Enum diff --git a/vllm/engine/multiprocessing/client.py b/vllm/engine/multiprocessing/client.py index 5237f63c..85b5f31e 100644 --- a/vllm/engine/multiprocessing/client.py +++ b/vllm/engine/multiprocessing/client.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import copy import pickle diff --git a/vllm/engine/multiprocessing/engine.py b/vllm/engine/multiprocessing/engine.py index 166f8974..a0dd7958 100644 --- a/vllm/engine/multiprocessing/engine.py +++ b/vllm/engine/multiprocessing/engine.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pickle import signal from contextlib import contextmanager diff --git a/vllm/engine/output_processor/interfaces.py b/vllm/engine/output_processor/interfaces.py index 50adaf4e..4c8e295c 100644 --- a/vllm/engine/output_processor/interfaces.py +++ b/vllm/engine/output_processor/interfaces.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import Callable, List diff --git a/vllm/engine/output_processor/multi_step.py b/vllm/engine/output_processor/multi_step.py index 99c2baf3..8ceef855 100644 --- a/vllm/engine/output_processor/multi_step.py +++ b/vllm/engine/output_processor/multi_step.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import functools from typing import Callable, List, cast diff --git a/vllm/engine/output_processor/single_step.py b/vllm/engine/output_processor/single_step.py index 55c56abe..4d96791a 100644 --- a/vllm/engine/output_processor/single_step.py +++ b/vllm/engine/output_processor/single_step.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List from vllm.config import SchedulerConfig diff --git a/vllm/engine/output_processor/stop_checker.py b/vllm/engine/output_processor/stop_checker.py index 4b701f81..3bca0bee 100644 --- a/vllm/engine/output_processor/stop_checker.py +++ b/vllm/engine/output_processor/stop_checker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional, Tuple from vllm.lora.request import LoRARequest diff --git a/vllm/engine/output_processor/util.py b/vllm/engine/output_processor/util.py index 770982a2..0d2b58c1 100644 --- a/vllm/engine/output_processor/util.py +++ b/vllm/engine/output_processor/util.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List from typing import Sequence as GenericSequence from typing import cast diff --git a/vllm/engine/protocol.py b/vllm/engine/protocol.py index de7b2c1b..d1112558 100644 --- a/vllm/engine/protocol.py +++ b/vllm/engine/protocol.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from abc import ABC, abstractmethod from typing import AsyncGenerator, List, Mapping, Optional diff --git a/vllm/entrypoints/api_server.py b/vllm/entrypoints/api_server.py index daefbff7..96818507 100644 --- a/vllm/entrypoints/api_server.py +++ b/vllm/entrypoints/api_server.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ NOTE: This API server is used only for demonstrating usage of AsyncEngine and simple performance benchmarks. It is not intended for production use. diff --git a/vllm/entrypoints/chat_utils.py b/vllm/entrypoints/chat_utils.py index 97d2561d..3a6e75b1 100644 --- a/vllm/entrypoints/chat_utils.py +++ b/vllm/entrypoints/chat_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import codecs import json diff --git a/vllm/entrypoints/launcher.py b/vllm/entrypoints/launcher.py index 5dcf50bd..351a3952 100644 --- a/vllm/entrypoints/launcher.py +++ b/vllm/entrypoints/launcher.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import signal from http import HTTPStatus diff --git a/vllm/entrypoints/llm.py b/vllm/entrypoints/llm.py index 46b595b0..d071a0b3 100644 --- a/vllm/entrypoints/llm.py +++ b/vllm/entrypoints/llm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools import warnings from contextlib import contextmanager diff --git a/vllm/entrypoints/logger.py b/vllm/entrypoints/logger.py index 584ee0d9..e82b6ba6 100644 --- a/vllm/entrypoints/logger.py +++ b/vllm/entrypoints/logger.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Union from vllm.logger import init_logger diff --git a/vllm/entrypoints/openai/api_server.py b/vllm/entrypoints/openai/api_server.py index 9e5cf4ba..b8f54d6c 100644 --- a/vllm/entrypoints/openai/api_server.py +++ b/vllm/entrypoints/openai/api_server.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import atexit import gc diff --git a/vllm/entrypoints/openai/cli_args.py b/vllm/entrypoints/openai/cli_args.py index 9cfe07c6..3054958f 100644 --- a/vllm/entrypoints/openai/cli_args.py +++ b/vllm/entrypoints/openai/cli_args.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This file contains the command line arguments for the vLLM's OpenAI-compatible server. It is kept in a separate file for documentation diff --git a/vllm/entrypoints/openai/logits_processors.py b/vllm/entrypoints/openai/logits_processors.py index c8132811..41e5eef4 100644 --- a/vllm/entrypoints/openai/logits_processors.py +++ b/vllm/entrypoints/openai/logits_processors.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import lru_cache, partial from typing import Dict, FrozenSet, Iterable, List, Optional, Union diff --git a/vllm/entrypoints/openai/protocol.py b/vllm/entrypoints/openai/protocol.py index 29d071ce..83b84182 100644 --- a/vllm/entrypoints/openai/protocol.py +++ b/vllm/entrypoints/openai/protocol.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/lm-sys/FastChat/blob/168ccc29d3f7edc50823016105c024fe2282732a/fastchat/protocol/openai_api_protocol.py import re diff --git a/vllm/entrypoints/openai/reasoning_parsers/__init__.py b/vllm/entrypoints/openai/reasoning_parsers/__init__.py index a21bff52..80354d69 100644 --- a/vllm/entrypoints/openai/reasoning_parsers/__init__.py +++ b/vllm/entrypoints/openai/reasoning_parsers/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .abs_reasoning_parsers import ReasoningParser, ReasoningParserManager from .deepseek_r1_reasoning_parser import DeepSeekR1ReasoningParser diff --git a/vllm/entrypoints/openai/reasoning_parsers/abs_reasoning_parsers.py b/vllm/entrypoints/openai/reasoning_parsers/abs_reasoning_parsers.py index e5d10ee0..b5df7e47 100644 --- a/vllm/entrypoints/openai/reasoning_parsers/abs_reasoning_parsers.py +++ b/vllm/entrypoints/openai/reasoning_parsers/abs_reasoning_parsers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from functools import cached_property from typing import Callable, Dict, List, Optional, Sequence, Tuple, Type, Union diff --git a/vllm/entrypoints/openai/reasoning_parsers/deepseek_r1_reasoning_parser.py b/vllm/entrypoints/openai/reasoning_parsers/deepseek_r1_reasoning_parser.py index a440ddc8..5c19888d 100644 --- a/vllm/entrypoints/openai/reasoning_parsers/deepseek_r1_reasoning_parser.py +++ b/vllm/entrypoints/openai/reasoning_parsers/deepseek_r1_reasoning_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import re from typing import Optional, Sequence, Tuple, Union diff --git a/vllm/entrypoints/openai/run_batch.py b/vllm/entrypoints/openai/run_batch.py index 37ae2350..675d3cdc 100644 --- a/vllm/entrypoints/openai/run_batch.py +++ b/vllm/entrypoints/openai/run_batch.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from http import HTTPStatus from io import StringIO diff --git a/vllm/entrypoints/openai/serving_chat.py b/vllm/entrypoints/openai/serving_chat.py index dc97f0eb..107220d5 100644 --- a/vllm/entrypoints/openai/serving_chat.py +++ b/vllm/entrypoints/openai/serving_chat.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import json import time diff --git a/vllm/entrypoints/openai/serving_completion.py b/vllm/entrypoints/openai/serving_completion.py index 13c39263..e7ad263e 100644 --- a/vllm/entrypoints/openai/serving_completion.py +++ b/vllm/entrypoints/openai/serving_completion.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import time from typing import AsyncGenerator, AsyncIterator, Dict, List, Optional diff --git a/vllm/entrypoints/openai/serving_embedding.py b/vllm/entrypoints/openai/serving_embedding.py index e7116a3d..45f8ad90 100644 --- a/vllm/entrypoints/openai/serving_embedding.py +++ b/vllm/entrypoints/openai/serving_embedding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import base64 import time diff --git a/vllm/entrypoints/openai/serving_engine.py b/vllm/entrypoints/openai/serving_engine.py index 8d54164e..8d39fdcb 100644 --- a/vllm/entrypoints/openai/serving_engine.py +++ b/vllm/entrypoints/openai/serving_engine.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json from concurrent.futures.thread import ThreadPoolExecutor from http import HTTPStatus diff --git a/vllm/entrypoints/openai/serving_models.py b/vllm/entrypoints/openai/serving_models.py index 22e74b38..f917a485 100644 --- a/vllm/entrypoints/openai/serving_models.py +++ b/vllm/entrypoints/openai/serving_models.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import pathlib from dataclasses import dataclass diff --git a/vllm/entrypoints/openai/serving_pooling.py b/vllm/entrypoints/openai/serving_pooling.py index 58303220..01a3d211 100644 --- a/vllm/entrypoints/openai/serving_pooling.py +++ b/vllm/entrypoints/openai/serving_pooling.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import base64 import time diff --git a/vllm/entrypoints/openai/serving_rerank.py b/vllm/entrypoints/openai/serving_rerank.py index be442026..366df712 100644 --- a/vllm/entrypoints/openai/serving_rerank.py +++ b/vllm/entrypoints/openai/serving_rerank.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from typing import Any, AsyncGenerator, Dict, List, Optional, Union, cast diff --git a/vllm/entrypoints/openai/serving_score.py b/vllm/entrypoints/openai/serving_score.py index 381edf8f..832aa851 100644 --- a/vllm/entrypoints/openai/serving_score.py +++ b/vllm/entrypoints/openai/serving_score.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import time from typing import Any, AsyncGenerator, Dict, List, Optional, Union, cast diff --git a/vllm/entrypoints/openai/serving_tokenization.py b/vllm/entrypoints/openai/serving_tokenization.py index b67ecfb0..6c79adf9 100644 --- a/vllm/entrypoints/openai/serving_tokenization.py +++ b/vllm/entrypoints/openai/serving_tokenization.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Final, List, Optional, Union from fastapi import Request diff --git a/vllm/entrypoints/openai/tool_parsers/__init__.py b/vllm/entrypoints/openai/tool_parsers/__init__.py index 2850349a..d1c3afa6 100644 --- a/vllm/entrypoints/openai/tool_parsers/__init__.py +++ b/vllm/entrypoints/openai/tool_parsers/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .abstract_tool_parser import ToolParser, ToolParserManager from .granite_20b_fc_tool_parser import Granite20bFCToolParser from .granite_tool_parser import GraniteToolParser diff --git a/vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py index aa7c2010..7cdd6d4c 100644 --- a/vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from functools import cached_property from typing import Callable, Dict, List, Optional, Sequence, Type, Union diff --git a/vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py index 93e357e8..002bf173 100644 --- a/vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import re from json import JSONDecoder diff --git a/vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py index 8aefcd8d..c948ed78 100644 --- a/vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json from typing import Dict, Sequence, Union diff --git a/vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py index 869d15ac..4841b287 100644 --- a/vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import re from typing import Dict, List, Sequence, Union diff --git a/vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py index cb391e11..b9215e79 100644 --- a/vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json from typing import Dict, Sequence, Union diff --git a/vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py index cfd02485..7c4d63e1 100644 --- a/vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import re from typing import Dict, List, Sequence, Union diff --git a/vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py index 1856308b..6a7b1136 100644 --- a/vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import re from json import JSONDecoder diff --git a/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py index bada805d..51354f7c 100644 --- a/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json import re from random import choices diff --git a/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py index 26da4d68..5c282b5c 100644 --- a/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import ast import json import re diff --git a/vllm/entrypoints/openai/tool_parsers/utils.py b/vllm/entrypoints/openai/tool_parsers/utils.py index 5e4eb23b..945cbd68 100644 --- a/vllm/entrypoints/openai/tool_parsers/utils.py +++ b/vllm/entrypoints/openai/tool_parsers/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import json from json import JSONDecodeError, JSONDecoder from typing import Any, List, Tuple diff --git a/vllm/entrypoints/utils.py b/vllm/entrypoints/utils.py index e8a78d21..9af37871 100644 --- a/vllm/entrypoints/utils.py +++ b/vllm/entrypoints/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import functools diff --git a/vllm/envs.py b/vllm/envs.py index 25098070..78ee3047 100644 --- a/vllm/envs.py +++ b/vllm/envs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import tempfile from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional diff --git a/vllm/executor/executor_base.py b/vllm/executor/executor_base.py index 471d1bfa..fb76276b 100644 --- a/vllm/executor/executor_base.py +++ b/vllm/executor/executor_base.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from abc import ABC, abstractmethod from typing import (Any, Awaitable, Callable, Dict, List, Optional, Set, Tuple, diff --git a/vllm/executor/mp_distributed_executor.py b/vllm/executor/mp_distributed_executor.py index 78c86321..d1f8c36f 100644 --- a/vllm/executor/mp_distributed_executor.py +++ b/vllm/executor/mp_distributed_executor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os from typing import Any, Callable, List, Optional, Union diff --git a/vllm/executor/msgspec_utils.py b/vllm/executor/msgspec_utils.py index c467115f..e680d53c 100644 --- a/vllm/executor/msgspec_utils.py +++ b/vllm/executor/msgspec_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from array import array from typing import Any, Type diff --git a/vllm/executor/multiproc_worker_utils.py b/vllm/executor/multiproc_worker_utils.py index 539b6ae2..cef6a994 100644 --- a/vllm/executor/multiproc_worker_utils.py +++ b/vllm/executor/multiproc_worker_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os import sys diff --git a/vllm/executor/ray_distributed_executor.py b/vllm/executor/ray_distributed_executor.py index 2afd99f9..80e7a1c4 100644 --- a/vllm/executor/ray_distributed_executor.py +++ b/vllm/executor/ray_distributed_executor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os from collections import defaultdict diff --git a/vllm/executor/ray_utils.py b/vllm/executor/ray_utils.py index e55155ea..5d5cc839 100644 --- a/vllm/executor/ray_utils.py +++ b/vllm/executor/ray_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import time from collections import defaultdict diff --git a/vllm/executor/uniproc_executor.py b/vllm/executor/uniproc_executor.py index a5c4dcf0..dcb4a8f2 100644 --- a/vllm/executor/uniproc_executor.py +++ b/vllm/executor/uniproc_executor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import Any, Callable, Dict, List, Optional, Tuple, Union diff --git a/vllm/forward_context.py b/vllm/forward_context.py index 828b394e..10de8bc5 100644 --- a/vllm/forward_context.py +++ b/vllm/forward_context.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from collections import defaultdict from contextlib import contextmanager diff --git a/vllm/inputs/__init__.py b/vllm/inputs/__init__.py index a0dd89f6..6f8f2cd7 100644 --- a/vllm/inputs/__init__.py +++ b/vllm/inputs/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .data import (DecoderOnlyInputs, EncoderDecoderInputs, ExplicitEncoderDecoderPrompt, ProcessorInputs, PromptType, SingletonInputs, SingletonInputsAdapter, SingletonPrompt, diff --git a/vllm/inputs/data.py b/vllm/inputs/data.py index 57e85779..2ffebeee 100644 --- a/vllm/inputs/data.py +++ b/vllm/inputs/data.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from functools import cached_property from typing import (TYPE_CHECKING, Any, Dict, Generic, Iterable, List, Literal, diff --git a/vllm/inputs/parse.py b/vllm/inputs/parse.py index 09f1ff2c..454d9d83 100644 --- a/vllm/inputs/parse.py +++ b/vllm/inputs/parse.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Literal, Sequence, TypedDict, Union, cast, overload from typing_extensions import TypeIs diff --git a/vllm/inputs/preprocess.py b/vllm/inputs/preprocess.py index 70372e0c..4d8f28cb 100644 --- a/vllm/inputs/preprocess.py +++ b/vllm/inputs/preprocess.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from typing import List, Mapping, Optional, Union diff --git a/vllm/inputs/registry.py b/vllm/inputs/registry.py index 4b73ade7..0ec726b8 100644 --- a/vllm/inputs/registry.py +++ b/vllm/inputs/registry.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import functools from collections import UserDict from dataclasses import dataclass diff --git a/vllm/logger.py b/vllm/logger.py index cac174f7..b20d55e3 100644 --- a/vllm/logger.py +++ b/vllm/logger.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Logging configuration for vLLM.""" import datetime import json diff --git a/vllm/logging_utils/__init__.py b/vllm/logging_utils/__init__.py index 576ccf78..7ab46325 100644 --- a/vllm/logging_utils/__init__.py +++ b/vllm/logging_utils/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.logging_utils.formatter import NewLineFormatter __all__ = [ diff --git a/vllm/logging_utils/formatter.py b/vllm/logging_utils/formatter.py index b24b4e11..010b0a12 100644 --- a/vllm/logging_utils/formatter.py +++ b/vllm/logging_utils/formatter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import logging diff --git a/vllm/logits_process.py b/vllm/logits_process.py index 7716ccd2..d02072e8 100644 --- a/vllm/logits_process.py +++ b/vllm/logits_process.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Tuple, Union import torch diff --git a/vllm/lora/fully_sharded_layers.py b/vllm/lora/fully_sharded_layers.py index 545ec21c..3d662081 100644 --- a/vllm/lora/fully_sharded_layers.py +++ b/vllm/lora/fully_sharded_layers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # pylint: disable=unused-argument from typing import TYPE_CHECKING, List, Optional, Tuple, Union, cast diff --git a/vllm/lora/layers.py b/vllm/lora/layers.py index cdd439d0..9f029759 100644 --- a/vllm/lora/layers.py +++ b/vllm/lora/layers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # pylint: disable=unused-argument import math from dataclasses import dataclass diff --git a/vllm/lora/lora.py b/vllm/lora/lora.py index 93ad4651..00299bf6 100644 --- a/vllm/lora/lora.py +++ b/vllm/lora/lora.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional from typing import Sequence as GenericSequence diff --git a/vllm/lora/models.py b/vllm/lora/models.py index 2e04cb90..ef77fd4b 100644 --- a/vllm/lora/models.py +++ b/vllm/lora/models.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import copy import math import os diff --git a/vllm/lora/ops/torch_ops/__init__.py b/vllm/lora/ops/torch_ops/__init__.py index 9c9159b9..85601d58 100644 --- a/vllm/lora/ops/torch_ops/__init__.py +++ b/vllm/lora/ops/torch_ops/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.lora.ops.torch_ops.lora_ops import bgmv_expand # noqa: F401 from vllm.lora.ops.torch_ops.lora_ops import (bgmv_expand_slice, bgmv_shrink, sgmv_expand, sgmv_expand_slice, diff --git a/vllm/lora/ops/torch_ops/lora_ops.py b/vllm/lora/ops/torch_ops/lora_ops.py index 5f5aafd5..af79f984 100644 --- a/vllm/lora/ops/torch_ops/lora_ops.py +++ b/vllm/lora/ops/torch_ops/lora_ops.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch diff --git a/vllm/lora/ops/triton_ops/__init__.py b/vllm/lora/ops/triton_ops/__init__.py index 9805b6dd..dc440f73 100644 --- a/vllm/lora/ops/triton_ops/__init__.py +++ b/vllm/lora/ops/triton_ops/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.lora.ops.triton_ops.bgmv_expand import bgmv_expand from vllm.lora.ops.triton_ops.bgmv_expand_slice import bgmv_expand_slice from vllm.lora.ops.triton_ops.bgmv_shrink import bgmv_shrink diff --git a/vllm/lora/ops/triton_ops/bgmv_expand.py b/vllm/lora/ops/triton_ops/bgmv_expand.py index 42adb191..98510b39 100644 --- a/vllm/lora/ops/triton_ops/bgmv_expand.py +++ b/vllm/lora/ops/triton_ops/bgmv_expand.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Based on: Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., & Krishnamurthy, A. (2023). diff --git a/vllm/lora/ops/triton_ops/bgmv_expand_slice.py b/vllm/lora/ops/triton_ops/bgmv_expand_slice.py index f397d752..48804123 100644 --- a/vllm/lora/ops/triton_ops/bgmv_expand_slice.py +++ b/vllm/lora/ops/triton_ops/bgmv_expand_slice.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Based on: Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., & Krishnamurthy, A. (2023). diff --git a/vllm/lora/ops/triton_ops/bgmv_shrink.py b/vllm/lora/ops/triton_ops/bgmv_shrink.py index f3ef01d3..227a5765 100644 --- a/vllm/lora/ops/triton_ops/bgmv_shrink.py +++ b/vllm/lora/ops/triton_ops/bgmv_shrink.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Based on: Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., & Krishnamurthy, A. (2023). diff --git a/vllm/lora/ops/triton_ops/sgmv_expand.py b/vllm/lora/ops/triton_ops/sgmv_expand.py index 48fa5cd6..a8e71cac 100644 --- a/vllm/lora/ops/triton_ops/sgmv_expand.py +++ b/vllm/lora/ops/triton_ops/sgmv_expand.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Based on: Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., & Krishnamurthy, A. (2023). diff --git a/vllm/lora/ops/triton_ops/sgmv_shrink.py b/vllm/lora/ops/triton_ops/sgmv_shrink.py index 9bb35e8f..8b26583c 100644 --- a/vllm/lora/ops/triton_ops/sgmv_shrink.py +++ b/vllm/lora/ops/triton_ops/sgmv_shrink.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Based on: Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., & Krishnamurthy, A. (2023). diff --git a/vllm/lora/ops/triton_ops/utils.py b/vllm/lora/ops/triton_ops/utils.py index 7df5bc2c..78409b91 100644 --- a/vllm/lora/ops/triton_ops/utils.py +++ b/vllm/lora/ops/triton_ops/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import functools from typing import Dict, List, Tuple diff --git a/vllm/lora/peft_helper.py b/vllm/lora/peft_helper.py index b9c506f6..9496ab5a 100644 --- a/vllm/lora/peft_helper.py +++ b/vllm/lora/peft_helper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from: https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/config.py import json diff --git a/vllm/lora/punica_wrapper/__init__.py b/vllm/lora/punica_wrapper/__init__.py index 48ada392..915fc662 100644 --- a/vllm/lora/punica_wrapper/__init__.py +++ b/vllm/lora/punica_wrapper/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.lora.punica_wrapper.punica_base import PunicaWrapperBase from vllm.lora.punica_wrapper.punica_selector import get_punica_wrapper diff --git a/vllm/lora/punica_wrapper/punica_base.py b/vllm/lora/punica_wrapper/punica_base.py index b9ec0c4b..1a2282ae 100644 --- a/vllm/lora/punica_wrapper/punica_base.py +++ b/vllm/lora/punica_wrapper/punica_base.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Based on: Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., & Krishnamurthy, A. (2023). diff --git a/vllm/lora/punica_wrapper/punica_cpu.py b/vllm/lora/punica_wrapper/punica_cpu.py index b9ae3e07..29428f4c 100644 --- a/vllm/lora/punica_wrapper/punica_cpu.py +++ b/vllm/lora/punica_wrapper/punica_cpu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, Optional, Tuple, Union import torch diff --git a/vllm/lora/punica_wrapper/punica_gpu.py b/vllm/lora/punica_wrapper/punica_gpu.py index 451f23e4..9ccd9c36 100644 --- a/vllm/lora/punica_wrapper/punica_gpu.py +++ b/vllm/lora/punica_wrapper/punica_gpu.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Based on: Chen, L., Ye, Z., Wu, Y., Zhuo, D., Ceze, L., & Krishnamurthy, A. (2023). diff --git a/vllm/lora/punica_wrapper/punica_hpu.py b/vllm/lora/punica_wrapper/punica_hpu.py index d9c4f44a..51e1bfab 100644 --- a/vllm/lora/punica_wrapper/punica_hpu.py +++ b/vllm/lora/punica_wrapper/punica_hpu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple, Union, final import torch diff --git a/vllm/lora/punica_wrapper/punica_selector.py b/vllm/lora/punica_wrapper/punica_selector.py index a2932246..ad5d4b78 100644 --- a/vllm/lora/punica_wrapper/punica_selector.py +++ b/vllm/lora/punica_wrapper/punica_selector.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.logger import init_logger from vllm.platforms import current_platform from vllm.utils import resolve_obj_by_qualname diff --git a/vllm/lora/punica_wrapper/utils.py b/vllm/lora/punica_wrapper/utils.py index 7360c8c0..dbc2d27c 100644 --- a/vllm/lora/punica_wrapper/utils.py +++ b/vllm/lora/punica_wrapper/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import TYPE_CHECKING, List, Optional, Tuple, Union import torch diff --git a/vllm/lora/request.py b/vllm/lora/request.py index 5e3d2f0e..badfaa41 100644 --- a/vllm/lora/request.py +++ b/vllm/lora/request.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import warnings from typing import Optional diff --git a/vllm/lora/utils.py b/vllm/lora/utils.py index d72b7638..f47b0af1 100644 --- a/vllm/lora/utils.py +++ b/vllm/lora/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import re from typing import List, Optional, Set, Tuple, Type, Union diff --git a/vllm/lora/worker_manager.py b/vllm/lora/worker_manager.py index a64296f7..f33a7b88 100644 --- a/vllm/lora/worker_manager.py +++ b/vllm/lora/worker_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from contextlib import contextmanager from typing import Any, Dict, List, Literal, Optional, Set, Type, Union diff --git a/vllm/model_executor/__init__.py b/vllm/model_executor/__init__.py index 7278c7fb..76361521 100644 --- a/vllm/model_executor/__init__.py +++ b/vllm/model_executor/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.model_executor.parameter import (BasevLLMParameter, PackedvLLMParameter) from vllm.model_executor.sampling_metadata import (SamplingMetadata, diff --git a/vllm/model_executor/custom_op.py b/vllm/model_executor/custom_op.py index 96995c56..ee4f41ea 100644 --- a/vllm/model_executor/custom_op.py +++ b/vllm/model_executor/custom_op.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, Type import torch.nn as nn diff --git a/vllm/model_executor/guided_decoding/__init__.py b/vllm/model_executor/guided_decoding/__init__.py index 18b435a4..cf96461a 100644 --- a/vllm/model_executor/guided_decoding/__init__.py +++ b/vllm/model_executor/guided_decoding/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/vllm/model_executor/guided_decoding/guided_fields.py b/vllm/model_executor/guided_decoding/guided_fields.py index 8deb4c94..db4ce268 100644 --- a/vllm/model_executor/guided_decoding/guided_fields.py +++ b/vllm/model_executor/guided_decoding/guided_fields.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Dict, List, Optional, TypedDict, Union diff --git a/vllm/model_executor/guided_decoding/lm_format_enforcer_decoding.py b/vllm/model_executor/guided_decoding/lm_format_enforcer_decoding.py index a17e75a8..7eaf9e38 100644 --- a/vllm/model_executor/guided_decoding/lm_format_enforcer_decoding.py +++ b/vllm/model_executor/guided_decoding/lm_format_enforcer_decoding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import lru_cache from json import loads as json_loads from typing import Optional, Union diff --git a/vllm/model_executor/guided_decoding/outlines_decoding.py b/vllm/model_executor/guided_decoding/outlines_decoding.py index eb8db882..ba9c9829 100644 --- a/vllm/model_executor/guided_decoding/outlines_decoding.py +++ b/vllm/model_executor/guided_decoding/outlines_decoding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import concurrent.futures import os diff --git a/vllm/model_executor/guided_decoding/outlines_logits_processors.py b/vllm/model_executor/guided_decoding/outlines_logits_processors.py index e4eb3f16..ab72b55a 100644 --- a/vllm/model_executor/guided_decoding/outlines_logits_processors.py +++ b/vllm/model_executor/guided_decoding/outlines_logits_processors.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024- the Outlines developers # This file is adapted from # https://github.com/outlines-dev/outlines/blob/main/outlines/serve/vllm.py diff --git a/vllm/model_executor/guided_decoding/utils.py b/vllm/model_executor/guided_decoding/utils.py index 90dfa62e..87ef4535 100644 --- a/vllm/model_executor/guided_decoding/utils.py +++ b/vllm/model_executor/guided_decoding/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import re diff --git a/vllm/model_executor/guided_decoding/xgrammar_decoding.py b/vllm/model_executor/guided_decoding/xgrammar_decoding.py index ee30ce96..c01bd3af 100644 --- a/vllm/model_executor/guided_decoding/xgrammar_decoding.py +++ b/vllm/model_executor/guided_decoding/xgrammar_decoding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # noqa: UP007 from __future__ import annotations diff --git a/vllm/model_executor/layers/activation.py b/vllm/model_executor/layers/activation.py index fb9684ac..f782920d 100644 --- a/vllm/model_executor/layers/activation.py +++ b/vllm/model_executor/layers/activation.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Custom activation functions.""" import math from typing import Optional diff --git a/vllm/model_executor/layers/fused_moe/__init__.py b/vllm/model_executor/layers/fused_moe/__init__.py index c4223d12..6f933c3f 100644 --- a/vllm/model_executor/layers/fused_moe/__init__.py +++ b/vllm/model_executor/layers/fused_moe/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from contextlib import contextmanager from typing import Any, Dict, Optional diff --git a/vllm/model_executor/layers/fused_moe/fused_marlin_moe.py b/vllm/model_executor/layers/fused_moe/fused_marlin_moe.py index 87993267..4ca569ca 100644 --- a/vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +++ b/vllm/model_executor/layers/fused_moe/fused_marlin_moe.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Fused MoE utilities for GPTQ.""" import functools from typing import Optional diff --git a/vllm/model_executor/layers/fused_moe/fused_moe.py b/vllm/model_executor/layers/fused_moe/fused_moe.py index c80e6bf0..9613696a 100644 --- a/vllm/model_executor/layers/fused_moe/fused_moe.py +++ b/vllm/model_executor/layers/fused_moe/fused_moe.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Fused MoE kernel.""" import functools import json diff --git a/vllm/model_executor/layers/fused_moe/layer.py b/vllm/model_executor/layers/fused_moe/layer.py index da0ce188..3c7ef5e0 100644 --- a/vllm/model_executor/layers/fused_moe/layer.py +++ b/vllm/model_executor/layers/fused_moe/layer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import abstractmethod from enum import Enum from typing import Callable, List, Optional, Tuple diff --git a/vllm/model_executor/layers/fused_moe/moe_pallas.py b/vllm/model_executor/layers/fused_moe/moe_pallas.py index 563ee18c..0365afa1 100644 --- a/vllm/model_executor/layers/fused_moe/moe_pallas.py +++ b/vllm/model_executor/layers/fused_moe/moe_pallas.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch import torch.nn.functional as F from torch_xla.experimental.custom_kernel import _histogram diff --git a/vllm/model_executor/layers/fused_moe/moe_torch_iterative.py b/vllm/model_executor/layers/fused_moe/moe_torch_iterative.py index bcff55f4..d9a5de1b 100644 --- a/vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +++ b/vllm/model_executor/layers/fused_moe/moe_torch_iterative.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch import torch.nn.functional as F diff --git a/vllm/model_executor/layers/layernorm.py b/vllm/model_executor/layers/layernorm.py index 43ea4eb5..b476fb0d 100644 --- a/vllm/model_executor/layers/layernorm.py +++ b/vllm/model_executor/layers/layernorm.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Custom normalization layers.""" from typing import Optional, Tuple, Union diff --git a/vllm/model_executor/layers/linear.py b/vllm/model_executor/layers/linear.py index 52263e96..08f1e103 100644 --- a/vllm/model_executor/layers/linear.py +++ b/vllm/model_executor/layers/linear.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools from abc import abstractmethod from typing import Dict, List, Optional, Tuple diff --git a/vllm/model_executor/layers/logits_processor.py b/vllm/model_executor/layers/logits_processor.py index 42decde1..ebf74c67 100644 --- a/vllm/model_executor/layers/logits_processor.py +++ b/vllm/model_executor/layers/logits_processor.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A layer that compute logits from hidden_stats.""" import inspect from typing import Optional diff --git a/vllm/model_executor/layers/mamba/mamba_mixer.py b/vllm/model_executor/layers/mamba/mamba_mixer.py index 606c796d..93c3cc91 100644 --- a/vllm/model_executor/layers/mamba/mamba_mixer.py +++ b/vllm/model_executor/layers/mamba/mamba_mixer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from torch import nn from torch.nn.parameter import Parameter diff --git a/vllm/model_executor/layers/mamba/ops/causal_conv1d.py b/vllm/model_executor/layers/mamba/ops/causal_conv1d.py index be5639df..21e27160 100644 --- a/vllm/model_executor/layers/mamba/ops/causal_conv1d.py +++ b/vllm/model_executor/layers/mamba/ops/causal_conv1d.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright (c) 2024, Tri Dao. # Adapted from https://github.com/Dao-AILab/causal-conv1d/blob/main/causal_conv1d/causal_conv1d_interface.py diff --git a/vllm/model_executor/layers/mamba/ops/mamba_ssm.py b/vllm/model_executor/layers/mamba/ops/mamba_ssm.py index 1484b798..3c35f1ac 100644 --- a/vllm/model_executor/layers/mamba/ops/mamba_ssm.py +++ b/vllm/model_executor/layers/mamba/ops/mamba_ssm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/main/mamba_ssm/ops/triton/selective_state_update.py diff --git a/vllm/model_executor/layers/pooler.py b/vllm/model_executor/layers/pooler.py index 75bf33dc..0012636e 100644 --- a/vllm/model_executor/layers/pooler.py +++ b/vllm/model_executor/layers/pooler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from enum import IntEnum from typing import List, Optional, Union diff --git a/vllm/model_executor/layers/quantization/__init__.py b/vllm/model_executor/layers/quantization/__init__.py index bd0fd479..6ded3874 100644 --- a/vllm/model_executor/layers/quantization/__init__.py +++ b/vllm/model_executor/layers/quantization/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List, Type from vllm.model_executor.layers.quantization.base_config import ( diff --git a/vllm/model_executor/layers/quantization/aqlm.py b/vllm/model_executor/layers/quantization/aqlm.py index 72c89fe2..6c08d016 100644 --- a/vllm/model_executor/layers/quantization/aqlm.py +++ b/vllm/model_executor/layers/quantization/aqlm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Supports AQLM compression, see https://github.com/Vahe1994/AQLM # and https://arxiv.org/pdf/2401.06118.pdf diff --git a/vllm/model_executor/layers/quantization/awq.py b/vllm/model_executor/layers/quantization/awq.py index d83528e9..ff77af44 100644 --- a/vllm/model_executor/layers/quantization/awq.py +++ b/vllm/model_executor/layers/quantization/awq.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/awq_marlin.py b/vllm/model_executor/layers/quantization/awq_marlin.py index 0c3c9816..8849ba29 100644 --- a/vllm/model_executor/layers/quantization/awq_marlin.py +++ b/vllm/model_executor/layers/quantization/awq_marlin.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/awq_triton.py b/vllm/model_executor/layers/quantization/awq_triton.py index ace8f4a3..09efd4db 100644 --- a/vllm/model_executor/layers/quantization/awq_triton.py +++ b/vllm/model_executor/layers/quantization/awq_triton.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch import triton import triton.language as tl diff --git a/vllm/model_executor/layers/quantization/base_config.py b/vllm/model_executor/layers/quantization/base_config.py index 2fb2642d..2eefcc4f 100644 --- a/vllm/model_executor/layers/quantization/base_config.py +++ b/vllm/model_executor/layers/quantization/base_config.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import inspect from abc import ABC, abstractmethod from typing import Any, Dict, List, Optional, Type diff --git a/vllm/model_executor/layers/quantization/bitsandbytes.py b/vllm/model_executor/layers/quantization/bitsandbytes.py index 5dc87293..889eda00 100644 --- a/vllm/model_executor/layers/quantization/bitsandbytes.py +++ b/vllm/model_executor/layers/quantization/bitsandbytes.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py b/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py index 37981ed9..24f7542e 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from contextlib import suppress from typing import Any, Dict, List, Literal, Optional, Tuple, cast diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py b/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py index e1c45f4e..db8e8a4b 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum from enum import Enum from typing import Callable, List, Optional diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py index 569ecaa6..b26c74f2 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .compressed_tensors_scheme import CompressedTensorsScheme from .compressed_tensors_w4a16_24 import (W4A16SPARSE24_SUPPORTED_BITS, CompressedTensorsW4A16Sparse24) diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py index 21e6fe7a..84f924b2 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py index b4bab33e..daa25d23 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import Optional diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py index 2e1b5e3c..535ea6b3 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py index 1671a23d..5c826190 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py index 1d4e4bd5..5dcc41a9 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py index 0e3f4731..08d86a4e 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional, Set import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py index 2dd243b9..38df09ff 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional, Set import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py b/vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py index f4c1dbc0..b69c5e7a 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Type import torch diff --git a/vllm/model_executor/layers/quantization/compressed_tensors/utils.py b/vllm/model_executor/layers/quantization/compressed_tensors/utils.py index 34996b08..d700a0b1 100644 --- a/vllm/model_executor/layers/quantization/compressed_tensors/utils.py +++ b/vllm/model_executor/layers/quantization/compressed_tensors/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import re from typing import Iterable, Optional diff --git a/vllm/model_executor/layers/quantization/deepspeedfp.py b/vllm/model_executor/layers/quantization/deepspeedfp.py index 36598b3e..b4123650 100644 --- a/vllm/model_executor/layers/quantization/deepspeedfp.py +++ b/vllm/model_executor/layers/quantization/deepspeedfp.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/experts_int8.py b/vllm/model_executor/layers/quantization/experts_int8.py index 100cbfa4..87fbcf62 100644 --- a/vllm/model_executor/layers/quantization/experts_int8.py +++ b/vllm/model_executor/layers/quantization/experts_int8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/fbgemm_fp8.py b/vllm/model_executor/layers/quantization/fbgemm_fp8.py index 7b71e13b..da5ef36c 100644 --- a/vllm/model_executor/layers/quantization/fbgemm_fp8.py +++ b/vllm/model_executor/layers/quantization/fbgemm_fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/fp8.py b/vllm/model_executor/layers/quantization/fp8.py index adab1973..86e02531 100644 --- a/vllm/model_executor/layers/quantization/fp8.py +++ b/vllm/model_executor/layers/quantization/fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/gguf.py b/vllm/model_executor/layers/quantization/gguf.py index f0943efa..86e6dbb5 100644 --- a/vllm/model_executor/layers/quantization/gguf.py +++ b/vllm/model_executor/layers/quantization/gguf.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import gguf diff --git a/vllm/model_executor/layers/quantization/gptq.py b/vllm/model_executor/layers/quantization/gptq.py index abafad0f..0cb77a75 100644 --- a/vllm/model_executor/layers/quantization/gptq.py +++ b/vllm/model_executor/layers/quantization/gptq.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum from enum import Enum from fractions import Fraction diff --git a/vllm/model_executor/layers/quantization/gptq_marlin.py b/vllm/model_executor/layers/quantization/gptq_marlin.py index 4dc4b052..99ab2999 100644 --- a/vllm/model_executor/layers/quantization/gptq_marlin.py +++ b/vllm/model_executor/layers/quantization/gptq_marlin.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, Dict, List, Optional, Set, Union import torch diff --git a/vllm/model_executor/layers/quantization/gptq_marlin_24.py b/vllm/model_executor/layers/quantization/gptq_marlin_24.py index 07552c0f..cec98448 100644 --- a/vllm/model_executor/layers/quantization/gptq_marlin_24.py +++ b/vllm/model_executor/layers/quantization/gptq_marlin_24.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/hqq_marlin.py b/vllm/model_executor/layers/quantization/hqq_marlin.py index 28538d29..432f4368 100644 --- a/vllm/model_executor/layers/quantization/hqq_marlin.py +++ b/vllm/model_executor/layers/quantization/hqq_marlin.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/ipex_quant.py b/vllm/model_executor/layers/quantization/ipex_quant.py index c16a9621..2531170e 100644 --- a/vllm/model_executor/layers/quantization/ipex_quant.py +++ b/vllm/model_executor/layers/quantization/ipex_quant.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py b/vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py index 915bdc47..c06befaf 100644 --- a/vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +++ b/vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Callable, Optional, Tuple diff --git a/vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py b/vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py index 83549870..bcfdb167 100644 --- a/vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +++ b/vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Type import vllm.envs as envs diff --git a/vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py b/vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py index 1d85d62e..2706fbb5 100644 --- a/vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +++ b/vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple import torch diff --git a/vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py b/vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py index 15df0200..3f0586f6 100644 --- a/vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +++ b/vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import partial from typing import Optional, Tuple diff --git a/vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py b/vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py index 6969583d..e21801cf 100644 --- a/vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +++ b/vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple import torch diff --git a/vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py b/vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py index c4a83b4f..91e76540 100644 --- a/vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +++ b/vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Optional, Tuple diff --git a/vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py b/vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py index 4824a118..a5967995 100644 --- a/vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +++ b/vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import Dict, List, Optional, Type diff --git a/vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py b/vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py index 2e83a042..2bf21a05 100644 --- a/vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +++ b/vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple import torch diff --git a/vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py b/vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py index 97ec8cb0..5da5df8e 100644 --- a/vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +++ b/vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple import torch diff --git a/vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py b/vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py index 9de668e6..0bf090d7 100644 --- a/vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +++ b/vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import warnings from typing import Optional, Tuple diff --git a/vllm/model_executor/layers/quantization/kv_cache.py b/vllm/model_executor/layers/quantization/kv_cache.py index e1870c73..388a4f16 100644 --- a/vllm/model_executor/layers/quantization/kv_cache.py +++ b/vllm/model_executor/layers/quantization/kv_cache.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch from vllm.logger import init_logger diff --git a/vllm/model_executor/layers/quantization/marlin.py b/vllm/model_executor/layers/quantization/marlin.py index 20212e67..4cf0c677 100644 --- a/vllm/model_executor/layers/quantization/marlin.py +++ b/vllm/model_executor/layers/quantization/marlin.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/modelopt.py b/vllm/model_executor/layers/quantization/modelopt.py index a1b3eeb4..348e9bcc 100644 --- a/vllm/model_executor/layers/quantization/modelopt.py +++ b/vllm/model_executor/layers/quantization/modelopt.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/moe_wna16.py b/vllm/model_executor/layers/quantization/moe_wna16.py index 11a9d4ac..1ae765a2 100644 --- a/vllm/model_executor/layers/quantization/moe_wna16.py +++ b/vllm/model_executor/layers/quantization/moe_wna16.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/neuron_quant.py b/vllm/model_executor/layers/quantization/neuron_quant.py index 2d5cdfa1..a8e8be20 100644 --- a/vllm/model_executor/layers/quantization/neuron_quant.py +++ b/vllm/model_executor/layers/quantization/neuron_quant.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from importlib.util import find_spec from typing import Any, Dict, List, Optional diff --git a/vllm/model_executor/layers/quantization/qqq.py b/vllm/model_executor/layers/quantization/qqq.py index 2ccd0820..6e9d3dc6 100644 --- a/vllm/model_executor/layers/quantization/qqq.py +++ b/vllm/model_executor/layers/quantization/qqq.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/quark/quark.py b/vllm/model_executor/layers/quantization/quark/quark.py index fc214255..0451cf82 100644 --- a/vllm/model_executor/layers/quantization/quark/quark.py +++ b/vllm/model_executor/layers/quantization/quark/quark.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import fnmatch import re from typing import Any, Dict, List, Optional, cast diff --git a/vllm/model_executor/layers/quantization/quark/quark_moe.py b/vllm/model_executor/layers/quantization/quark/quark_moe.py index 68a39545..98743b15 100644 --- a/vllm/model_executor/layers/quantization/quark/quark_moe.py +++ b/vllm/model_executor/layers/quantization/quark/quark_moe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, Dict, Optional import torch diff --git a/vllm/model_executor/layers/quantization/quark/schemes/__init__.py b/vllm/model_executor/layers/quantization/quark/schemes/__init__.py index fb0ba9bd..9069b5a0 100644 --- a/vllm/model_executor/layers/quantization/quark/schemes/__init__.py +++ b/vllm/model_executor/layers/quantization/quark/schemes/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .quark_scheme import QuarkScheme from .quark_w8a8_fp8 import QuarkW8A8Fp8 from .quark_w8a8_int8 import QuarkW8A8Int8 diff --git a/vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py b/vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py index 239597fa..40c8ea86 100644 --- a/vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +++ b/vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import Optional diff --git a/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py b/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py index 206931ea..c885e98a 100644 --- a/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +++ b/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional import torch diff --git a/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py b/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py index 8cb47e9c..1bf34b09 100644 --- a/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +++ b/vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Callable, List, Optional, Set import torch diff --git a/vllm/model_executor/layers/quantization/quark/utils.py b/vllm/model_executor/layers/quantization/quark/utils.py index 742a629b..afb1d9d6 100644 --- a/vllm/model_executor/layers/quantization/quark/utils.py +++ b/vllm/model_executor/layers/quantization/quark/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import re from typing import Any, Iterable, Optional diff --git a/vllm/model_executor/layers/quantization/schema.py b/vllm/model_executor/layers/quantization/schema.py index a26c5247..026881f2 100644 --- a/vllm/model_executor/layers/quantization/schema.py +++ b/vllm/model_executor/layers/quantization/schema.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ This file contains the Pydantic schemas for various quantization-related parameters. When a relevant quantization technique is specified, these diff --git a/vllm/model_executor/layers/quantization/tpu_int8.py b/vllm/model_executor/layers/quantization/tpu_int8.py index 605c3a38..3234feca 100644 --- a/vllm/model_executor/layers/quantization/tpu_int8.py +++ b/vllm/model_executor/layers/quantization/tpu_int8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional, Tuple import torch diff --git a/vllm/model_executor/layers/quantization/utils/__init__.py b/vllm/model_executor/layers/quantization/utils/__init__.py index e60f0c79..f7ee4728 100644 --- a/vllm/model_executor/layers/quantization/utils/__init__.py +++ b/vllm/model_executor/layers/quantization/utils/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .layer_utils import replace_parameter, update_tensor_inplace __all__ = ['update_tensor_inplace', 'replace_parameter'] diff --git a/vllm/model_executor/layers/quantization/utils/fp8_utils.py b/vllm/model_executor/layers/quantization/utils/fp8_utils.py index 850820f6..29c7268a 100644 --- a/vllm/model_executor/layers/quantization/utils/fp8_utils.py +++ b/vllm/model_executor/layers/quantization/utils/fp8_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json diff --git a/vllm/model_executor/layers/quantization/utils/layer_utils.py b/vllm/model_executor/layers/quantization/utils/layer_utils.py index edce6d19..5acae7ca 100644 --- a/vllm/model_executor/layers/quantization/utils/layer_utils.py +++ b/vllm/model_executor/layers/quantization/utils/layer_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Union import torch diff --git a/vllm/model_executor/layers/quantization/utils/machete_utils.py b/vllm/model_executor/layers/quantization/utils/machete_utils.py index 18e13320..cb7d49ed 100644 --- a/vllm/model_executor/layers/quantization/utils/machete_utils.py +++ b/vllm/model_executor/layers/quantization/utils/machete_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple import torch diff --git a/vllm/model_executor/layers/quantization/utils/marlin_utils.py b/vllm/model_executor/layers/quantization/utils/marlin_utils.py index c9366ca9..3beba308 100644 --- a/vllm/model_executor/layers/quantization/utils/marlin_utils.py +++ b/vllm/model_executor/layers/quantization/utils/marlin_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple import numpy diff --git a/vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py b/vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py index 245fe923..6120a8e6 100644 --- a/vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +++ b/vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional import torch diff --git a/vllm/model_executor/layers/quantization/utils/marlin_utils_test.py b/vllm/model_executor/layers/quantization/utils/marlin_utils_test.py index 4a06c5d6..fb557a31 100644 --- a/vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +++ b/vllm/model_executor/layers/quantization/utils/marlin_utils_test.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utility functions used for tests and benchmarks""" from typing import List, Optional diff --git a/vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py b/vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py index 17d09055..3654268e 100644 --- a/vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +++ b/vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utility functions used for tests and benchmarks""" import random diff --git a/vllm/model_executor/layers/quantization/utils/marlin_utils_test_qqq.py b/vllm/model_executor/layers/quantization/utils/marlin_utils_test_qqq.py index cb58eb94..176b2947 100644 --- a/vllm/model_executor/layers/quantization/utils/marlin_utils_test_qqq.py +++ b/vllm/model_executor/layers/quantization/utils/marlin_utils_test_qqq.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import numpy diff --git a/vllm/model_executor/layers/quantization/utils/quant_utils.py b/vllm/model_executor/layers/quantization/utils/quant_utils.py index 95e785dc..62484f62 100644 --- a/vllm/model_executor/layers/quantization/utils/quant_utils.py +++ b/vllm/model_executor/layers/quantization/utils/quant_utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """This file is used for /tests and /benchmarks""" from typing import List, Optional, Tuple diff --git a/vllm/model_executor/layers/quantization/utils/w8a8_utils.py b/vllm/model_executor/layers/quantization/utils/w8a8_utils.py index 3af3b3e0..3fd88e87 100644 --- a/vllm/model_executor/layers/quantization/utils/w8a8_utils.py +++ b/vllm/model_executor/layers/quantization/utils/w8a8_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple, Union import torch diff --git a/vllm/model_executor/layers/rejection_sampler.py b/vllm/model_executor/layers/rejection_sampler.py index 9d6c3797..62e27b71 100644 --- a/vllm/model_executor/layers/rejection_sampler.py +++ b/vllm/model_executor/layers/rejection_sampler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import cached_property from importlib.util import find_spec from typing import Dict, Optional, Tuple diff --git a/vllm/model_executor/layers/resampler.py b/vllm/model_executor/layers/resampler.py index a67713c3..4c986000 100644 --- a/vllm/model_executor/layers/resampler.py +++ b/vllm/model_executor/layers/resampler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # https://huggingface.co/Qwen/Qwen-7B/blob/main/modeling_qwen.py diff --git a/vllm/model_executor/layers/rotary_embedding.py b/vllm/model_executor/layers/rotary_embedding.py index d071cfe8..814c3b7d 100644 --- a/vllm/model_executor/layers/rotary_embedding.py +++ b/vllm/model_executor/layers/rotary_embedding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.33.2/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/layers/sampler.py b/vllm/model_executor/layers/sampler.py index 8dc26309..6af734be 100644 --- a/vllm/model_executor/layers/sampler.py +++ b/vllm/model_executor/layers/sampler.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A layer that samples the next tokens from the model's outputs.""" import itertools import warnings diff --git a/vllm/model_executor/layers/spec_decode_base_sampler.py b/vllm/model_executor/layers/spec_decode_base_sampler.py index 6aa4b8bd..35c7ffec 100644 --- a/vllm/model_executor/layers/spec_decode_base_sampler.py +++ b/vllm/model_executor/layers/spec_decode_base_sampler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import abstractmethod from typing import Dict, Optional, Union diff --git a/vllm/model_executor/layers/typical_acceptance_sampler.py b/vllm/model_executor/layers/typical_acceptance_sampler.py index 584cf971..95362c28 100644 --- a/vllm/model_executor/layers/typical_acceptance_sampler.py +++ b/vllm/model_executor/layers/typical_acceptance_sampler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import torch import torch.jit diff --git a/vllm/model_executor/layers/utils.py b/vllm/model_executor/layers/utils.py index f6f34cd4..dfe71028 100644 --- a/vllm/model_executor/layers/utils.py +++ b/vllm/model_executor/layers/utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utility methods for model layers.""" from typing import Tuple diff --git a/vllm/model_executor/layers/vocab_parallel_embedding.py b/vllm/model_executor/layers/vocab_parallel_embedding.py index f230efac..e409094d 100644 --- a/vllm/model_executor/layers/vocab_parallel_embedding.py +++ b/vllm/model_executor/layers/vocab_parallel_embedding.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import List, Optional, Sequence, Tuple diff --git a/vllm/model_executor/model_loader/__init__.py b/vllm/model_executor/model_loader/__init__.py index 12468997..9048c70c 100644 --- a/vllm/model_executor/model_loader/__init__.py +++ b/vllm/model_executor/model_loader/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from torch import nn from vllm.config import VllmConfig diff --git a/vllm/model_executor/model_loader/loader.py b/vllm/model_executor/model_loader/loader.py index 4be511d1..809af81d 100644 --- a/vllm/model_executor/model_loader/loader.py +++ b/vllm/model_executor/model_loader/loader.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # ruff: noqa: SIM117 import collections import copy diff --git a/vllm/model_executor/model_loader/neuron.py b/vllm/model_executor/model_loader/neuron.py index a90fbd64..d900fb3a 100644 --- a/vllm/model_executor/model_loader/neuron.py +++ b/vllm/model_executor/model_loader/neuron.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utilities for selecting and loading neuron models.""" import copy import importlib diff --git a/vllm/model_executor/model_loader/openvino.py b/vllm/model_executor/model_loader/openvino.py index e6299295..7bd531c5 100644 --- a/vllm/model_executor/model_loader/openvino.py +++ b/vllm/model_executor/model_loader/openvino.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # ruff: noqa: SIM117 from pathlib import Path from typing import List, Optional, Tuple diff --git a/vllm/model_executor/model_loader/tensorizer.py b/vllm/model_executor/model_loader/tensorizer.py index 9266ca75..117251cc 100644 --- a/vllm/model_executor/model_loader/tensorizer.py +++ b/vllm/model_executor/model_loader/tensorizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import dataclasses import io diff --git a/vllm/model_executor/model_loader/utils.py b/vllm/model_executor/model_loader/utils.py index 3f923d2f..084ca53b 100644 --- a/vllm/model_executor/model_loader/utils.py +++ b/vllm/model_executor/model_loader/utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utilities for selecting and loading models.""" import contextlib from dataclasses import dataclass, field diff --git a/vllm/model_executor/model_loader/weight_utils.py b/vllm/model_executor/model_loader/weight_utils.py index e4d103f7..cade0a1d 100644 --- a/vllm/model_executor/model_loader/weight_utils.py +++ b/vllm/model_executor/model_loader/weight_utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utilities for downloading and initializing model weights.""" import fnmatch import glob diff --git a/vllm/model_executor/models/__init__.py b/vllm/model_executor/models/__init__.py index a3ef9ada..6be4a834 100644 --- a/vllm/model_executor/models/__init__.py +++ b/vllm/model_executor/models/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .interfaces import (HasInnerState, SupportsLoRA, SupportsMultiModal, SupportsPP, has_inner_state, supports_lora, supports_multimodal, supports_pp) diff --git a/vllm/model_executor/models/adapters.py b/vllm/model_executor/models/adapters.py index 55e90b9d..3e1daa77 100644 --- a/vllm/model_executor/models/adapters.py +++ b/vllm/model_executor/models/adapters.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections.abc import Iterable from typing import TYPE_CHECKING, Any, Optional, TypeVar diff --git a/vllm/model_executor/models/arctic.py b/vllm/model_executor/models/arctic.py index fd6b5659..d015682a 100644 --- a/vllm/model_executor/models/arctic.py +++ b/vllm/model_executor/models/arctic.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Inference-only Snowflake Arctic model.""" from typing import Iterable, List, Optional, Set, Tuple, Union diff --git a/vllm/model_executor/models/aria.py b/vllm/model_executor/models/aria.py index 8c6873de..97502c38 100644 --- a/vllm/model_executor/models/aria.py +++ b/vllm/model_executor/models/aria.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import (Iterable, List, Mapping, Optional, Set, Tuple, TypedDict, Union) diff --git a/vllm/model_executor/models/baichuan.py b/vllm/model_executor/models/baichuan.py index a923ed36..5dfaa727 100644 --- a/vllm/model_executor/models/baichuan.py +++ b/vllm/model_executor/models/baichuan.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX diff --git a/vllm/model_executor/models/bart.py b/vllm/model_executor/models/bart.py index 57eb5adc..204c48d0 100644 --- a/vllm/model_executor/models/bart.py +++ b/vllm/model_executor/models/bart.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Derived from BART implementation posted on HuggingFace; license below: # # coding=utf-8 diff --git a/vllm/model_executor/models/bert.py b/vllm/model_executor/models/bert.py index 4be13654..4d0f5ac8 100644 --- a/vllm/model_executor/models/bert.py +++ b/vllm/model_executor/models/bert.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Iterable, List, Optional, Set, Tuple import torch diff --git a/vllm/model_executor/models/blip.py b/vllm/model_executor/models/blip.py index 987dfaf4..bedbdceb 100644 --- a/vllm/model_executor/models/blip.py +++ b/vllm/model_executor/models/blip.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Minimal implementation of BlipVisionModel intended to be only used within a vision language model.""" from typing import Iterable, Optional, Set, Tuple, Union diff --git a/vllm/model_executor/models/blip2.py b/vllm/model_executor/models/blip2.py index b559ac67..2b045222 100644 --- a/vllm/model_executor/models/blip2.py +++ b/vllm/model_executor/models/blip2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import cached_property from typing import (Iterable, List, Literal, Mapping, Optional, Set, Tuple, TypedDict, Union) diff --git a/vllm/model_executor/models/bloom.py b/vllm/model_executor/models/bloom.py index fee74f49..229677ae 100644 --- a/vllm/model_executor/models/bloom.py +++ b/vllm/model_executor/models/bloom.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/bloom/modeling_bloom.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/chameleon.py b/vllm/model_executor/models/chameleon.py index e834c900..9061a312 100644 --- a/vllm/model_executor/models/chameleon.py +++ b/vllm/model_executor/models/chameleon.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import cached_property from typing import (Any, Dict, Iterable, List, Literal, Mapping, Optional, Set, Tuple, TypedDict, Union) diff --git a/vllm/model_executor/models/chatglm.py b/vllm/model_executor/models/chatglm.py index d5f9b4d1..b81a9e91 100644 --- a/vllm/model_executor/models/chatglm.py +++ b/vllm/model_executor/models/chatglm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/THUDM/CogAgent """Inference-only CogAgent model compatible with THUDM weights.""" diff --git a/vllm/model_executor/models/clip.py b/vllm/model_executor/models/clip.py index dd69f6c9..1e784f5b 100644 --- a/vllm/model_executor/models/clip.py +++ b/vllm/model_executor/models/clip.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Minimal implementation of CLIPVisionModel intended to be only used within a vision language model.""" from typing import Iterable, List, Optional, Set, Tuple, Union diff --git a/vllm/model_executor/models/commandr.py b/vllm/model_executor/models/commandr.py index 989056bf..e73627da 100644 --- a/vllm/model_executor/models/commandr.py +++ b/vllm/model_executor/models/commandr.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 Cohere and the HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX diff --git a/vllm/model_executor/models/dbrx.py b/vllm/model_executor/models/dbrx.py index b2aa3c07..bb3f4f40 100644 --- a/vllm/model_executor/models/dbrx.py +++ b/vllm/model_executor/models/dbrx.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Iterable, List, Optional, Set, Tuple, Union import torch diff --git a/vllm/model_executor/models/decilm.py b/vllm/model_executor/models/decilm.py index c5518539..b239b642 100644 --- a/vllm/model_executor/models/decilm.py +++ b/vllm/model_executor/models/decilm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 DeciAI Research Team. All rights reserved. diff --git a/vllm/model_executor/models/deepseek.py b/vllm/model_executor/models/deepseek.py index 74b6bfdf..9599e1df 100644 --- a/vllm/model_executor/models/deepseek.py +++ b/vllm/model_executor/models/deepseek.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/deepseek_v2.py b/vllm/model_executor/models/deepseek_v2.py index 73388cd2..f5fede4d 100644 --- a/vllm/model_executor/models/deepseek_v2.py +++ b/vllm/model_executor/models/deepseek_v2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/deepseek_v3.py b/vllm/model_executor/models/deepseek_v3.py index 06ea3dab..a4829aa1 100644 --- a/vllm/model_executor/models/deepseek_v3.py +++ b/vllm/model_executor/models/deepseek_v3.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/deepseek_vl2.py b/vllm/model_executor/models/deepseek_vl2.py index 344832d8..1343b976 100644 --- a/vllm/model_executor/models/deepseek_vl2.py +++ b/vllm/model_executor/models/deepseek_vl2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://github.com/deepseek-ai/DeepSeek-VL2/blob/faf18023f24b962b32d9f0a2d89e402a8d383a78/deepseek_vl2/models/modeling_deepseek_vl_v2.py """Inference-only Deepseek-VL2 model compatible with HuggingFace weights.""" import math diff --git a/vllm/model_executor/models/eagle.py b/vllm/model_executor/models/eagle.py index 948560b4..373a728b 100644 --- a/vllm/model_executor/models/eagle.py +++ b/vllm/model_executor/models/eagle.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Iterable, List, Optional, Tuple import torch diff --git a/vllm/model_executor/models/exaone.py b/vllm/model_executor/models/exaone.py index bc3295da..2eb91a68 100644 --- a/vllm/model_executor/models/exaone.py +++ b/vllm/model_executor/models/exaone.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct/blob/main/modeling_exaone.py # Copyright 2024 The LG U+ CTO AI Tech Lab. diff --git a/vllm/model_executor/models/fairseq2_llama.py b/vllm/model_executor/models/fairseq2_llama.py index b93a6868..310aca99 100644 --- a/vllm/model_executor/models/fairseq2_llama.py +++ b/vllm/model_executor/models/fairseq2_llama.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 The vLLM team. # Copyright 2024 Meta Platforms, Inc. and affiliates. All rights reserved. # diff --git a/vllm/model_executor/models/falcon.py b/vllm/model_executor/models/falcon.py index c503a368..01b66a1c 100644 --- a/vllm/model_executor/models/falcon.py +++ b/vllm/model_executor/models/falcon.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/a5cc30d72ae2dc19af534e4b35c986cc28db1275/src/transformers/models/falcon/modeling_falcon.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/florence2.py b/vllm/model_executor/models/florence2.py index 3a5fe8e1..4a1ad5f4 100644 --- a/vllm/model_executor/models/florence2.py +++ b/vllm/model_executor/models/florence2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from typing import Iterable, List, Optional, Set, Tuple diff --git a/vllm/model_executor/models/fuyu.py b/vllm/model_executor/models/fuyu.py index dbf9da50..6d8c8296 100644 --- a/vllm/model_executor/models/fuyu.py +++ b/vllm/model_executor/models/fuyu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://github.com/huggingface/transformers/blob/v4.39.3/src/transformers/models/fuyu/modeling_fuyu.py # Copyright 2023 The vLLM team. # Copyright 2023 HuggingFace Inc. team. All rights reserved. diff --git a/vllm/model_executor/models/gemma.py b/vllm/model_executor/models/gemma.py index b23aba82..cb81aa41 100644 --- a/vllm/model_executor/models/gemma.py +++ b/vllm/model_executor/models/gemma.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2023 The vLLM team. # Copyright (c) Google Inc. # diff --git a/vllm/model_executor/models/gemma2.py b/vllm/model_executor/models/gemma2.py index f0dc7693..a6dc8f84 100644 --- a/vllm/model_executor/models/gemma2.py +++ b/vllm/model_executor/models/gemma2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 The vLLM team. # Copyright 2024 Google Inc. HuggingFace Inc. team. All rights reserved. # diff --git a/vllm/model_executor/models/glm.py b/vllm/model_executor/models/glm.py index 942d1e14..5f190334 100644 --- a/vllm/model_executor/models/glm.py +++ b/vllm/model_executor/models/glm.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Inference-only HF format GLM-4 model compatible with THUDM weights.""" from vllm.config import VllmConfig from vllm.model_executor.models.llama import LlamaForCausalLM diff --git a/vllm/model_executor/models/glm4_vision_encoder.py b/vllm/model_executor/models/glm4_vision_encoder.py index 51922e6f..4449eb8e 100644 --- a/vllm/model_executor/models/glm4_vision_encoder.py +++ b/vllm/model_executor/models/glm4_vision_encoder.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/THUDM/GLM-4 """Inference-only GLM-4v model visual encoder compatible with THUDM weights.""" diff --git a/vllm/model_executor/models/gpt2.py b/vllm/model_executor/models/gpt2.py index 2f1aa2d6..7ad9a24d 100644 --- a/vllm/model_executor/models/gpt2.py +++ b/vllm/model_executor/models/gpt2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/gpt2/modeling_gpt2.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/gpt_bigcode.py b/vllm/model_executor/models/gpt_bigcode.py index c64bc706..887a4447 100644 --- a/vllm/model_executor/models/gpt_bigcode.py +++ b/vllm/model_executor/models/gpt_bigcode.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/gpt2/modeling_gpt2.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/gpt_j.py b/vllm/model_executor/models/gpt_j.py index 08298cc0..815aba14 100644 --- a/vllm/model_executor/models/gpt_j.py +++ b/vllm/model_executor/models/gpt_j.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/gptj/modeling_gptj.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/gpt_neox.py b/vllm/model_executor/models/gpt_neox.py index 73164277..550ca3f7 100644 --- a/vllm/model_executor/models/gpt_neox.py +++ b/vllm/model_executor/models/gpt_neox.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/gpt_neox/modeling_gpt_neox.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/granite.py b/vllm/model_executor/models/granite.py index 543b4e2f..85911a0f 100644 --- a/vllm/model_executor/models/granite.py +++ b/vllm/model_executor/models/granite.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/granitemoe.py b/vllm/model_executor/models/granitemoe.py index cdf9414d..8ae661bf 100644 --- a/vllm/model_executor/models/granitemoe.py +++ b/vllm/model_executor/models/granitemoe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/gritlm.py b/vllm/model_executor/models/gritlm.py index d179d623..7bda54ea 100644 --- a/vllm/model_executor/models/gritlm.py +++ b/vllm/model_executor/models/gritlm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from array import array from typing import List, Optional, Union diff --git a/vllm/model_executor/models/h2ovl.py b/vllm/model_executor/models/h2ovl.py index df7e768f..91c89b15 100644 --- a/vllm/model_executor/models/h2ovl.py +++ b/vllm/model_executor/models/h2ovl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://huggingface.co/h2oai/h2ovl-mississippi-2b/blob/main/modeling_h2ovl_chat.py # https://huggingface.co/h2oai/h2ovl-mississippi-2b/blob/main/image_process.py # -------------------------------------------------------- diff --git a/vllm/model_executor/models/idefics2_vision_model.py b/vllm/model_executor/models/idefics2_vision_model.py index 4e42a4b6..f9c2175b 100644 --- a/vllm/model_executor/models/idefics2_vision_model.py +++ b/vllm/model_executor/models/idefics2_vision_model.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://github.com/huggingface/transformers/blob/v4.43.2/src/transformers/models/idefics2/modeling_idefics2.py # Copyright 2024 The vLLM team. # Copyright 2024 the HuggingFace Inc. team. All rights reserved. diff --git a/vllm/model_executor/models/idefics3.py b/vllm/model_executor/models/idefics3.py index d16a77f8..9e2e677a 100644 --- a/vllm/model_executor/models/idefics3.py +++ b/vllm/model_executor/models/idefics3.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 the HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/vllm/model_executor/models/interfaces.py b/vllm/model_executor/models/interfaces.py index c5fd0d93..0fc5c4db 100644 --- a/vllm/model_executor/models/interfaces.py +++ b/vllm/model_executor/models/interfaces.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import (TYPE_CHECKING, ClassVar, Dict, List, Literal, Optional, Protocol, Type, Union, overload, runtime_checkable) diff --git a/vllm/model_executor/models/interfaces_base.py b/vllm/model_executor/models/interfaces_base.py index 37b91a80..c5f7be13 100644 --- a/vllm/model_executor/models/interfaces_base.py +++ b/vllm/model_executor/models/interfaces_base.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import (TYPE_CHECKING, List, Optional, Protocol, Type, Union, overload, runtime_checkable) diff --git a/vllm/model_executor/models/intern_vit.py b/vllm/model_executor/models/intern_vit.py index 8ad009d5..0499f339 100644 --- a/vllm/model_executor/models/intern_vit.py +++ b/vllm/model_executor/models/intern_vit.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://huggingface.co/OpenGVLab/InternVL2-4B/blob/main/modeling_intern_vit.py # -------------------------------------------------------- # InternVL diff --git a/vllm/model_executor/models/internlm2.py b/vllm/model_executor/models/internlm2.py index 28c23edd..c211ca5f 100644 --- a/vllm/model_executor/models/internlm2.py +++ b/vllm/model_executor/models/internlm2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import partial from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type, Union diff --git a/vllm/model_executor/models/internlm2_ve.py b/vllm/model_executor/models/internlm2_ve.py index 93ac2dcf..106c3b6b 100644 --- a/vllm/model_executor/models/internlm2_ve.py +++ b/vllm/model_executor/models/internlm2_ve.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple, Union import torch diff --git a/vllm/model_executor/models/internvl.py b/vllm/model_executor/models/internvl.py index f4b7e447..c46a867a 100644 --- a/vllm/model_executor/models/internvl.py +++ b/vllm/model_executor/models/internvl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://huggingface.co/OpenGVLab/InternVL2-4B/blob/main/modeling_internvl_chat.py # -------------------------------------------------------- # InternVL diff --git a/vllm/model_executor/models/jais.py b/vllm/model_executor/models/jais.py index 8c81dff6..72bcef5e 100644 --- a/vllm/model_executor/models/jais.py +++ b/vllm/model_executor/models/jais.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/inceptionai/jais-30b-chat-v3/blob/main/modeling_jais.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/jamba.py b/vllm/model_executor/models/jamba.py index 890b5530..d82c0815 100644 --- a/vllm/model_executor/models/jamba.py +++ b/vllm/model_executor/models/jamba.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Inference-only Jamba model.""" from typing import Iterable, List, Optional, Set, Tuple diff --git a/vllm/model_executor/models/llama.py b/vllm/model_executor/models/llama.py index e7c264c0..d91c8782 100644 --- a/vllm/model_executor/models/llama.py +++ b/vllm/model_executor/models/llama.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/llava.py b/vllm/model_executor/models/llava.py index 296af2aa..de3777ca 100644 --- a/vllm/model_executor/models/llava.py +++ b/vllm/model_executor/models/llava.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import abstractmethod from functools import cached_property from typing import (Final, Iterable, List, Literal, Mapping, Optional, diff --git a/vllm/model_executor/models/llava_next.py b/vllm/model_executor/models/llava_next.py index fda4f22d..185edcb8 100644 --- a/vllm/model_executor/models/llava_next.py +++ b/vllm/model_executor/models/llava_next.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import abstractmethod from functools import cached_property from typing import (Final, Iterable, List, Literal, Mapping, Optional, diff --git a/vllm/model_executor/models/llava_next_video.py b/vllm/model_executor/models/llava_next_video.py index 5be85d7c..a5002513 100644 --- a/vllm/model_executor/models/llava_next_video.py +++ b/vllm/model_executor/models/llava_next_video.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from functools import cached_property from typing import (Iterable, List, Literal, Mapping, Optional, Set, Tuple, diff --git a/vllm/model_executor/models/llava_onevision.py b/vllm/model_executor/models/llava_onevision.py index 5b0f35b0..ac502000 100644 --- a/vllm/model_executor/models/llava_onevision.py +++ b/vllm/model_executor/models/llava_onevision.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from functools import cached_property from typing import (Final, Iterable, List, Literal, Mapping, Optional, diff --git a/vllm/model_executor/models/mamba.py b/vllm/model_executor/models/mamba.py index 553bc9c2..5034b334 100644 --- a/vllm/model_executor/models/mamba.py +++ b/vllm/model_executor/models/mamba.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """PyTorch MAMBA model.""" from typing import Iterable, List, Optional, Set, Tuple diff --git a/vllm/model_executor/models/mamba_cache.py b/vllm/model_executor/models/mamba_cache.py index 79393421..353177f7 100644 --- a/vllm/model_executor/models/mamba_cache.py +++ b/vllm/model_executor/models/mamba_cache.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Dict, List diff --git a/vllm/model_executor/models/medusa.py b/vllm/model_executor/models/medusa.py index 66bdcb89..a19d7da5 100644 --- a/vllm/model_executor/models/medusa.py +++ b/vllm/model_executor/models/medusa.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Iterable, List, Optional, Set, Tuple import torch diff --git a/vllm/model_executor/models/minicpm.py b/vllm/model_executor/models/minicpm.py index 6254d26c..29473f5b 100644 --- a/vllm/model_executor/models/minicpm.py +++ b/vllm/model_executor/models/minicpm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/minicpm3.py b/vllm/model_executor/models/minicpm3.py index 5e1e6c6f..878f0c89 100644 --- a/vllm/model_executor/models/minicpm3.py +++ b/vllm/model_executor/models/minicpm3.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2024 The ModelBest team. diff --git a/vllm/model_executor/models/minicpmo.py b/vllm/model_executor/models/minicpmo.py index eb4282d6..f1c16807 100644 --- a/vllm/model_executor/models/minicpmo.py +++ b/vllm/model_executor/models/minicpmo.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/minicpmv.py b/vllm/model_executor/models/minicpmv.py index bf967d33..6964d6bd 100644 --- a/vllm/model_executor/models/minicpmv.py +++ b/vllm/model_executor/models/minicpmv.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/mixtral.py b/vllm/model_executor/models/mixtral.py index fbb3704f..70880eb7 100644 --- a/vllm/model_executor/models/mixtral.py +++ b/vllm/model_executor/models/mixtral.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/mixtral_quant.py b/vllm/model_executor/models/mixtral_quant.py index 7a9b8cd8..fdc43891 100644 --- a/vllm/model_executor/models/mixtral_quant.py +++ b/vllm/model_executor/models/mixtral_quant.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/mllama.py b/vllm/model_executor/models/mllama.py index f7f9d7a1..d1cb04cd 100644 --- a/vllm/model_executor/models/mllama.py +++ b/vllm/model_executor/models/mllama.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 the HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/vllm/model_executor/models/mlp_speculator.py b/vllm/model_executor/models/mlp_speculator.py index f1d796ca..cf4123a2 100644 --- a/vllm/model_executor/models/mlp_speculator.py +++ b/vllm/model_executor/models/mlp_speculator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from typing import Iterable, List, Set, Tuple diff --git a/vllm/model_executor/models/module_mapping.py b/vllm/model_executor/models/module_mapping.py index a9102a60..23814e63 100644 --- a/vllm/model_executor/models/module_mapping.py +++ b/vllm/model_executor/models/module_mapping.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/modelscope/ms-swift/blob/v2.4.2/swift/utils/module_mapping.py diff --git a/vllm/model_executor/models/molmo.py b/vllm/model_executor/models/molmo.py index 5c7ae0de..b524a149 100644 --- a/vllm/model_executor/models/molmo.py +++ b/vllm/model_executor/models/molmo.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math import re from array import array diff --git a/vllm/model_executor/models/mpt.py b/vllm/model_executor/models/mpt.py index 12358164..676c9606 100644 --- a/vllm/model_executor/models/mpt.py +++ b/vllm/model_executor/models/mpt.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from https://huggingface.co/mosaicml/mpt-7b/tree/main import math from typing import Iterable, List, Optional, Set, Tuple, Union diff --git a/vllm/model_executor/models/nemotron.py b/vllm/model_executor/models/nemotron.py index 2340283b..6f0b831a 100644 --- a/vllm/model_executor/models/nemotron.py +++ b/vllm/model_executor/models/nemotron.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/nvlm_d.py b/vllm/model_executor/models/nvlm_d.py index df4fd0a3..2aa04bd7 100644 --- a/vllm/model_executor/models/nvlm_d.py +++ b/vllm/model_executor/models/nvlm_d.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://huggingface.co/nvidia/NVLM-D-72B/blob/main/modeling_nvlm_d.py # -------------------------------------------------------- # NVLM-D diff --git a/vllm/model_executor/models/olmo.py b/vllm/model_executor/models/olmo.py index 538e31ec..3b470dfd 100644 --- a/vllm/model_executor/models/olmo.py +++ b/vllm/model_executor/models/olmo.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.40.1/src/transformers/models/olmo/modeling_olmo.py # Copyright 2024 The vLLM team. diff --git a/vllm/model_executor/models/olmo2.py b/vllm/model_executor/models/olmo2.py index a35c911f..4b045509 100644 --- a/vllm/model_executor/models/olmo2.py +++ b/vllm/model_executor/models/olmo2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/main/src/transformers/models/olmo2/modeling_olmo2.py # Copyright 2024 The vLLM team. diff --git a/vllm/model_executor/models/olmoe.py b/vllm/model_executor/models/olmoe.py index fbe5d1ae..d6e24c6d 100644 --- a/vllm/model_executor/models/olmoe.py +++ b/vllm/model_executor/models/olmoe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/vllm/model_executor/models/opt.py b/vllm/model_executor/models/opt.py index ea1185aa..ad1d6690 100644 --- a/vllm/model_executor/models/opt.py +++ b/vllm/model_executor/models/opt.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/opt/modeling_opt.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/orion.py b/vllm/model_executor/models/orion.py index a3757b5c..f4f5cdff 100644 --- a/vllm/model_executor/models/orion.py +++ b/vllm/model_executor/models/orion.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/OrionStarAI/Orion-14B-Base/blob/main/modeling_orion.py # Copyright (c) OrionStar Inc. diff --git a/vllm/model_executor/models/paligemma.py b/vllm/model_executor/models/paligemma.py index 5a28b1ff..65d810dc 100644 --- a/vllm/model_executor/models/paligemma.py +++ b/vllm/model_executor/models/paligemma.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import (Iterable, List, Literal, Mapping, Optional, Set, Tuple, TypedDict, Union) diff --git a/vllm/model_executor/models/persimmon.py b/vllm/model_executor/models/persimmon.py index 14dd4b5b..6a80bea3 100644 --- a/vllm/model_executor/models/persimmon.py +++ b/vllm/model_executor/models/persimmon.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://github.com/huggingface/transformers/blob/v4.39.3/src/transformers/models/persimmon/modeling_persimmon.py # Copyright 2023 The vLLM team. # Copyright 2023 EleutherAI and the HuggingFace Inc. team. All rights reserved. diff --git a/vllm/model_executor/models/phi.py b/vllm/model_executor/models/phi.py index 59b7508a..6b05bfee 100644 --- a/vllm/model_executor/models/phi.py +++ b/vllm/model_executor/models/phi.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/microsoft/phi-1_5/blob/main/modeling_phi.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/phi3.py b/vllm/model_executor/models/phi3.py index 34141511..8f84e072 100644 --- a/vllm/model_executor/models/phi3.py +++ b/vllm/model_executor/models/phi3.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from llama.py """Inference-only Phi3 model code inherit from Llama.py""" diff --git a/vllm/model_executor/models/phi3_small.py b/vllm/model_executor/models/phi3_small.py index f47676b9..a8b7e9b2 100644 --- a/vllm/model_executor/models/phi3_small.py +++ b/vllm/model_executor/models/phi3_small.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from typing import Iterable, List, Optional, Set, Tuple, Union diff --git a/vllm/model_executor/models/phi3v.py b/vllm/model_executor/models/phi3v.py index 0fcda81d..f089fa5d 100644 --- a/vllm/model_executor/models/phi3v.py +++ b/vllm/model_executor/models/phi3v.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 The vLLM team. # Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved. # diff --git a/vllm/model_executor/models/phimoe.py b/vllm/model_executor/models/phimoe.py index 6367b770..aa4bb52c 100644 --- a/vllm/model_executor/models/phimoe.py +++ b/vllm/model_executor/models/phimoe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/pixtral.py b/vllm/model_executor/models/pixtral.py index 37b9989e..003e9c84 100644 --- a/vllm/model_executor/models/pixtral.py +++ b/vllm/model_executor/models/pixtral.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from dataclasses import dataclass, fields from functools import cached_property diff --git a/vllm/model_executor/models/qwen.py b/vllm/model_executor/models/qwen.py index 86a9d308..d7f6662b 100644 --- a/vllm/model_executor/models/qwen.py +++ b/vllm/model_executor/models/qwen.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/Qwen/Qwen-7B/blob/main/modeling_qwen.py # Copyright (c) Alibaba Cloud. diff --git a/vllm/model_executor/models/qwen2.py b/vllm/model_executor/models/qwen2.py index 82de1c35..e3de6b64 100644 --- a/vllm/model_executor/models/qwen2.py +++ b/vllm/model_executor/models/qwen2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/qwen2/modeling_qwen2.py # Copyright 2024 The Qwen team. diff --git a/vllm/model_executor/models/qwen2_audio.py b/vllm/model_executor/models/qwen2_audio.py index fc5aed5c..cf104ab0 100644 --- a/vllm/model_executor/models/qwen2_audio.py +++ b/vllm/model_executor/models/qwen2_audio.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 The Qwen team. # Copyright 2023 The vLLM team. # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. diff --git a/vllm/model_executor/models/qwen2_moe.py b/vllm/model_executor/models/qwen2_moe.py index 95de6c21..35d9854a 100644 --- a/vllm/model_executor/models/qwen2_moe.py +++ b/vllm/model_executor/models/qwen2_moe.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py # Copyright 2024 The Qwen team. diff --git a/vllm/model_executor/models/qwen2_rm.py b/vllm/model_executor/models/qwen2_rm.py index 593ce485..00e4159e 100644 --- a/vllm/model_executor/models/qwen2_rm.py +++ b/vllm/model_executor/models/qwen2_rm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/Qwen/Qwen2.5-Math-RM-72B/blob/main/modeling_qwen2_rm.py # Copyright 2024 The Qwen team. diff --git a/vllm/model_executor/models/qwen2_vl.py b/vllm/model_executor/models/qwen2_vl.py index a2778ee7..189ac41e 100644 --- a/vllm/model_executor/models/qwen2_vl.py +++ b/vllm/model_executor/models/qwen2_vl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/19e6e80e10118f855137b90740936c0b11ac397f/src/transformers/models/qwen2_vl/modeling_qwen2_vl.py # Copyright 2024 The Qwen team. diff --git a/vllm/model_executor/models/registry.py b/vllm/model_executor/models/registry.py index de05bf2b..40bbc7d1 100644 --- a/vllm/model_executor/models/registry.py +++ b/vllm/model_executor/models/registry.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """ Whenever you add an architecture to this page, please also update `tests/models/registry.py` with example HuggingFace models for it. diff --git a/vllm/model_executor/models/roberta.py b/vllm/model_executor/models/roberta.py index 5997a768..742e63a0 100644 --- a/vllm/model_executor/models/roberta.py +++ b/vllm/model_executor/models/roberta.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools from typing import Iterable, List, Optional, Tuple diff --git a/vllm/model_executor/models/siglip.py b/vllm/model_executor/models/siglip.py index 1e510189..a81462f6 100644 --- a/vllm/model_executor/models/siglip.py +++ b/vllm/model_executor/models/siglip.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Implementation of SiglipVisionModel intended to be only used within a vision language model.""" diff --git a/vllm/model_executor/models/solar.py b/vllm/model_executor/models/solar.py index e6d919f2..6215ed81 100644 --- a/vllm/model_executor/models/solar.py +++ b/vllm/model_executor/models/solar.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. diff --git a/vllm/model_executor/models/stablelm.py b/vllm/model_executor/models/stablelm.py index c9d1af78..a5d44326 100644 --- a/vllm/model_executor/models/stablelm.py +++ b/vllm/model_executor/models/stablelm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2023 Stability AI, EleutherAI, and The HuggingFace Inc. team. # All rights reserved. # diff --git a/vllm/model_executor/models/starcoder2.py b/vllm/model_executor/models/starcoder2.py index 1cd0dedf..01ea4366 100644 --- a/vllm/model_executor/models/starcoder2.py +++ b/vllm/model_executor/models/starcoder2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 BigCode and the HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX diff --git a/vllm/model_executor/models/telechat2.py b/vllm/model_executor/models/telechat2.py index 02ca7fe0..a38035e3 100644 --- a/vllm/model_executor/models/telechat2.py +++ b/vllm/model_executor/models/telechat2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2023 The vLLM team. # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. # diff --git a/vllm/model_executor/models/ultravox.py b/vllm/model_executor/models/ultravox.py index 605a0ecf..5e86b15d 100644 --- a/vllm/model_executor/models/ultravox.py +++ b/vllm/model_executor/models/ultravox.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from https://github.com/fixie-ai/ultravox/blob/ecd58c4041030bae2ad15aa6bcf04ab43199ea02/ultravox/model/ultravox_model.py """PyTorch Ultravox model.""" import math diff --git a/vllm/model_executor/models/utils.py b/vllm/model_executor/models/utils.py index 01a232fd..fff4be34 100644 --- a/vllm/model_executor/models/utils.py +++ b/vllm/model_executor/models/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import itertools from dataclasses import dataclass, field from typing import (Callable, Dict, Iterable, List, Literal, Mapping, Optional, diff --git a/vllm/model_executor/models/vision.py b/vllm/model_executor/models/vision.py index 57166f05..0d67ee7b 100644 --- a/vllm/model_executor/models/vision.py +++ b/vllm/model_executor/models/vision.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import Final, Generic, Optional, Protocol, TypeVar, Union diff --git a/vllm/model_executor/models/whisper.py b/vllm/model_executor/models/whisper.py index 15e35fa9..2319c316 100644 --- a/vllm/model_executor/models/whisper.py +++ b/vllm/model_executor/models/whisper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import math from typing import (Iterable, List, Mapping, Optional, Set, Tuple, TypedDict, Union) diff --git a/vllm/model_executor/parameter.py b/vllm/model_executor/parameter.py index a9ce8af1..2b1294bf 100644 --- a/vllm/model_executor/parameter.py +++ b/vllm/model_executor/parameter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from fractions import Fraction from typing import Callable, Optional, Union diff --git a/vllm/model_executor/pooling_metadata.py b/vllm/model_executor/pooling_metadata.py index b86cafce..dea8b0e9 100644 --- a/vllm/model_executor/pooling_metadata.py +++ b/vllm/model_executor/pooling_metadata.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Any, Dict, List, Tuple diff --git a/vllm/model_executor/sampling_metadata.py b/vllm/model_executor/sampling_metadata.py index 61e8881b..0a580a4e 100644 --- a/vllm/model_executor/sampling_metadata.py +++ b/vllm/model_executor/sampling_metadata.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from array import array from dataclasses import dataclass from typing import Dict, List, Optional, Tuple diff --git a/vllm/model_executor/utils.py b/vllm/model_executor/utils.py index 6f1cc9d5..04f922df 100644 --- a/vllm/model_executor/utils.py +++ b/vllm/model_executor/utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Utils for model executor.""" from typing import Any, Dict, Optional diff --git a/vllm/multimodal/__init__.py b/vllm/multimodal/__init__.py index 1d7f5d57..741bd1a6 100644 --- a/vllm/multimodal/__init__.py +++ b/vllm/multimodal/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .base import MultiModalPlaceholderMap, MultiModalPlugin from .hasher import MultiModalHashDict, MultiModalHasher from .inputs import (BatchedTensorInputs, ModalityData, MultiModalDataBuiltins, diff --git a/vllm/multimodal/audio.py b/vllm/multimodal/audio.py index de80f22b..f379ec16 100644 --- a/vllm/multimodal/audio.py +++ b/vllm/multimodal/audio.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import base64 from io import BytesIO from pathlib import Path diff --git a/vllm/multimodal/base.py b/vllm/multimodal/base.py index fd3ec7e0..c48d07ba 100644 --- a/vllm/multimodal/base.py +++ b/vllm/multimodal/base.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from collections import defaultdict from pathlib import Path diff --git a/vllm/multimodal/hasher.py b/vllm/multimodal/hasher.py index 24aa1ca6..7d277fd6 100644 --- a/vllm/multimodal/hasher.py +++ b/vllm/multimodal/hasher.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pickle from typing import TYPE_CHECKING, Iterable, Mapping, Optional diff --git a/vllm/multimodal/image.py b/vllm/multimodal/image.py index da13a381..98ac8057 100644 --- a/vllm/multimodal/image.py +++ b/vllm/multimodal/image.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import base64 from functools import lru_cache from io import BytesIO diff --git a/vllm/multimodal/inputs.py b/vllm/multimodal/inputs.py index b35184f6..eb52551b 100644 --- a/vllm/multimodal/inputs.py +++ b/vllm/multimodal/inputs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from collections import UserDict, defaultdict from collections.abc import Mapping, Sequence diff --git a/vllm/multimodal/parse.py b/vllm/multimodal/parse.py index ccff0e85..063f458b 100644 --- a/vllm/multimodal/parse.py +++ b/vllm/multimodal/parse.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from collections import UserDict from collections.abc import Callable, Iterator, Mapping, Sequence diff --git a/vllm/multimodal/processing.py b/vllm/multimodal/processing.py index 750646ac..2ad42d1c 100644 --- a/vllm/multimodal/processing.py +++ b/vllm/multimodal/processing.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import re from abc import ABC, abstractmethod from collections import defaultdict diff --git a/vllm/multimodal/profiling.py b/vllm/multimodal/profiling.py index c68edaff..953c0100 100644 --- a/vllm/multimodal/profiling.py +++ b/vllm/multimodal/profiling.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from collections.abc import Mapping from dataclasses import dataclass, field diff --git a/vllm/multimodal/registry.py b/vllm/multimodal/registry.py index 7a4b8538..29036691 100644 --- a/vllm/multimodal/registry.py +++ b/vllm/multimodal/registry.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import functools from collections import UserDict from dataclasses import dataclass diff --git a/vllm/multimodal/utils.py b/vllm/multimodal/utils.py index 900bed59..583f5365 100644 --- a/vllm/multimodal/utils.py +++ b/vllm/multimodal/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import lru_cache from itertools import groupby from pathlib import Path diff --git a/vllm/multimodal/video.py b/vllm/multimodal/video.py index 1ad1f5ab..88f18439 100644 --- a/vllm/multimodal/video.py +++ b/vllm/multimodal/video.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import base64 from functools import lru_cache, partial from io import BytesIO diff --git a/vllm/outputs.py b/vllm/outputs.py index 25b22652..786380c3 100644 --- a/vllm/outputs.py +++ b/vllm/outputs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from dataclasses import dataclass from typing import Dict, Generic, List, MutableSequence, Optional diff --git a/vllm/platforms/__init__.py b/vllm/platforms/__init__.py index ddbdc43c..d34b660d 100644 --- a/vllm/platforms/__init__.py +++ b/vllm/platforms/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import logging import traceback from itertools import chain diff --git a/vllm/platforms/cpu.py b/vllm/platforms/cpu.py index 159ea94f..4e0683b8 100644 --- a/vllm/platforms/cpu.py +++ b/vllm/platforms/cpu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import TYPE_CHECKING, Optional diff --git a/vllm/platforms/cuda.py b/vllm/platforms/cuda.py index 91dcdff0..44d2506f 100644 --- a/vllm/platforms/cuda.py +++ b/vllm/platforms/cuda.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Code inside this file can safely assume cuda platform, e.g. importing pynvml. However, it should not initialize cuda context. """ diff --git a/vllm/platforms/hpu.py b/vllm/platforms/hpu.py index 0e1c4c0c..78ddb67b 100644 --- a/vllm/platforms/hpu.py +++ b/vllm/platforms/hpu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import TYPE_CHECKING, Optional diff --git a/vllm/platforms/interface.py b/vllm/platforms/interface.py index 186fa54b..dc6545c9 100644 --- a/vllm/platforms/interface.py +++ b/vllm/platforms/interface.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum import platform import random diff --git a/vllm/platforms/neuron.py b/vllm/platforms/neuron.py index 23a7126f..5a03f5f7 100644 --- a/vllm/platforms/neuron.py +++ b/vllm/platforms/neuron.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import TYPE_CHECKING, Optional from vllm.logger import init_logger diff --git a/vllm/platforms/openvino.py b/vllm/platforms/openvino.py index 3282c061..41221de0 100644 --- a/vllm/platforms/openvino.py +++ b/vllm/platforms/openvino.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import TYPE_CHECKING, Optional import torch diff --git a/vllm/platforms/rocm.py b/vllm/platforms/rocm.py index 88885216..cd851c0d 100644 --- a/vllm/platforms/rocm.py +++ b/vllm/platforms/rocm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from functools import lru_cache from typing import TYPE_CHECKING, Dict, List, Optional diff --git a/vllm/platforms/tpu.py b/vllm/platforms/tpu.py index 494a1763..fffc61bb 100644 --- a/vllm/platforms/tpu.py +++ b/vllm/platforms/tpu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import TYPE_CHECKING, Optional import torch diff --git a/vllm/platforms/xpu.py b/vllm/platforms/xpu.py index 039cdd5a..81bc85f9 100644 --- a/vllm/platforms/xpu.py +++ b/vllm/platforms/xpu.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import TYPE_CHECKING, Optional import torch diff --git a/vllm/plugins/__init__.py b/vllm/plugins/__init__.py index a78a0549..389cb872 100644 --- a/vllm/plugins/__init__.py +++ b/vllm/plugins/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import logging import os from typing import Callable, Dict diff --git a/vllm/pooling_params.py b/vllm/pooling_params.py index b24b7e91..061232eb 100644 --- a/vllm/pooling_params.py +++ b/vllm/pooling_params.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Optional import msgspec diff --git a/vllm/profiler/__init__.py b/vllm/profiler/__init__.py index 3e25f5cc..00af72b1 100644 --- a/vllm/profiler/__init__.py +++ b/vllm/profiler/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .layerwise_profile import layerwise_profile __all__ = [ diff --git a/vllm/profiler/layerwise_profile.py b/vllm/profiler/layerwise_profile.py index 29c0edd0..6351ef63 100644 --- a/vllm/profiler/layerwise_profile.py +++ b/vllm/profiler/layerwise_profile.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import copy from collections import defaultdict from dataclasses import asdict, dataclass, field diff --git a/vllm/profiler/utils.py b/vllm/profiler/utils.py index 033035e4..62b39f51 100644 --- a/vllm/profiler/utils.py +++ b/vllm/profiler/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import Callable, Dict, List, Type, Union diff --git a/vllm/prompt_adapter/layers.py b/vllm/prompt_adapter/layers.py index 27a61e69..c2f9f169 100644 --- a/vllm/prompt_adapter/layers.py +++ b/vllm/prompt_adapter/layers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Optional diff --git a/vllm/prompt_adapter/models.py b/vllm/prompt_adapter/models.py index 18a5f86c..3ba7d089 100644 --- a/vllm/prompt_adapter/models.py +++ b/vllm/prompt_adapter/models.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import logging import math from typing import Any, Callable, Dict, List, Optional, Type diff --git a/vllm/prompt_adapter/request.py b/vllm/prompt_adapter/request.py index 775dd11d..dfb8e61d 100644 --- a/vllm/prompt_adapter/request.py +++ b/vllm/prompt_adapter/request.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import msgspec from vllm.adapter_commons.request import AdapterRequest diff --git a/vllm/prompt_adapter/utils.py b/vllm/prompt_adapter/utils.py index 8b273292..dd179ab9 100644 --- a/vllm/prompt_adapter/utils.py +++ b/vllm/prompt_adapter/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # code borrowed from: https://github.com/huggingface/peft/blob/v0.12.0/src/peft/utils/save_and_load.py#L420 import os diff --git a/vllm/prompt_adapter/worker_manager.py b/vllm/prompt_adapter/worker_manager.py index ddc1ef89..28dcc168 100644 --- a/vllm/prompt_adapter/worker_manager.py +++ b/vllm/prompt_adapter/worker_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import logging from typing import Any, Optional, Set, Type diff --git a/vllm/sampling_params.py b/vllm/sampling_params.py index 605c09b8..97f9e212 100644 --- a/vllm/sampling_params.py +++ b/vllm/sampling_params.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Sampling parameters for text generation.""" import copy from dataclasses import dataclass diff --git a/vllm/scalar_type.py b/vllm/scalar_type.py index 20063a5b..9f6e8592 100644 --- a/vllm/scalar_type.py +++ b/vllm/scalar_type.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import functools import struct from dataclasses import dataclass diff --git a/vllm/scripts.py b/vllm/scripts.py index 8101e6b3..467cab28 100644 --- a/vllm/scripts.py +++ b/vllm/scripts.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # The CLI entrypoint to vLLM. import argparse import os diff --git a/vllm/sequence.py b/vllm/sequence.py index 74320db7..534b9e60 100644 --- a/vllm/sequence.py +++ b/vllm/sequence.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Sequence and its related classes.""" import copy import enum diff --git a/vllm/spec_decode/batch_expansion.py b/vllm/spec_decode/batch_expansion.py index 56fb9ba5..e08ed742 100644 --- a/vllm/spec_decode/batch_expansion.py +++ b/vllm/spec_decode/batch_expansion.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from array import array from itertools import chain, count from typing import Iterator, List, Optional, Tuple diff --git a/vllm/spec_decode/draft_model_runner.py b/vllm/spec_decode/draft_model_runner.py index fe5fd39f..3948298d 100644 --- a/vllm/spec_decode/draft_model_runner.py +++ b/vllm/spec_decode/draft_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional import torch diff --git a/vllm/spec_decode/interfaces.py b/vllm/spec_decode/interfaces.py index c39e98b6..dd085ad7 100644 --- a/vllm/spec_decode/interfaces.py +++ b/vllm/spec_decode/interfaces.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from dataclasses import dataclass from typing import List, Optional, Set, Union diff --git a/vllm/spec_decode/medusa_worker.py b/vllm/spec_decode/medusa_worker.py index 21a58fc4..0b62a988 100644 --- a/vllm/spec_decode/medusa_worker.py +++ b/vllm/spec_decode/medusa_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import weakref from typing import List, Optional, Set, Tuple diff --git a/vllm/spec_decode/metrics.py b/vllm/spec_decode/metrics.py index d678f457..bc0e0a12 100644 --- a/vllm/spec_decode/metrics.py +++ b/vllm/spec_decode/metrics.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from typing import Callable, Optional, Union diff --git a/vllm/spec_decode/mlp_speculator_worker.py b/vllm/spec_decode/mlp_speculator_worker.py index fc41bb82..bdaf3189 100644 --- a/vllm/spec_decode/mlp_speculator_worker.py +++ b/vllm/spec_decode/mlp_speculator_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Set, Tuple import torch diff --git a/vllm/spec_decode/mqa_scorer.py b/vllm/spec_decode/mqa_scorer.py index 3aea2eab..6275c460 100644 --- a/vllm/spec_decode/mqa_scorer.py +++ b/vllm/spec_decode/mqa_scorer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.sequence import (ExecuteModelRequest, SequenceData, SequenceGroupMetadata, get_all_seq_ids) from vllm.spec_decode.interfaces import (SpeculativeProposals, diff --git a/vllm/spec_decode/multi_step_worker.py b/vllm/spec_decode/multi_step_worker.py index 32197f8c..5474917a 100644 --- a/vllm/spec_decode/multi_step_worker.py +++ b/vllm/spec_decode/multi_step_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import copy import weakref from typing import Dict, List, Set, Tuple diff --git a/vllm/spec_decode/ngram_worker.py b/vllm/spec_decode/ngram_worker.py index e906b178..86390c99 100644 --- a/vllm/spec_decode/ngram_worker.py +++ b/vllm/spec_decode/ngram_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import weakref from typing import List, Optional, Set, Tuple diff --git a/vllm/spec_decode/proposer_worker_base.py b/vllm/spec_decode/proposer_worker_base.py index 28a53759..2bebf80f 100644 --- a/vllm/spec_decode/proposer_worker_base.py +++ b/vllm/spec_decode/proposer_worker_base.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import List, Optional, Set, Tuple diff --git a/vllm/spec_decode/smaller_tp_proposer_worker.py b/vllm/spec_decode/smaller_tp_proposer_worker.py index c6ff5e52..a1466ba5 100644 --- a/vllm/spec_decode/smaller_tp_proposer_worker.py +++ b/vllm/spec_decode/smaller_tp_proposer_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Set, Tuple import torch diff --git a/vllm/spec_decode/spec_decode_worker.py b/vllm/spec_decode/spec_decode_worker.py index 8d6d05cb..8653bece 100644 --- a/vllm/spec_decode/spec_decode_worker.py +++ b/vllm/spec_decode/spec_decode_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import copy from collections import defaultdict from functools import cached_property diff --git a/vllm/spec_decode/target_model_runner.py b/vllm/spec_decode/target_model_runner.py index 56540744..08e773c5 100644 --- a/vllm/spec_decode/target_model_runner.py +++ b/vllm/spec_decode/target_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional from vllm.sequence import SequenceGroupMetadata diff --git a/vllm/spec_decode/top1_proposer.py b/vllm/spec_decode/top1_proposer.py index 6bf7587c..b538923c 100644 --- a/vllm/spec_decode/top1_proposer.py +++ b/vllm/spec_decode/top1_proposer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Set, Tuple import torch diff --git a/vllm/spec_decode/util.py b/vllm/spec_decode/util.py index c88820ab..9c04680a 100644 --- a/vllm/spec_decode/util.py +++ b/vllm/spec_decode/util.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from contextlib import contextmanager from typing import Dict, List, Optional, Sequence, Tuple diff --git a/vllm/tracing.py b/vllm/tracing.py index 72a3f851..bf069ad8 100644 --- a/vllm/tracing.py +++ b/vllm/tracing.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import Mapping, Optional diff --git a/vllm/transformers_utils/__init__.py b/vllm/transformers_utils/__init__.py index eeec029f..01d5bb4b 100644 --- a/vllm/transformers_utils/__init__.py +++ b/vllm/transformers_utils/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.envs import VLLM_USE_MODELSCOPE if VLLM_USE_MODELSCOPE: diff --git a/vllm/transformers_utils/config.py b/vllm/transformers_utils/config.py index 5805f4ad..1c0f20a6 100644 --- a/vllm/transformers_utils/config.py +++ b/vllm/transformers_utils/config.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum import json import os diff --git a/vllm/transformers_utils/configs/__init__.py b/vllm/transformers_utils/configs/__init__.py index f065c561..c484a755 100644 --- a/vllm/transformers_utils/configs/__init__.py +++ b/vllm/transformers_utils/configs/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.transformers_utils.configs.chatglm import ChatGLMConfig from vllm.transformers_utils.configs.cohere2 import Cohere2Config from vllm.transformers_utils.configs.dbrx import DbrxConfig diff --git a/vllm/transformers_utils/configs/arctic.py b/vllm/transformers_utils/configs/arctic.py index 7780bf5e..6625ccf0 100644 --- a/vllm/transformers_utils/configs/arctic.py +++ b/vllm/transformers_utils/configs/arctic.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # yapf: disable # ruff: noqa: E501 # coding=utf-8 diff --git a/vllm/transformers_utils/configs/chatglm.py b/vllm/transformers_utils/configs/chatglm.py index e563bf62..43e9503f 100644 --- a/vllm/transformers_utils/configs/chatglm.py +++ b/vllm/transformers_utils/configs/chatglm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://github.com/THUDM/ChatGLM2-6B from transformers import PretrainedConfig diff --git a/vllm/transformers_utils/configs/cohere2.py b/vllm/transformers_utils/configs/cohere2.py index 1509330f..e30409b3 100644 --- a/vllm/transformers_utils/configs/cohere2.py +++ b/vllm/transformers_utils/configs/cohere2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # ruff: noqa # Adapted from diff --git a/vllm/transformers_utils/configs/dbrx.py b/vllm/transformers_utils/configs/dbrx.py index 0dc96647..8f40b2b7 100644 --- a/vllm/transformers_utils/configs/dbrx.py +++ b/vllm/transformers_utils/configs/dbrx.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # yapf: disable # ruff: noqa: E501 # coding=utf-8 diff --git a/vllm/transformers_utils/configs/deepseek_vl2.py b/vllm/transformers_utils/configs/deepseek_vl2.py index 681528c3..24d4052d 100644 --- a/vllm/transformers_utils/configs/deepseek_vl2.py +++ b/vllm/transformers_utils/configs/deepseek_vl2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://github.com/deepseek-ai/DeepSeek-VL2/blob/faf18023f24b962b32d9f0a2d89e402a8d383a78/deepseek_vl2/models/modeling_deepseek_vl_v2.py#L115-L268 from typing import Tuple diff --git a/vllm/transformers_utils/configs/eagle.py b/vllm/transformers_utils/configs/eagle.py index b357a785..b26aba66 100644 --- a/vllm/transformers_utils/configs/eagle.py +++ b/vllm/transformers_utils/configs/eagle.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import Optional, Union diff --git a/vllm/transformers_utils/configs/exaone.py b/vllm/transformers_utils/configs/exaone.py index f60a59f5..39364367 100644 --- a/vllm/transformers_utils/configs/exaone.py +++ b/vllm/transformers_utils/configs/exaone.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copied from # https://huggingface.co/LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct/blob/main/configuration_exaone.py # Copyright 2021 The LG AI Research EXAONE Lab. All rights reserved. diff --git a/vllm/transformers_utils/configs/falcon.py b/vllm/transformers_utils/configs/falcon.py index c82cc606..f161a06f 100644 --- a/vllm/transformers_utils/configs/falcon.py +++ b/vllm/transformers_utils/configs/falcon.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/tiiuae/falcon-7b/blob/main/configuration_RW.py # Copyright 2023 The vLLM team. diff --git a/vllm/transformers_utils/configs/h2ovl.py b/vllm/transformers_utils/configs/h2ovl.py index b94c5b77..48b5d79f 100644 --- a/vllm/transformers_utils/configs/h2ovl.py +++ b/vllm/transformers_utils/configs/h2ovl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/h2oai/h2ovl-mississippi-2b/blob/main/configuration_h2ovl_chat.py # -------------------------------------------------------- diff --git a/vllm/transformers_utils/configs/internvl.py b/vllm/transformers_utils/configs/internvl.py index ac249231..8ea62546 100644 --- a/vllm/transformers_utils/configs/internvl.py +++ b/vllm/transformers_utils/configs/internvl.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/OpenGVLab/InternVL2-1B/blob/main/configuration_internvl_chat.py # -------------------------------------------------------- diff --git a/vllm/transformers_utils/configs/jais.py b/vllm/transformers_utils/configs/jais.py index 82f129eb..0cab2c42 100644 --- a/vllm/transformers_utils/configs/jais.py +++ b/vllm/transformers_utils/configs/jais.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2023 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Copyright 2023 Cerebras Systems. diff --git a/vllm/transformers_utils/configs/medusa.py b/vllm/transformers_utils/configs/medusa.py index d71a0834..885713c5 100644 --- a/vllm/transformers_utils/configs/medusa.py +++ b/vllm/transformers_utils/configs/medusa.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import Optional, Union diff --git a/vllm/transformers_utils/configs/mllama.py b/vllm/transformers_utils/configs/mllama.py index 49e766d7..eb77e09a 100644 --- a/vllm/transformers_utils/configs/mllama.py +++ b/vllm/transformers_utils/configs/mllama.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from transformers.models.mllama import configuration_mllama as mllama_hf_config diff --git a/vllm/transformers_utils/configs/mlp_speculator.py b/vllm/transformers_utils/configs/mlp_speculator.py index 946af4e9..c761f659 100644 --- a/vllm/transformers_utils/configs/mlp_speculator.py +++ b/vllm/transformers_utils/configs/mlp_speculator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional from transformers import PretrainedConfig diff --git a/vllm/transformers_utils/configs/mpt.py b/vllm/transformers_utils/configs/mpt.py index 0f047c8b..96356135 100644 --- a/vllm/transformers_utils/configs/mpt.py +++ b/vllm/transformers_utils/configs/mpt.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copied from # https://huggingface.co/mosaicml/mpt-7b/blob/main/configuration_mpt.py """A HuggingFace-style model configuration.""" diff --git a/vllm/transformers_utils/configs/nemotron.py b/vllm/transformers_utils/configs/nemotron.py index 1edf3632..fdf4fa2a 100644 --- a/vllm/transformers_utils/configs/nemotron.py +++ b/vllm/transformers_utils/configs/nemotron.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2024 HuggingFace Inc. team. All rights reserved. # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. # diff --git a/vllm/transformers_utils/configs/nvlm_d.py b/vllm/transformers_utils/configs/nvlm_d.py index 8007176a..300f6e21 100644 --- a/vllm/transformers_utils/configs/nvlm_d.py +++ b/vllm/transformers_utils/configs/nvlm_d.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from # https://huggingface.co/nvidia/NVLM-D-72B/blob/main/configuration_nvlm_d.py # -------------------------------------------------------- diff --git a/vllm/transformers_utils/configs/olmo2.py b/vllm/transformers_utils/configs/olmo2.py index 0e6d8e48..c6e44633 100644 --- a/vllm/transformers_utils/configs/olmo2.py +++ b/vllm/transformers_utils/configs/olmo2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # yapf: disable # ruff: noqa: E501 # coding=utf-8 diff --git a/vllm/transformers_utils/configs/solar.py b/vllm/transformers_utils/configs/solar.py index 0c1c048f..0d5db896 100644 --- a/vllm/transformers_utils/configs/solar.py +++ b/vllm/transformers_utils/configs/solar.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX diff --git a/vllm/transformers_utils/configs/telechat2.py b/vllm/transformers_utils/configs/telechat2.py index eb6f5a05..5da6c5b4 100644 --- a/vllm/transformers_utils/configs/telechat2.py +++ b/vllm/transformers_utils/configs/telechat2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # adapted from https://www.modelscope.cn/models/TeleAI/TeleChat2-3B/resolve/master/configuration_telechat2.py """ Telechat configuration compatible with LlamaConfig. """ diff --git a/vllm/transformers_utils/configs/ultravox.py b/vllm/transformers_utils/configs/ultravox.py index f724bf7f..99715ba6 100644 --- a/vllm/transformers_utils/configs/ultravox.py +++ b/vllm/transformers_utils/configs/ultravox.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Adapted from https://github.com/fixie-ai/ultravox/blob/ecd58c4041030bae2ad15aa6bcf04ab43199ea02/ultravox/model/ultravox_config.py from typing import Any, Dict, Optional diff --git a/vllm/transformers_utils/detokenizer.py b/vllm/transformers_utils/detokenizer.py index 7c8423d2..9d1d4bb9 100644 --- a/vllm/transformers_utils/detokenizer.py +++ b/vllm/transformers_utils/detokenizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List, Optional from vllm.sequence import (VLLM_INVALID_TOKEN_ID, Logprob, SamplingParams, diff --git a/vllm/transformers_utils/detokenizer_utils.py b/vllm/transformers_utils/detokenizer_utils.py index 37ff8a23..8160a35f 100644 --- a/vllm/transformers_utils/detokenizer_utils.py +++ b/vllm/transformers_utils/detokenizer_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional, Tuple from .tokenizer import AnyTokenizer diff --git a/vllm/transformers_utils/processor.py b/vllm/transformers_utils/processor.py index b12cc83a..3197b07d 100644 --- a/vllm/transformers_utils/processor.py +++ b/vllm/transformers_utils/processor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from functools import lru_cache from typing import Any, cast diff --git a/vllm/transformers_utils/processors/__init__.py b/vllm/transformers_utils/processors/__init__.py index 9c71b8ca..4696f0c4 100644 --- a/vllm/transformers_utils/processors/__init__.py +++ b/vllm/transformers_utils/processors/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.transformers_utils.processors.deepseek_vl2 import ( DeepseekVLV2Processor) diff --git a/vllm/transformers_utils/processors/deepseek_vl2.py b/vllm/transformers_utils/processors/deepseek_vl2.py index 27cdf6bc..d37381ea 100644 --- a/vllm/transformers_utils/processors/deepseek_vl2.py +++ b/vllm/transformers_utils/processors/deepseek_vl2.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # yapf: disable # ruff: noqa: E501 # coding=utf-8 diff --git a/vllm/transformers_utils/s3_utils.py b/vllm/transformers_utils/s3_utils.py index 74a56cbf..4fe744d2 100644 --- a/vllm/transformers_utils/s3_utils.py +++ b/vllm/transformers_utils/s3_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import fnmatch import os import shutil diff --git a/vllm/transformers_utils/tokenizer.py b/vllm/transformers_utils/tokenizer.py index 1f1d67fa..520870b5 100644 --- a/vllm/transformers_utils/tokenizer.py +++ b/vllm/transformers_utils/tokenizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import contextlib import os import warnings diff --git a/vllm/transformers_utils/tokenizer_group/__init__.py b/vllm/transformers_utils/tokenizer_group/__init__.py index 09569c56..c223768b 100644 --- a/vllm/transformers_utils/tokenizer_group/__init__.py +++ b/vllm/transformers_utils/tokenizer_group/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Type from vllm.config import (LoRAConfig, ModelConfig, ParallelConfig, diff --git a/vllm/transformers_utils/tokenizer_group/base_tokenizer_group.py b/vllm/transformers_utils/tokenizer_group/base_tokenizer_group.py index e6cc7cd4..fbdfa3e5 100644 --- a/vllm/transformers_utils/tokenizer_group/base_tokenizer_group.py +++ b/vllm/transformers_utils/tokenizer_group/base_tokenizer_group.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from abc import ABC, abstractmethod from typing import List, Optional diff --git a/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py b/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py index 3f7627e1..30cab752 100644 --- a/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py +++ b/vllm/transformers_utils/tokenizer_group/ray_tokenizer_group.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os from typing import List, Optional diff --git a/vllm/transformers_utils/tokenizer_group/tokenizer_group.py b/vllm/transformers_utils/tokenizer_group/tokenizer_group.py index 6dc2f905..025971cb 100644 --- a/vllm/transformers_utils/tokenizer_group/tokenizer_group.py +++ b/vllm/transformers_utils/tokenizer_group/tokenizer_group.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional from vllm.config import TokenizerPoolConfig diff --git a/vllm/transformers_utils/tokenizers/__init__.py b/vllm/transformers_utils/tokenizers/__init__.py index e68ad79b..2b64f3fc 100644 --- a/vllm/transformers_utils/tokenizers/__init__.py +++ b/vllm/transformers_utils/tokenizers/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from .mistral import MistralTokenizer, maybe_serialize_tool_calls __all__ = ["MistralTokenizer", "maybe_serialize_tool_calls"] diff --git a/vllm/transformers_utils/tokenizers/mistral.py b/vllm/transformers_utils/tokenizers/mistral.py index d801cf4e..cecafcc7 100644 --- a/vllm/transformers_utils/tokenizers/mistral.py +++ b/vllm/transformers_utils/tokenizers/mistral.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import re from dataclasses import dataclass diff --git a/vllm/transformers_utils/utils.py b/vllm/transformers_utils/utils.py index 10a09fb4..71fe3ef0 100644 --- a/vllm/transformers_utils/utils.py +++ b/vllm/transformers_utils/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from os import PathLike from pathlib import Path from typing import Union diff --git a/vllm/triton_utils/__init__.py b/vllm/triton_utils/__init__.py index 56818538..c8f7a32c 100644 --- a/vllm/triton_utils/__init__.py +++ b/vllm/triton_utils/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from vllm.triton_utils.importing import HAS_TRITON __all__ = ["HAS_TRITON"] diff --git a/vllm/triton_utils/custom_cache_manager.py b/vllm/triton_utils/custom_cache_manager.py index 17039d7b..4163969c 100644 --- a/vllm/triton_utils/custom_cache_manager.py +++ b/vllm/triton_utils/custom_cache_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from triton.runtime.cache import (FileCacheManager, default_cache_dir, diff --git a/vllm/triton_utils/importing.py b/vllm/triton_utils/importing.py index 0c96e063..a2070024 100644 --- a/vllm/triton_utils/importing.py +++ b/vllm/triton_utils/importing.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from importlib.util import find_spec from vllm.logger import init_logger diff --git a/vllm/usage/usage_lib.py b/vllm/usage/usage_lib.py index 7f5cc906..fbbb21c8 100644 --- a/vllm/usage/usage_lib.py +++ b/vllm/usage/usage_lib.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import datetime import json import logging diff --git a/vllm/utils.py b/vllm/utils.py index 15481fb0..3089f095 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import argparse import asyncio import concurrent diff --git a/vllm/v1/attention/backends/flash_attn.py b/vllm/v1/attention/backends/flash_attn.py index ce83b1fa..837d7faf 100755 --- a/vllm/v1/attention/backends/flash_attn.py +++ b/vllm/v1/attention/backends/flash_attn.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """Attention layer with FlashAttention.""" from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple, Type diff --git a/vllm/v1/core/encoder_cache_manager.py b/vllm/v1/core/encoder_cache_manager.py index 9d570b33..651bc01a 100644 --- a/vllm/v1/core/encoder_cache_manager.py +++ b/vllm/v1/core/encoder_cache_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import TYPE_CHECKING, Dict, List, Set, Tuple from vllm.logger import init_logger diff --git a/vllm/v1/core/kv_cache_manager.py b/vllm/v1/core/kv_cache_manager.py index 7176ec95..94086e4a 100644 --- a/vllm/v1/core/kv_cache_manager.py +++ b/vllm/v1/core/kv_cache_manager.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import defaultdict from typing import DefaultDict, Dict, Iterable, List, Optional, Tuple diff --git a/vllm/v1/core/kv_cache_utils.py b/vllm/v1/core/kv_cache_utils.py index 2b6557ad..c801ab9e 100644 --- a/vllm/v1/core/kv_cache_utils.py +++ b/vllm/v1/core/kv_cache_utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """KV-Cache Utilities.""" from collections.abc import Sequence from dataclasses import dataclass diff --git a/vllm/v1/core/scheduler.py b/vllm/v1/core/scheduler.py index 27c9ac1a..f4738bb3 100644 --- a/vllm/v1/core/scheduler.py +++ b/vllm/v1/core/scheduler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import deque from dataclasses import dataclass from typing import (TYPE_CHECKING, Deque, Dict, Iterable, List, Optional, Set, diff --git a/vllm/v1/engine/__init__.py b/vllm/v1/engine/__init__.py index abe4952c..912b9286 100644 --- a/vllm/v1/engine/__init__.py +++ b/vllm/v1/engine/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum from dataclasses import dataclass from typing import TYPE_CHECKING, List, Optional, Union diff --git a/vllm/v1/engine/async_llm.py b/vllm/v1/engine/async_llm.py index b9dc3561..3c4e35e4 100644 --- a/vllm/v1/engine/async_llm.py +++ b/vllm/v1/engine/async_llm.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os from typing import AsyncGenerator, List, Mapping, Optional, Type, Union diff --git a/vllm/v1/engine/core.py b/vllm/v1/engine/core.py index f50303bd..29a9ac18 100644 --- a/vllm/v1/engine/core.py +++ b/vllm/v1/engine/core.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pickle import queue import signal diff --git a/vllm/v1/engine/core_client.py b/vllm/v1/engine/core_client.py index f3b992d6..247380ef 100644 --- a/vllm/v1/engine/core_client.py +++ b/vllm/v1/engine/core_client.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio import os import signal diff --git a/vllm/v1/engine/detokenizer.py b/vllm/v1/engine/detokenizer.py index 4a8b61be..6d800f02 100644 --- a/vllm/v1/engine/detokenizer.py +++ b/vllm/v1/engine/detokenizer.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import List, Optional, Union diff --git a/vllm/v1/engine/llm_engine.py b/vllm/v1/engine/llm_engine.py index 55d314eb..e0452bca 100644 --- a/vllm/v1/engine/llm_engine.py +++ b/vllm/v1/engine/llm_engine.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict, List, Mapping, Optional, Type, Union from typing_extensions import TypeVar diff --git a/vllm/v1/engine/mm_input_mapper.py b/vllm/v1/engine/mm_input_mapper.py index d83460a4..83a0d9db 100644 --- a/vllm/v1/engine/mm_input_mapper.py +++ b/vllm/v1/engine/mm_input_mapper.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Dict, List, Optional from vllm.config import ModelConfig diff --git a/vllm/v1/engine/output_processor.py b/vllm/v1/engine/output_processor.py index 234ef819..aeefd523 100644 --- a/vllm/v1/engine/output_processor.py +++ b/vllm/v1/engine/output_processor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import asyncio from dataclasses import dataclass from typing import Dict, List, Optional diff --git a/vllm/v1/engine/processor.py b/vllm/v1/engine/processor.py index 6196c110..36628795 100644 --- a/vllm/v1/engine/processor.py +++ b/vllm/v1/engine/processor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from typing import Mapping, Optional, Union diff --git a/vllm/v1/executor/abstract.py b/vllm/v1/executor/abstract.py index 131be759..ac10d43e 100644 --- a/vllm/v1/executor/abstract.py +++ b/vllm/v1/executor/abstract.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Type from vllm.config import VllmConfig diff --git a/vllm/v1/executor/multiproc_executor.py b/vllm/v1/executor/multiproc_executor.py index f6cf35da..e3f07172 100644 --- a/vllm/v1/executor/multiproc_executor.py +++ b/vllm/v1/executor/multiproc_executor.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os import pickle import signal diff --git a/vllm/v1/kv_cache_interface.py b/vllm/v1/kv_cache_interface.py index 6d5cc32f..eddfb594 100644 --- a/vllm/v1/kv_cache_interface.py +++ b/vllm/v1/kv_cache_interface.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Dict, List diff --git a/vllm/v1/metrics/loggers.py b/vllm/v1/metrics/loggers.py index f901822c..f736e38f 100644 --- a/vllm/v1/metrics/loggers.py +++ b/vllm/v1/metrics/loggers.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from abc import ABC, abstractmethod from typing import List diff --git a/vllm/v1/metrics/stats.py b/vllm/v1/metrics/stats.py index 52775051..88f2c083 100644 --- a/vllm/v1/metrics/stats.py +++ b/vllm/v1/metrics/stats.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from dataclasses import dataclass from typing import TYPE_CHECKING, List diff --git a/vllm/v1/outputs.py b/vllm/v1/outputs.py index 32aee44e..6e82bffd 100644 --- a/vllm/v1/outputs.py +++ b/vllm/v1/outputs.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Dict, List, Optional diff --git a/vllm/v1/request.py b/vllm/v1/request.py index 80160c67..0519d9e7 100644 --- a/vllm/v1/request.py +++ b/vllm/v1/request.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum from typing import TYPE_CHECKING, List, Optional, Union diff --git a/vllm/v1/sample/metadata.py b/vllm/v1/sample/metadata.py index d60f7eb5..8e54de34 100644 --- a/vllm/v1/sample/metadata.py +++ b/vllm/v1/sample/metadata.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from dataclasses import dataclass from typing import Dict, List, Optional, Set diff --git a/vllm/v1/sample/ops/penalties.py b/vllm/v1/sample/ops/penalties.py index 2796d049..ba368b44 100644 --- a/vllm/v1/sample/ops/penalties.py +++ b/vllm/v1/sample/ops/penalties.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Set, Tuple import torch diff --git a/vllm/v1/sample/ops/topk_topp_sampler.py b/vllm/v1/sample/ops/topk_topp_sampler.py index f2007d85..27431001 100644 --- a/vllm/v1/sample/ops/topk_topp_sampler.py +++ b/vllm/v1/sample/ops/topk_topp_sampler.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict import torch diff --git a/vllm/v1/sample/sampler.py b/vllm/v1/sample/sampler.py index 9ad665a6..3da7498e 100644 --- a/vllm/v1/sample/sampler.py +++ b/vllm/v1/sample/sampler.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A layer that samples the next tokens from the model's outputs.""" from typing import Tuple diff --git a/vllm/v1/serial_utils.py b/vllm/v1/serial_utils.py index b1cd5c11..1791dfa2 100644 --- a/vllm/v1/serial_utils.py +++ b/vllm/v1/serial_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import pickle diff --git a/vllm/v1/stats/common.py b/vllm/v1/stats/common.py index 902800e0..09d38263 100644 --- a/vllm/v1/stats/common.py +++ b/vllm/v1/stats/common.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import time from dataclasses import dataclass from dataclasses import field as dataclass_field diff --git a/vllm/v1/utils.py b/vllm/v1/utils.py index 8dfcf2dd..5494542c 100644 --- a/vllm/v1/utils.py +++ b/vllm/v1/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import multiprocessing import os import weakref diff --git a/vllm/v1/worker/block_table.py b/vllm/v1/worker/block_table.py index 26a2084b..8d078524 100644 --- a/vllm/v1/worker/block_table.py +++ b/vllm/v1/worker/block_table.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from typing import List import numpy as np diff --git a/vllm/v1/worker/gpu_input_batch.py b/vllm/v1/worker/gpu_input_batch.py index 28d8e390..39708f83 100644 --- a/vllm/v1/worker/gpu_input_batch.py +++ b/vllm/v1/worker/gpu_input_batch.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + # Datastructures defining an input batch from dataclasses import dataclass diff --git a/vllm/v1/worker/gpu_model_runner.py b/vllm/v1/worker/gpu_model_runner.py index a00c00c3..0b564452 100644 --- a/vllm/v1/worker/gpu_model_runner.py +++ b/vllm/v1/worker/gpu_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import gc import time from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, cast diff --git a/vllm/v1/worker/gpu_worker.py b/vllm/v1/worker/gpu_worker.py index a8cf0aec..0adb6907 100644 --- a/vllm/v1/worker/gpu_worker.py +++ b/vllm/v1/worker/gpu_worker.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A GPU worker class.""" import gc import os diff --git a/vllm/version.py b/vllm/version.py index 66e189dc..70cd0289 100644 --- a/vllm/version.py +++ b/vllm/version.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + try: from ._version import __version__, __version_tuple__ except Exception as e: diff --git a/vllm/worker/cache_engine.py b/vllm/worker/cache_engine.py index c427b759..252fe066 100644 --- a/vllm/worker/cache_engine.py +++ b/vllm/worker/cache_engine.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """CacheEngine class for managing the KV cache.""" from typing import List diff --git a/vllm/worker/cpu_enc_dec_model_runner.py b/vllm/worker/cpu_enc_dec_model_runner.py index fa6775cb..71e32c5f 100644 --- a/vllm/worker/cpu_enc_dec_model_runner.py +++ b/vllm/worker/cpu_enc_dec_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, cast diff --git a/vllm/worker/cpu_model_runner.py b/vllm/worker/cpu_model_runner.py index 4b429b67..1c3feece 100644 --- a/vllm/worker/cpu_model_runner.py +++ b/vllm/worker/cpu_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses import weakref from collections import defaultdict diff --git a/vllm/worker/cpu_pooling_model_runner.py b/vllm/worker/cpu_pooling_model_runner.py index d31ba89e..c0744d63 100644 --- a/vllm/worker/cpu_pooling_model_runner.py +++ b/vllm/worker/cpu_pooling_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import Any, Dict, List, Optional, Tuple, Type, Union diff --git a/vllm/worker/cpu_worker.py b/vllm/worker/cpu_worker.py index 3e5fcf11..27b1a2dd 100644 --- a/vllm/worker/cpu_worker.py +++ b/vllm/worker/cpu_worker.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A CPU worker class.""" from typing import Dict, List, Optional, Set, Tuple, Type diff --git a/vllm/worker/enc_dec_model_runner.py b/vllm/worker/enc_dec_model_runner.py index 8a161b74..e2d338f7 100644 --- a/vllm/worker/enc_dec_model_runner.py +++ b/vllm/worker/enc_dec_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses import itertools from typing import Any, Dict, List, Optional, Tuple, Type, cast diff --git a/vllm/worker/hpu_model_runner.py b/vllm/worker/hpu_model_runner.py index a339c97a..b846d438 100644 --- a/vllm/worker/hpu_model_runner.py +++ b/vllm/worker/hpu_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + ############################################################################### # Copyright (C) 2024 Habana Labs, Ltd. an Intel Company ############################################################################### diff --git a/vllm/worker/hpu_worker.py b/vllm/worker/hpu_worker.py index aaf9cb40..a1f31bea 100644 --- a/vllm/worker/hpu_worker.py +++ b/vllm/worker/hpu_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + ############################################################################### # Copyright (C) 2024 Habana Labs, Ltd. an Intel Company ############################################################################### diff --git a/vllm/worker/model_runner.py b/vllm/worker/model_runner.py index 322d91d6..90f08b1d 100644 --- a/vllm/worker/model_runner.py +++ b/vllm/worker/model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses import gc import inspect diff --git a/vllm/worker/model_runner_base.py b/vllm/worker/model_runner_base.py index aef4bdcd..9e33ef9f 100644 --- a/vllm/worker/model_runner_base.py +++ b/vllm/worker/model_runner_base.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses import pickle from abc import ABC, abstractmethod diff --git a/vllm/worker/multi_step_model_runner.py b/vllm/worker/multi_step_model_runner.py index 4aab09c8..90771e8a 100644 --- a/vllm/worker/multi_step_model_runner.py +++ b/vllm/worker/multi_step_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses import functools from dataclasses import dataclass, field diff --git a/vllm/worker/multi_step_tpu_worker.py b/vllm/worker/multi_step_tpu_worker.py index e654f717..38711999 100644 --- a/vllm/worker/multi_step_tpu_worker.py +++ b/vllm/worker/multi_step_tpu_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import Dict, Optional, Tuple diff --git a/vllm/worker/multi_step_worker.py b/vllm/worker/multi_step_worker.py index 1f982fe1..3518ab2f 100644 --- a/vllm/worker/multi_step_worker.py +++ b/vllm/worker/multi_step_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from dataclasses import dataclass from typing import Dict, List, Optional, Tuple diff --git a/vllm/worker/neuron_model_runner.py b/vllm/worker/neuron_model_runner.py index 596c26ea..f2093fc4 100644 --- a/vllm/worker/neuron_model_runner.py +++ b/vllm/worker/neuron_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from dataclasses import dataclass from importlib.util import find_spec diff --git a/vllm/worker/neuron_worker.py b/vllm/worker/neuron_worker.py index e02c72fa..5f0eb001 100644 --- a/vllm/worker/neuron_worker.py +++ b/vllm/worker/neuron_worker.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A Neuron worker class.""" from typing import List, Optional, Tuple diff --git a/vllm/worker/openvino_model_runner.py b/vllm/worker/openvino_model_runner.py index 42fe2cf6..44442cdd 100644 --- a/vllm/worker/openvino_model_runner.py +++ b/vllm/worker/openvino_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from collections import defaultdict from typing import Dict, List, NamedTuple, Optional, Tuple diff --git a/vllm/worker/openvino_worker.py b/vllm/worker/openvino_worker.py index f5b46cde..0690222d 100644 --- a/vllm/worker/openvino_worker.py +++ b/vllm/worker/openvino_worker.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """An OpenVINO worker class.""" from typing import Any, Dict, List, Optional, Tuple diff --git a/vllm/worker/pooling_model_runner.py b/vllm/worker/pooling_model_runner.py index 6de227f3..f43085b0 100644 --- a/vllm/worker/pooling_model_runner.py +++ b/vllm/worker/pooling_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses from typing import Any, Dict, List, Optional, Tuple, Type, Union diff --git a/vllm/worker/tpu_model_runner.py b/vllm/worker/tpu_model_runner.py index 87495182..ecdf7aa8 100644 --- a/vllm/worker/tpu_model_runner.py +++ b/vllm/worker/tpu_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import enum import time from dataclasses import dataclass diff --git a/vllm/worker/tpu_worker.py b/vllm/worker/tpu_worker.py index ea0e7005..12f10169 100644 --- a/vllm/worker/tpu_worker.py +++ b/vllm/worker/tpu_worker.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import os from typing import List, Optional, Tuple, Union diff --git a/vllm/worker/utils.py b/vllm/worker/utils.py index ffa8c4cb..d925f088 100644 --- a/vllm/worker/utils.py +++ b/vllm/worker/utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 ''' Worker-related helper functions. ''' diff --git a/vllm/worker/worker.py b/vllm/worker/worker.py index 1d2884d3..582aa460 100644 --- a/vllm/worker/worker.py +++ b/vllm/worker/worker.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A GPU worker class.""" import gc import os diff --git a/vllm/worker/worker_base.py b/vllm/worker/worker_base.py index 6eeb4aa1..819b81fb 100644 --- a/vllm/worker/worker_base.py +++ b/vllm/worker/worker_base.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses import os import time diff --git a/vllm/worker/xpu_model_runner.py b/vllm/worker/xpu_model_runner.py index b7b7b722..9c726e1a 100644 --- a/vllm/worker/xpu_model_runner.py +++ b/vllm/worker/xpu_model_runner.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + import dataclasses import time import weakref diff --git a/vllm/worker/xpu_worker.py b/vllm/worker/xpu_worker.py index e9cb623c..047c0bbb 100644 --- a/vllm/worker/xpu_worker.py +++ b/vllm/worker/xpu_worker.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 """A XPU worker class.""" import gc import os