forked from hw-native-sys/pypto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
160 lines (147 loc) · 6.45 KB
/
Copy pathpyproject.toml
File metadata and controls
160 lines (147 loc) · 6.45 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
# Copyright (c) PyPTO Contributors.
# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
# CANN Open Software License Agreement Version 2.0 (the "License").
# Please refer to the License for details. You may not use this file except in compliance with the License.
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
# See LICENSE in the root of the software repository for the full text of the License.
# -----------------------------------------------------------------------------------------------------------
[build-system]
requires = ["scikit-build-core>=0.10.0", "nanobind>=2.0.0", "ninja>=1.11.0", "cmake>=3.15"]
build-backend = "scikit_build_core.build"
[project]
name = "pypto"
version = "0.1.0"
authors = [{ name = "PyPTO Contributors" }]
description = "A high-performance programming framework for tile-centric computing"
readme = { file = "README.md", content-type = "text/markdown" }
license = "LicenseRef-CANN-Open-Software-License-Agreement-Version-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.10"
dependencies = ["numpy>=2.0", "torch>=2.0.0"]
keywords = ["python", "pto", "tile", "tile-centric"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Topic :: Software Development :: Compilers",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
]
[project.scripts]
pypto-ir-trace = "pypto.tools.ir_trace.cli:main"
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-forked>=1.0",
"pytest-xdist==3.8.0",
"pyright==1.1.407",
"ruff==0.14.8",
"clang-tidy==21.1.0",
]
# The documentation site toolchain is NOT an extra: it lives in
# `docs/requirements.txt`, so the docs CI job installs it with a plain
# `pip install -r` instead of `pip install -e ".[docs]"`, which would trigger a
# full C++ build the site does not need.
[project.urls]
Homepage = "https://github.com/hw-native-sys/pypto"
Repository = "https://github.com/hw-native-sys/pypto"
"Bug Tracker" = "https://github.com/hw-native-sys/pypto/issues"
[tool.ruff]
line-length = 110
target-version = "py310"
required-version = "0.14.8"
[tool.ruff.lint]
select = [
"PL", # pylint, https://docs.astral.sh/ruff/rules/#pylint-pl
"I", # isort, https://docs.astral.sh/ruff/rules/#isort-i
"E", # pycodestyle errors, https://docs.astral.sh/ruff/rules/#error-e
"W", # pycodestyle warnings, https://docs.astral.sh/ruff/rules/#warning-w
"F", # pyflakes, https://docs.astral.sh/ruff/rules/#pyflakes-f
"UP", # pyupgrade, https://docs.astral.sh/ruff/rules/#pyupgrade-up
]
ignore = [
"ANN401", # flake8-annotations: any-type
"PLR2004", # pylint: magic-value-comparison
"PLR0911", # too many return statements
"PLW2901", # pylint: redefined-loop-variable (DSL reassignment pattern)
]
fixable = ["ALL"]
[tool.ruff.lint.per-file-ignores]
# DSL type annotations (pl.Tile[..., pl.TileView(...)]) exceed line-length;
# F841 suppressed where DSL assignments intentionally create IR nodes whose
# Python binding is unused but structurally required by the pass output.
"tests/ut/ir/transforms/test_expand_mixed_kernel.py" = ["E501"]
"tests/ut/ir/transforms/test_flatten_tile_nd_to_2d.py" = ["F841"]
"tests/ut/ir/transforms/test_init_memref.py" = ["E501"]
"tests/ut/ir/transforms/test_memory_reuse.py" = ["E501"]
"tests/ut/ir/transforms/test_infer_tile_memory_space.py" = ["E501"]
"tests/ut/ir/transforms/test_interchange_chunk_loops.py" = ["E501", "F841"]
"tests/ut/ir/transforms/test_optimize_orch_tensors.py" = ["F841"]
"tests/ut/ir/transforms/test_outline_incore_interleaved_ops.py" = ["E501"]
"tests/ut/ir/transforms/test_outline_incore_scopes.py" = ["F841"]
"tests/ut/ir/transforms/test_outline_cluster_scopes.py" = ["F841"]
"tests/ut/ir/transforms/test_legalize_pto_buffer_reuse.py" = ["E501", "F841"]
"tests/ut/ir/transforms/test_ctrl_flow_transform.py" = ["F841"]
"tests/ut/ir/transforms/test_split_vector_kernel.py" = ["F841"]
# `with pl.spmd(...) as tid:` / `with pl.at(...) as tid:` capture targets are
# intentionally unused Python bindings — the capture records an IR scope attr.
"tests/ut/language/parser/test_scope_parsing.py" = ["F841"]
"tests/ut/codegen/test_spmd_scope_tid_codegen.py" = ["F841"]
# Embedded DSL repro deliberately collapses `with pl.at(...)` onto one line to
# mimic @pl.jit's ast.unparse output — load-bearing, cannot be wrapped.
"tests/ut/language/parser/test_text_parser.py" = ["E501"]
# IR dumps are formatted at 200-col for readability — suppress line-length lint
"build_output/**" = ["E501"]
# Embeds a verbatim pass dump as a fixture; tile annotations carry their MemRef
# inline and cannot be wrapped without changing what is under test.
"tests/ut/tools/test_memory_map.py" = ["E501"]
[tool.ruff.lint.pylint]
max-statements = 100
max-args = 10
max-branches = 15
[tool.ruff.format]
quote-style = "double"
skip-magic-trailing-comma = false
line-ending = "lf"
[tool.scikit-build]
# Specify where to find the Python package
wheel.packages = ["python/pypto"]
# Install the package data files (*.pyi, py.typed)
wheel.install-dir = "pypto"
# Set minimum CMake version (cmake.minimum-version was removed in scikit-build-core 1.0)
cmake.version = ">=3.15"
# Build type
cmake.build-type = "RelWithDebInfo"
# Build directory, better for incremental build
build-dir = "build"
# extra cmake arguments
cmake.args = [
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
]
[tool.pyright]
include = ["python/pypto", "tests"]
exclude = ["**/__pycache__", "build", "dist", "tests/st", "tests/ut/jit/test_roundtrip.py"]
extraPaths = ["python", "."]
typeCheckingMode = "basic"
pythonVersion = "3.10"
reportMissingTypeStubs = false
reportMissingModuleSource = false
reportCallIssue = false
# for dsl parser
reportAssignmentType = false
reportOperatorIssue = false
reportRedeclaration = false
reportOptionalIterable = false
reportOptionalSubscript = false
reportGeneralTypeIssues = false
[tool.pylint]
# Pylint is not used in this project, but as it is a widely used linter,
# we provide basic configuration for a consistent developer experience.
max-line-length = 110
disable = ["missing-docstring"]