-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
107 lines (96 loc) · 3.11 KB
/
Copy pathpyproject.toml
File metadata and controls
107 lines (96 loc) · 3.11 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
[build-system]
requires = ["setuptools>=68.0", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"
[project]
name = "trnrand"
version = "0.7.0"
description = "Random number generation for AWS Trainium via NKI"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "Scott Friedman", email = "scttfrdmn@gmail.com" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = [
"torch>=2.1",
"numpy>=1.24",
]
[project.optional-dependencies]
neuron = [
# NKI 0.3.0 Stable (Neuron SDK 2.29, April 2026) promotes `nki.*` as the
# canonical namespace. Previous releases exposed `neuronxcc.nki.*` which
# is now deprecated. Ships with the Deep Learning AMI Neuron or via
# https://pip.repos.neuron.amazonaws.com.
"nki>=0.3.0",
"torch-neuronx>=2.9",
]
dev = [
"pytest>=7.0",
"pytest-benchmark>=4.0",
"pytest-cov>=4.0",
"ruff>=0.6",
"pre-commit>=3.5",
"scipy>=1.11",
"mkdocs>=1.5",
"mkdocs-material>=9.0",
]
[tool.ruff]
# Match the rest of the trnsci suite. Line length 100 is a compromise
# between black's 88 and the wider tables common in scientific code.
line-length = 100
target-version = "py310"
extend-exclude = ["site", "infra/terraform*/.terraform"]
[tool.ruff.lint]
# Sensible default selection: pycodestyle (E/W), Pyflakes (F), isort (I),
# pyupgrade (UP), flake8-bugbear (B), flake8-simplify (SIM). Skip docstring
# rules (D*) — we're deliberately light on docstrings in this project.
select = ["E", "W", "F", "I", "UP", "B", "SIM"]
ignore = [
"E501", # line too long — formatter handles it
"B008", # function call in default arg — common + intentional here
"SIM108", # if/else → ternary — explicit form reads better in dispatch paths
]
[tool.ruff.lint.per-file-ignores]
# NKI kernels use patterns that trip some lint rules (SBUF writes that
# look unused to the linter, etc). Don't fight the kernel authoring loop.
"trnrand/nki/dispatch.py" = ["F841", "B007"]
"scripts/*" = ["F401"]
"tests/*" = ["F401", "F811"]
[tool.ruff.format]
# Black-compatible defaults.
quote-style = "double"
indent-style = "space"
[tool.coverage.run]
source = ["trnrand"]
omit = [
# NKI kernels require neuronxcc and only run on Trainium; CI coverage
# would always show 0% and drag the total down.
"trnrand/nki/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[project.urls]
Homepage = "https://github.com/trnsci/trnrand"
Documentation = "https://trnsci.dev/trnrand/"
Repository = "https://github.com/trnsci/trnrand"
Issues = "https://github.com/trnsci/trnrand/issues"
[tool.setuptools.packages.find]
include = ["trnrand*"]
[tool.pytest.ini_options]
markers = [
"neuron: requires Neuron hardware (trn1/trn2 instance)",
"nki_simulator: runs NKI kernels via nki.simulate on CPU (no hardware)",
]
testpaths = ["tests"]