-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
84 lines (75 loc) · 2.88 KB
/
pyproject.toml
File metadata and controls
84 lines (75 loc) · 2.88 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
[build-system]
requires = ["setuptools>=68.0", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"
[project]
name = "trnsparse"
version = "0.6.0"
description = "Sparse matrix operations 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). trnsparse imports
# from the canonical `nki.*` namespace; the legacy `neuronxcc.nki.*`
# shim is not used. SDK 2.29 DLAMI bundles nki==0.3.0 alongside
# neuronxcc==2.24.5133. Hosts without an `nki` wheel (macOS,
# non-Linux archs) still hit HAS_NKI=False and get the torch fallback.
"nki>=0.3.0",
"neuronxcc>=2.24",
"torch-neuronx>=2.9",
]
dev = ["pytest>=7.0", "pytest-benchmark>=4.0", "pytest-cov>=4.1", "scipy>=1.11"]
[project.urls]
Homepage = "https://github.com/trnsci/trnsparse"
Documentation = "https://trnsci.dev/trnsparse/"
Repository = "https://github.com/trnsci/trnsparse"
Issues = "https://github.com/trnsci/trnsparse/issues"
[tool.setuptools.packages.find]
include = ["trnsparse*"]
[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 over ternary — readability call, not worth fighting
"SIM300", # Yoda-condition false positives on array comparisons
"E741", # ambiguous single-letter names — `I` for identity matrix is idiomatic in linear algebra
]
[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.
"trnsparse/nki/dispatch.py" = ["F841", "B007"]
"trnsparse/nki/kernels.py" = ["F841", "B007"]
"scripts/*" = ["F401"]
"tests/*" = ["F401", "F811"]
[tool.ruff.format]
# Black-compatible defaults.
quote-style = "double"
indent-style = "space"
[tool.pytest.ini_options]
markers = ["neuron: requires Neuron hardware"]
testpaths = ["tests"]