forked from flashinfer-ai/flashinfer
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpyproject.toml
More file actions
247 lines (228 loc) · 6.47 KB
/
pyproject.toml
File metadata and controls
247 lines (228 loc) · 6.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# SPDX - FileCopyrightText : 2024 Flashinfer team.
# SPDX - FileCopyrightText : 2025 Advanced Micro Devices, Inc.
# SPDX - License - Identifier : Apache 2.0
[project]
name = "amd-flashinfer"
dynamic = ["version"]
description = "Fast Attention Algorithms for LLM Inference on ROCm"
requires-python = ">=3.10"
readme = "README.md"
license = "Apache-2.0"
authors = [
{name = "AMD, Inc."}
]
# Runtime dependencies
# NOTE: torch is intentionally NOT listed here because ROCm users must install
# torch from AMD's ROCm repository, not from PyPI. For example,
# pip install torch==2.7.1 --index-url https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4/
# See README.md for complete installation instructions.
dependencies = [
"ninja",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: C++",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: POSIX :: Linux",
]
[project.urls]
Homepage = "https://github.com/rocm/flashinfer"
Repository = "https://github.com/rocm/flashinfer"
Documentation = "https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/3rd-party/flashinfer-install.html"
"Bug Tracker" = "https://github.com/rocm/flashinfer/issues"
[project.optional-dependencies]
dev = [
"pytest",
"pytest-xdist",
"pytest-rerunfailures",
]
[build-system]
requires = [
"scikit-build-core>=0.4.3",
"torch >= 2.7",
"numpy",
"setuptools-scm >=9.2"
]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
cmake.build-type = "Release"
editable.rebuild = true
build.verbose = true
logging.level = "INFO"
build-dir = "_skbuild"
experimental = true
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
wheel.license-files = ["LICENSE"]
wheel.packages = ["flashinfer"]
wheel.py-api = "py3"
[tool.scikit-build.sdist]
cmake = false
exclude = [
".clang-format",
".devcontainer",
".github",
".gitignore",
".gitmodules",
".pre-commit-config.yaml",
"examples",
"profiler",
"benchmarks",
"docker",
"scripts",
"tests",
"docs",
"3rdparty/spdlog/**/*",
"3rdparty/cutlass/**/*",
"ci",
"Jenkinsfile",
"format.sh",
"custom_backend.py",
"version.txt",
"CHANGELOG.md",
]
include = [
"flashinfer/_version.py"
]
[tool.setuptools_scm]
write_to = "flashinfer/_version.py"
tag_regex = "^v?(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+(?:\\.post[0-9]+|(?:a|b|rc)[0-9]+|\\.dev[0-9]+)?)(?:[+](?P<local>[a-zA-Z0-9.]+))?$"
version_scheme = "no-guess-dev"
local_scheme = "dirty-tag"
scm.git.describe_command = ["python", "scripts/git_describe_rocm.py"]
fallback_version = "0.0.0"
[tool.codespell]
ignore-words-list = "3nd"
skip = [
"build",
"3rdparty",
"dist",
".venv"
]
[tool.mypy]
ignore_missing_imports = false
show_column_numbers = true
show_error_context = true
follow_imports = "skip"
ignore_errors = false
strict_optional = false
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
# "UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
# "I",
]
ignore = [
# Module level import not at top of file
"E402",
# star imports
"F405", "F403",
# ambiguous name
"E741",
# line too long
"E501",
# key in dict.keys()
"SIM118",
# memory leaks
"B019",
# No such file or directory
"E902",
# nested `if` statements
"SIM102",
# `if`-`else`-block
"SIM108",
# assign `lambda` expressions
"E731",
# Loop control variable overrides iterable it iterates
"B020",
# Return te negated condition directly
"SIM103",
# Function definition does not bind loop variable
"B023",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.pytest.ini_options]
# Ignore deprecation warnings
filterwarnings = [
"ignore::DeprecationWarning",
]
# Quiet output: dots while running, failures and errors in summary; importlib mode
# avoids __init__.py package-root walk.
addopts = "-q -rfE --tb=short --import-mode=importlib"
norecursedirs = ["test_helpers"]
pythonpath = ["tests", "tests/test_helpers"]
# AMD/HIP test suite: rocm_tests/ directory for all AMD-authored tests,
# plus explicit upstream test paths that are verified HIP-compatible.
# Running 'pytest' with no args runs exactly these tests.
testpaths = [
"tests/rocm_tests",
"tests/attention/test_decode_prefill_lse.py",
"tests/attention/test_non_contiguous_decode.py",
"tests/attention/test_non_contiguous_prefill.py",
"tests/attention/test_page.py",
"tests/utils/test_activation.py",
"tests/utils/test_block_sparse_indices_to_vector_sparse_offsets.py",
"tests/utils/test_quantization.py",
]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: heavy ROCm tests (1M-trial sampling frequency, 4GB-tensor speculative-sampling) — exclude with '-m \"not slow\"' for fast iteration; nightly runs include them.",
]
[tool.coverage.run]
# Note: 'source' is commented out because 'include' would be ignored if source is set
# source = ["flashinfer"]
branch = true
# AMD/HIP modified files - auto-updated by GitHub Action - DO NOT EDIT THIS SECTION MANUALLY
include = [
"flashinfer/__init__.py",
"flashinfer/activation.py",
"flashinfer/aiter_utils.py",
"flashinfer/aot_hip.py",
"flashinfer/cascade.py",
"flashinfer/comm/__init__.py",
"flashinfer/compilation_context_hip.py",
"flashinfer/decode_rocm.py",
"flashinfer/device_utils.py",
"flashinfer/fused_moe/core.py",
"flashinfer/get_include_paths.py",
"flashinfer/hip_utils.py",
"flashinfer/jit/__init__.py",
"flashinfer/jit/activation.py",
"flashinfer/jit/attention/__init__.py",
"flashinfer/jit/attention/modules_hip.py",
"flashinfer/jit/core.py",
"flashinfer/jit/cpp_ext_hip.py",
"flashinfer/jit/env.py",
"flashinfer/jit/utils.py",
"flashinfer/logits_processor/__init__.py",
"flashinfer/mla_rocm.py",
"flashinfer/norm.py",
"flashinfer/page.py",
"flashinfer/pod.py",
"flashinfer/prefill_rocm.py",
"flashinfer/quantization.py",
"flashinfer/rope.py",
"flashinfer/sampling.py",
"flashinfer/utils.py",
]
[tool.coverage.report]
show_missing = true
skip_empty = true
precision = 2
[tool.coverage.html]
directory = "htmlcov"