-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathpyproject.toml
More file actions
173 lines (154 loc) · 4.87 KB
/
Copy pathpyproject.toml
File metadata and controls
173 lines (154 loc) · 4.87 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
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "tilus"
description = "Tilus"
dynamic = ["version"]
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
license = "Apache-2.0"
keywords = ["GPU", "Compiler", "CUDA", "hidet", "tensor", "torch"]
authors = [
{ name = "Tilus Team" }
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 3",
]
dependencies = [
"apache-tvm-ffi",
"filelock",
"numpy",
"torch",
"tabulate",
"tqdm",
]
[project.optional-dependencies]
dev = [
"ruff==0.11.0",
"mypy==1.15.0",
"pytest",
"pre-commit",
"types-tabulate",
"types-tqdm",
"pandas",
"nvidia-ml-py", # for locking GPU clocks
# for examples
"einops",
# for documentation
"jinja2",
"sphinx==8.1.3",
"sphinx-autobuild==2024.10.3",
"sphinx-copybutton==0.5.2",
"autodocsumm==0.2.14",
"sphinx-book-theme==1.1.4",
"matplotlib",
]
[project.urls]
Homepage = "https://github.com/NVIDIA/tilus"
Documentation = "https://nvidia.github.io/tilus"
[tool.setuptools_scm]
[tool.setuptools.package-dir]
"" = "python"
[tool.setuptools.package-data]
"tilus" = ["py.typed"]
"tilus.hidet" = ["include/**/*.h"]
[tool.ruff]
line-length = 120
[tool.ruff.lint]
extend-select = [
"D", # enforce docstring conventions
"I", # isort rules that unify the import order
]
ignore = [
"E741", # ambiguous variable name
"D106", # missing docstring in nested class
"D105", # missing docstring in magic method
"D104", # missing docstring in public package
"D103", # missing docstring in public function
"D102", # missing docstring in public method
"D101", # missing docstring in public class
"D100", # missing docstring in public module
"D401", # first line should be in imperative mood
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401" # checks for unused imports.
]
"examples/**/*.py" = [
"D400",
"D205", # 1 blank line required between summary line and description
]
"python/tilus/hidet/**/*.py" = [
"D", # skip docstring checks for integrated hidet code
"E402", # module level imports not at top (hidet uses @initialize pattern)
"F401", # unused imports (guarded imports for optional modules)
"F402", # shadowed loop variables in hidet code
"F841", # unused local variables in hidet code
"F821", # undefined names (guarded imports for compute/cute)
]
[tool.mypy]
check_untyped_defs = true
disallow_incomplete_defs = true
allow_redefinition = true
strict_optional = false
explicit_package_bases = true
mypy_path = "python"
namespace_packages = true
disable_error_code = [
"import-untyped", # we used some untyped third-party libraries
]
[[tool.mypy.overrides]]
module = ["tilus.*"]
disable_error_code = [
# we disable this error code because we heavily used a pattern like
# class EmitterBase:
# def emit(self, inst: Instruction):
# ...
# class PrintEmitter(EmitterBase):
# def emit(self, inst: PrintInst): # type: ignore[override]
# ...
"override",
# we might use dynamic type narrowing, but mypy cannot infer it
# thus we disable the checking for valid-type and arg-type.
# we rely on pyright in vscode to catch these errors.
"arg-type",
]
[[tool.mypy.overrides]] # disable type checking in these modules that might define tilus scripts
module = [
"examples.*",
"tests.*",
"tilus.lang.classes.pipeline"
]
disable_error_code = ["override", "valid-type", "call-arg", "no-untyped-def", "has-type", "no-redef", "assignment", "import-not-found"]
[[tool.mypy.overrides]]
module = ["tilus.hidet.*"]
ignore_errors = true
[[tool.mypy.overrides]]
module = ["cuda.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"tilus.ir.builders.func_builder", # todo: update the defintion of threadIx etc to enable this checking
"tilus.backends.emitters.cast", # todo: update the FloatType to add mantissa_nbits and exponent_nbits
"tilus.backends.codegen",
"tilus.backends.emitters.shuffle",
"tilus.backends.emitters.cuda.cp_async",
"tilus.transforms.bound_aware_simplify",
]
disable_error_code = ["attr-defined", "call-arg"]
[tool.pyright]
typeCheckingMode = "basic"
reportInvalidTypeForm = "none" # we allow complex type annotations in Tilus Script
reportIncompatibleMethodOverride = "none"