Skip to content

Commit 8c23387

Browse files
authored
feat: update aphrodite to 0.20.0 (#1628)
* feat: update aphrodite to 0.20.0 * fix: stale package reference * fix: flash attn * fix: aphrodite_flash_attn path * fix: rejection sampler * fix: gitignore triton_kernels and fix flash_attn src copy again * chore: some logging cleanup * chore: a couple more logger fixes * chore: remove redundant progress bar for dynamo * chore: some centering relative to logo * fix: silence deprecation warnings in transformers processor * Revert "fix: silence deprecation warnings in transformers processor" This reverts commit 7886110. * fix: demote log to debug for compilation time messages * fix: coerce dry strings * fix: dry not being applied * feat: kobold api * fix: copyright headers * fix: a bunch of sampler issues * refactor: remove sampler priority * feat: temperature_last * chore: docker stuff * fix: some related tooling around docker * fix: remove stale aphrodite_kernels * fix: no precompile step in docker * fix: remove wheel size check from Dockerfile and export_wheels.sh * fix: update export_wheels.sh script to remove caching comments and clarify usage * feat: exllamav3 dense-only support * feat: exl3 MoE support * chore: move SiluAndMul activation to SharedExperts outside of afmoe * feat: Qwen3.5 support for exl3 * fix: don't compile CUTLASS W8A8 in the _C extension * refactor: remove unused permute_cols function and its registration * feat: add v1/tokenize and v1/detokenize endpoints * feat: add /api/latest alias for Kobold API * chore: make pre-commit pass * fix: more pre-commit stuff Signed-off-by: AlpinDale <alpindale@gmail.com> * refactor: improve shellcheck script structure and readability Signed-off-by: AlpinDale <alpindale@gmail.com> * refactor: remove update-dockerfile-graph hook from pre-commit configuration Signed-off-by: AlpinDale <alpindale@gmail.com> --------- Signed-off-by: AlpinDale <alpindale@gmail.com>
1 parent 1eab18a commit 8c23387

4,598 files changed

Lines changed: 494507 additions & 323393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildkite/check-wheel-size.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: Copyright contributors to the Aphrodite project
3+
4+
import os
5+
import sys
6+
import zipfile
7+
8+
# Read the APHRODITE_MAX_SIZE_MB environment variable, defaulting to 500 MiB
9+
# Note that we have 800 MiB quota, please use it wisely.
10+
# See https://github.com/pypi/support/issues/6326 .
11+
# Please also sync the value with the one in Dockerfile.
12+
APHRODITE_MAX_SIZE_MB = int(os.environ.get("APHRODITE_MAX_SIZE_MB", 500))
13+
14+
15+
def print_top_10_largest_files(zip_file):
16+
"""Print the top 10 largest files in the given zip file."""
17+
with zipfile.ZipFile(zip_file, "r") as z:
18+
file_sizes = [(f, z.getinfo(f).file_size) for f in z.namelist()]
19+
file_sizes.sort(key=lambda x: x[1], reverse=True)
20+
for f, size in file_sizes[:10]:
21+
print(f"{f}: {size / (1024 * 1024):.2f} MBs uncompressed.")
22+
23+
24+
def check_wheel_size(directory):
25+
"""Check the size of .whl files in the given directory."""
26+
for root, _, files in os.walk(directory):
27+
for file_name in files:
28+
if file_name.endswith(".whl"):
29+
wheel_path = os.path.join(root, file_name)
30+
wheel_size_mb = os.path.getsize(wheel_path) / (1024 * 1024)
31+
if wheel_size_mb > APHRODITE_MAX_SIZE_MB:
32+
print(
33+
f"Not allowed: Wheel {wheel_path} is larger "
34+
f"({wheel_size_mb:.2f} MB) than the limit "
35+
f"({APHRODITE_MAX_SIZE_MB} MB)."
36+
)
37+
print_top_10_largest_files(wheel_path)
38+
return 1
39+
else:
40+
print(f"Wheel {wheel_path} is within the allowed size ({wheel_size_mb:.2f} MB).")
41+
return 0
42+
43+
44+
if __name__ == "__main__":
45+
if len(sys.argv) < 2:
46+
print("Usage: python check-wheel-size.py <directory>")
47+
sys.exit(1)
48+
49+
directory = sys.argv[1]
50+
sys.exit(check_wheel_size(directory))

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,11 @@ shellcheck-stable/
215215
ep_kernels_workspace/
216216
CMakeUserPresets.json
217217
cmake-build*/
218-
aphrodite/aphrodite_flash_attn/*
218+
aphrodite/vllm_flash_attn/*
219+
!aphrodite/vllm_flash_attn/__init__.py
220+
!aphrodite/vllm_flash_attn/flash_attn_interface.py
221+
222+
aphrodite/third_party/triton_kernels/*
223+
aphrodite/third_party/deep_gemm/
224+
225+
.triton

.markdownlint.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
MD007:
2+
indent: 4
3+
MD013: false
4+
MD024:
5+
siblings_only: true
6+
MD031:
7+
list_items: false
8+
MD033: false
9+
MD040: false
10+
MD046: false
11+
MD052: false
12+
MD059: false
13+
MD001: false
14+
MD025: false
15+
MD041: false
16+
MD045: false
17+
MD060: false

.pre-commit-config.yaml

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ default_install_hook_types:
44
default_stages:
55
- pre-commit # Run locally
66
- manual # Run in CI
7-
exclude: 'aphrodite/third_party/.*'
7+
exclude: '^(reference/|shellcheck-stable/|aphrodite/third_party/.*)'
88
repos:
99
- repo: https://github.com/astral-sh/ruff-pre-commit
1010
rev: v0.14.0
@@ -13,7 +13,7 @@ repos:
1313
args: [--output-format, github, --fix]
1414
- id: ruff-format
1515
- repo: https://github.com/crate-ci/typos
16-
rev: v1.38.1
16+
rev: v1.43.5
1717
hooks:
1818
- id: typos
1919
exclude: 'kernels/xqa/cubin/.*'
@@ -25,18 +25,68 @@ repos:
2525
exclude: 'kernels/(moe/topk_softmax_kernels.cu|quantization/gguf/(ggml-common.h|dequantize.cuh|vecdotq.cuh|mmq.cuh|mmvq.cuh)|flash_mla|hadamard|backup|vmm|xqa)|aphrodite/third_party/.*'
2626
types_or: [c++, cuda]
2727
args: [--style=file, --verbose]
28+
- repo: https://github.com/DavidAnson/markdownlint-cli2
29+
rev: v0.21.0
30+
hooks:
31+
- id: markdownlint-cli2
32+
language_version: lts
33+
args: [--fix]
34+
exclude: ^CLAUDE\.md$
2835
- repo: https://github.com/rhysd/actionlint
2936
rev: v1.7.7
3037
hooks:
3138
- id: actionlint
3239
- repo: https://github.com/astral-sh/uv-pre-commit
33-
rev: 0.9.1
40+
rev: 0.11.1
3441
hooks:
3542
- id: pip-compile
36-
args: [requirements/test.in, -o, requirements/test.txt, --index-strategy, unsafe-best-match, --torch-backend, cu129, --python-platform, x86_64-manylinux_2_28]
37-
files: ^requirements/test\.(in|txt)$
43+
args: [
44+
requirements/test.in,
45+
-c, requirements/cuda.txt,
46+
-o, requirements/test.txt,
47+
--index-strategy, unsafe-best-match,
48+
--torch-backend, cu129,
49+
--python-platform, x86_64-manylinux_2_28,
50+
--python-version, "3.12",
51+
]
52+
files: ^requirements/(common|cuda|test)\.(in|txt)$
3853
- repo: local
3954
hooks:
55+
- id: mypy-local
56+
name: Run mypy locally for lowest supported Python version
57+
entry: python tools/pre_commit/mypy.py 0 "3.10"
58+
stages: [pre-commit] # Don't run in CI
59+
<<: &mypy_common
60+
language: python
61+
types_or: [python, pyi]
62+
require_serial: true
63+
additional_dependencies: ["mypy[faster-cache]==1.19.1", regex, types-cachetools, types-setuptools, types-PyYAML, types-requests, types-torch, pydantic]
64+
- id: mypy-3.10
65+
name: Run mypy for Python 3.10
66+
entry: python tools/pre_commit/mypy.py 1 "3.10"
67+
<<: *mypy_common
68+
stages: [manual]
69+
- id: mypy-3.11
70+
name: Run mypy for Python 3.11
71+
entry: python tools/pre_commit/mypy.py 1 "3.11"
72+
<<: *mypy_common
73+
stages: [manual]
74+
- id: mypy-3.12
75+
name: Run mypy for Python 3.12
76+
entry: python tools/pre_commit/mypy.py 1 "3.12"
77+
<<: *mypy_common
78+
stages: [manual]
79+
- id: mypy-3.13
80+
name: Run mypy for Python 3.13
81+
entry: python tools/pre_commit/mypy.py 1 "3.13"
82+
<<: *mypy_common
83+
stages: [manual]
84+
- id: shellcheck
85+
name: Lint shell scripts
86+
entry: tools/pre_commit/shellcheck.sh
87+
language: script
88+
types: [shell]
89+
files: ^tools/pre_commit/.*\.sh$
4090
- id: png-lint
4191
name: Lint PNG exports from excalidraw
4292
entry: tools/pre_commit/png-lint.sh
@@ -54,6 +104,12 @@ repos:
54104
language: system
55105
verbose: true
56106
stages: [commit-msg]
107+
- id: check-spdx-header
108+
name: Check SPDX headers
109+
entry: python tools/pre_commit/check_spdx_header.py
110+
language: python
111+
types: [python]
112+
exclude: ^(reference/|aphrodite/vllm_flash_attn/|aphrodite/third_party/|tests/|examples/|benchmarks/)
57113
- id: check-root-lazy-imports
58114
name: Check root lazy imports
59115
entry: python tools/pre_commit/check_init_lazy_imports.py
@@ -75,7 +131,6 @@ repos:
75131
types: [python]
76132
pass_filenames: false
77133
additional_dependencies: [regex]
78-
# forbid directly import triton
79134
- id: forbid-direct-triton-import
80135
name: "Forbid direct 'import triton'"
81136
entry: python tools/pre_commit/check_triton_import.py
@@ -90,11 +145,29 @@ repos:
90145
types: [python]
91146
additional_dependencies: [regex]
92147
exclude: ^benchmarks/
148+
- id: check-torch-cuda-call
149+
name: "Prevent new 'torch.cuda' APIs call"
150+
entry: python tools/pre_commit/check_torch_cuda.py
151+
language: python
152+
types: [python]
153+
additional_dependencies: [regex]
93154
- id: validate-config
94155
name: Validate configuration has default values and that each field has a docstring
95156
entry: python tools/pre_commit/validate_config.py
96157
language: python
97158
additional_dependencies: [regex]
159+
- id: validate-docker-versions
160+
name: Validate docker/versions.json matches Dockerfile
161+
entry: python tools/generate_versions_json.py --check
162+
language: python
163+
files: ^docker/(Dockerfile|versions\.json)$
164+
pass_filenames: false
165+
additional_dependencies: [dockerfile-parse]
166+
- id: check-boolean-context-manager
167+
name: Check for boolean ops in with-statements
168+
entry: python tools/pre_commit/check_boolean_context_manager.py
169+
language: python
170+
types: [python]
98171
# Keep `suggestion` last
99172
- id: suggestion
100173
name: Suggestion

0 commit comments

Comments
 (0)