-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
112 lines (102 loc) · 3.34 KB
/
pyproject.toml
File metadata and controls
112 lines (102 loc) · 3.34 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
[project]
name = "plena-simulator"
version = "1.0.0"
description = "PLENA Simulator for LLM inference"
requires-python = ">=3.12"
dependencies = [
"torch==2.7.1+cu126",
"numpy",
"bitstring",
"colorlog",
"toml",
"tqdm",
"kernels",
"pytest",
"transformers",
"matplotlib",
"ruff>=0.12",
"pydantic>=2.0",
]
# Use PyTorch CUDA index only for torch packages
[[tool.uv.index]]
name = "pytorch-cu126"
url = "https://download.pytorch.org/whl/cu126"
explicit = true # Only use this index when explicitly specified
[tool.uv.sources]
torch = { index = "pytorch-cu126" }
# =============================================================================
# Ruff Configuration
# =============================================================================
[tool.ruff]
indent-width = 4
line-length = 120
target-version = "py312"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"N", # pep8-naming
"NPY", # numpy
"RUF", # ruff-specific
]
ignore = [
"E501", # line too long (handled by formatter, not linter)
"I001", # import block unsorted (too many false positives with sys.path manipulation)
# --- ML/math naming conventions (intentional) ---
"N803", # argument name: we use M, N, K, H, W, B, K_col, etc.
"N806", # variable in function: same math notation
"N801", # class name: legacy Random_MXFP_Tensor_Generator-style names
"N802", # function name: some intentional snake_camel mixes
"N812", # lowercase imported as non-lowercase: common in ML (import torch.nn.functional as F)
"N816", # mixed-case globals: fp_preload style pre-loaded config
"E741", # ambiguous single-letter: l, O, I are valid math variables
# --- Unicode in comments/docstrings (translation in progress) ---
"RUF001", # ambiguous-unicode-character-string
"RUF002", # ambiguous-unicode-character-docstring
"RUF003", # ambiguous-unicode-character-comment
]
[tool.ruff.lint.isort]
known-first-party = ["plena_simulator"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# =============================================================================
# Packaging
# =============================================================================
# Expose tools/ subpackages at the top level (quant, utils, memory_mapping, …)
# so `from quant.quantizer... import ...` works from any cwd after `pip install -e .`.
# compiler/* and transactional_emulator/* are namespace packages, discovered by
# setuptools automatically once they're under the project root on sys.path.
[tool.setuptools]
include-package-data = false
[tool.setuptools.packages.find]
where = ["tools", "."]
include = [
"quant*",
"utils*",
"memory_mapping*",
"compiler*",
"transactional_emulator*",
]
exclude = [
"*tests*",
"*build*",
"*__pycache__*",
"*.omc*",
]
[tool.setuptools.package-dir]
"" = "."
quant = "tools/quant"
utils = "tools/utils"
memory_mapping = "tools/memory_mapping"
# =============================================================================
# Build System
# =============================================================================
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"