trnsolver 0.3.0__tar.gz → 0.17.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trnsolver-0.17.0/.github/workflows/ci.yml +109 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/workflows/publish.yml +4 -1
- {trnsolver-0.3.0 → trnsolver-0.17.0}/.gitignore +3 -0
- trnsolver-0.17.0/.pre-commit-config.yaml +31 -0
- trnsolver-0.17.0/CHANGELOG.md +669 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/CLAUDE.md +14 -1
- {trnsolver-0.3.0 → trnsolver-0.17.0}/CONTRIBUTING.md +34 -5
- trnsolver-0.17.0/PKG-INFO +245 -0
- trnsolver-0.17.0/README.md +209 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/benchmarks/bench_cuda.py +2 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/benchmarks/bench_solver.py +19 -1
- trnsolver-0.17.0/docs/api/eigen.md +34 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/api/iterative.md +11 -0
- trnsolver-0.17.0/docs/api/nki.md +59 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/architecture.md +18 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/benchmarks.md +17 -4
- trnsolver-0.17.0/docs/developing_kernels.md +71 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/index.md +4 -3
- trnsolver-0.17.0/docs/installation.md +103 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/quickstart.md +9 -9
- {trnsolver-0.3.0 → trnsolver-0.17.0}/examples/scf_eigen.py +8 -6
- {trnsolver-0.3.0 → trnsolver-0.17.0}/infra/terraform/main.tf +5 -1
- {trnsolver-0.3.0 → trnsolver-0.17.0}/mkdocs.yml +2 -0
- trnsolver-0.17.0/pyproject.toml +106 -0
- trnsolver-0.17.0/scripts/bench_jacobi.py +167 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/scripts/run_neuron_tests.sh +55 -22
- trnsolver-0.17.0/scripts/run_simulator_tests.sh +142 -0
- trnsolver-0.17.0/scripts/stop_neuron_ci.sh +40 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/tests/conftest.py +13 -0
- trnsolver-0.17.0/tests/test_compile.py +265 -0
- trnsolver-0.17.0/tests/test_dtype.py +195 -0
- trnsolver-0.17.0/tests/test_eigen.py +171 -0
- trnsolver-0.17.0/tests/test_eigh_cutover.py +130 -0
- trnsolver-0.17.0/tests/test_eigh_neuron.py +158 -0
- trnsolver-0.17.0/tests/test_factor.py +272 -0
- trnsolver-0.17.0/tests/test_iterative.py +311 -0
- trnsolver-0.17.0/tests/test_jacobi.py +453 -0
- trnsolver-0.17.0/tests/test_native_dispatch.py +461 -0
- trnsolver-0.17.0/tests/test_nki_compile.py +75 -0
- trnsolver-0.17.0/tests/test_nki_native.py +169 -0
- trnsolver-0.17.0/tests/test_nki_sim.py +323 -0
- trnsolver-0.17.0/trnsolver/__init__.py +70 -0
- trnsolver-0.17.0/trnsolver/_jacobi.py +231 -0
- trnsolver-0.17.0/trnsolver/eigen.py +866 -0
- trnsolver-0.17.0/trnsolver/factor.py +692 -0
- trnsolver-0.17.0/trnsolver/iterative.py +429 -0
- trnsolver-0.17.0/trnsolver/nki/__init__.py +19 -0
- trnsolver-0.17.0/trnsolver/nki/_native.py +100 -0
- trnsolver-0.17.0/trnsolver/nki/dispatch.py +639 -0
- trnsolver-0.17.0/trnsolver/nki/jacobi.py +550 -0
- trnsolver-0.17.0/trnsolver.egg-info/PKG-INFO +245 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/trnsolver.egg-info/SOURCES.txt +19 -1
- {trnsolver-0.3.0 → trnsolver-0.17.0}/trnsolver.egg-info/requires.txt +9 -1
- trnsolver-0.17.0/uv.lock +1100 -0
- trnsolver-0.3.0/.github/workflows/ci.yml +0 -20
- trnsolver-0.3.0/CHANGELOG.md +0 -87
- trnsolver-0.3.0/PKG-INFO +0 -127
- trnsolver-0.3.0/README.md +0 -98
- trnsolver-0.3.0/docs/api/eigen.md +0 -30
- trnsolver-0.3.0/docs/api/nki.md +0 -36
- trnsolver-0.3.0/docs/installation.md +0 -41
- trnsolver-0.3.0/pyproject.toml +0 -54
- trnsolver-0.3.0/tests/test_eigen.py +0 -72
- trnsolver-0.3.0/tests/test_factor.py +0 -140
- trnsolver-0.3.0/tests/test_iterative.py +0 -87
- trnsolver-0.3.0/trnsolver/__init__.py +0 -33
- trnsolver-0.3.0/trnsolver/eigen.py +0 -170
- trnsolver-0.3.0/trnsolver/factor.py +0 -157
- trnsolver-0.3.0/trnsolver/iterative.py +0 -179
- trnsolver-0.3.0/trnsolver/nki/__init__.py +0 -5
- trnsolver-0.3.0/trnsolver/nki/dispatch.py +0 -91
- trnsolver-0.3.0/trnsolver.egg-info/PKG-INFO +0 -127
- {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/pull_request_template.md +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/workflows/neuron.yml +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/workflows/notify-umbrella.yml +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/CODE_OF_CONDUCT.md +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/LICENSE +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/benchmarks/conftest.py +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/api/factor.md +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/aws_setup.md +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/infra/terraform/README.md +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/infra/terraform/gpu.tf +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/scripts/run_cuda_tests.sh +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/setup.cfg +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/trnsolver.egg-info/dependency_links.txt +0 -0
- {trnsolver-0.3.0 → trnsolver-0.17.0}/trnsolver.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
lint:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
|
+
- uses: actions/setup-python@v6
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.12"
|
|
16
|
+
- uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
- run: uv pip install --system "ruff>=0.6"
|
|
20
|
+
- run: ruff check .
|
|
21
|
+
- run: ruff format --check .
|
|
22
|
+
|
|
23
|
+
test:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
strategy:
|
|
26
|
+
matrix:
|
|
27
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v6
|
|
30
|
+
- uses: actions/setup-python@v6
|
|
31
|
+
with:
|
|
32
|
+
python-version: ${{ matrix.python-version }}
|
|
33
|
+
- uses: astral-sh/setup-uv@v5
|
|
34
|
+
with:
|
|
35
|
+
enable-cache: true
|
|
36
|
+
- run: uv pip install --system -e ".[dev]"
|
|
37
|
+
- run: pytest tests/ -v -x --tb=short -m "not neuron and not nki_simulator" --cov=trnsolver --cov-report=xml
|
|
38
|
+
- name: Upload coverage reports to Codecov
|
|
39
|
+
uses: codecov/codecov-action@v5
|
|
40
|
+
with:
|
|
41
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
42
|
+
slug: trnsci/trnsolver
|
|
43
|
+
|
|
44
|
+
# Runs NKI kernels through nki.simulate(kernel)(numpy_args) on CPU.
|
|
45
|
+
# Catches Python-trace-level errors (bad kwargs, dropped ops, shape
|
|
46
|
+
# mismatches) pre-merge without AWS round-trips. MLIR verifier errors
|
|
47
|
+
# remain hardware-only (simulator explicitly skips compile). NKI 0.3.0
|
|
48
|
+
# Stable is the canonical namespace — package is `nki`, not `neuronxcc.nki`.
|
|
49
|
+
nki-simulator:
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v6
|
|
53
|
+
- uses: actions/setup-python@v6
|
|
54
|
+
with:
|
|
55
|
+
python-version: "3.12"
|
|
56
|
+
- uses: astral-sh/setup-uv@v5
|
|
57
|
+
with:
|
|
58
|
+
enable-cache: true
|
|
59
|
+
- name: Install trnsolver + NKI simulator deps
|
|
60
|
+
# --index-strategy unsafe-best-match: uv normally locks a package to
|
|
61
|
+
# the first index it's found on; nki's transitive deps (e.g. islpy)
|
|
62
|
+
# exist on both the Neuron repo and PyPI. Match pip's multi-index
|
|
63
|
+
# behavior so resolution picks the newest available wheel per package.
|
|
64
|
+
run: |
|
|
65
|
+
uv pip install --system -e ".[dev]"
|
|
66
|
+
uv pip install --system --index-strategy unsafe-best-match "nki>=0.3.0" --extra-index-url https://pip.repos.neuron.amazonaws.com
|
|
67
|
+
- name: Run simulator-backed kernel tests
|
|
68
|
+
env:
|
|
69
|
+
TRNSOLVER_USE_SIMULATOR: "1"
|
|
70
|
+
run: pytest tests/ -v -m nki_simulator --tb=short --cov=trnsolver --cov-report=xml --cov-append
|
|
71
|
+
- name: Upload coverage reports to Codecov
|
|
72
|
+
uses: codecov/codecov-action@v5
|
|
73
|
+
with:
|
|
74
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
75
|
+
slug: trnsci/trnsolver
|
|
76
|
+
flags: simulator
|
|
77
|
+
|
|
78
|
+
# pytest-benchmark bit-rot gate. Runs the benchmark suite with minimum
|
|
79
|
+
# rounds on ubuntu-latest to catch import / fixture / API drift before
|
|
80
|
+
# it hits the real perf measurement path. No perf gate — just execution.
|
|
81
|
+
# Real perf numbers come from the hardware (`run_neuron_tests.sh`) and
|
|
82
|
+
# g5 (`run_cuda_tests.sh`) runners.
|
|
83
|
+
bench-smoke:
|
|
84
|
+
runs-on: ubuntu-latest
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v6
|
|
87
|
+
- uses: actions/setup-python@v6
|
|
88
|
+
with:
|
|
89
|
+
python-version: "3.12"
|
|
90
|
+
- uses: astral-sh/setup-uv@v5
|
|
91
|
+
with:
|
|
92
|
+
enable-cache: true
|
|
93
|
+
- run: uv pip install --system -e ".[dev]"
|
|
94
|
+
- name: Run benchmark smoke (exclude neuron + cuda)
|
|
95
|
+
# --override-ini: bench_*.py is outside the test_*.py default pattern;
|
|
96
|
+
# override rather than pollute the pyproject test config.
|
|
97
|
+
run: |
|
|
98
|
+
pytest benchmarks/ -v --benchmark-only -m "not neuron and not cuda" \
|
|
99
|
+
--override-ini 'python_files=bench_*.py' \
|
|
100
|
+
--benchmark-min-rounds=2 \
|
|
101
|
+
--benchmark-json=bench.json \
|
|
102
|
+
--tb=short
|
|
103
|
+
- name: Upload benchmark JSON
|
|
104
|
+
if: always()
|
|
105
|
+
uses: actions/upload-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: bench-smoke-results
|
|
108
|
+
path: bench.json
|
|
109
|
+
retention-days: 14
|
|
@@ -12,7 +12,10 @@ jobs:
|
|
|
12
12
|
- uses: actions/setup-python@v6
|
|
13
13
|
with:
|
|
14
14
|
python-version: "3.12"
|
|
15
|
-
-
|
|
15
|
+
- uses: astral-sh/setup-uv@v5
|
|
16
|
+
with:
|
|
17
|
+
enable-cache: true
|
|
18
|
+
- run: uv pip install --system build
|
|
16
19
|
- run: python -m build
|
|
17
20
|
- uses: actions/upload-artifact@v4
|
|
18
21
|
with:
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Pre-commit hooks for trnsolver.
|
|
2
|
+
#
|
|
3
|
+
# Setup (once per clone):
|
|
4
|
+
# pip install pre-commit
|
|
5
|
+
# pre-commit install
|
|
6
|
+
#
|
|
7
|
+
# After that, `git commit` runs ruff on staged files automatically. CI enforces
|
|
8
|
+
# the same checks (`.github/workflows/ci.yml::lint`), so skipping hooks locally
|
|
9
|
+
# just moves the failure to CI.
|
|
10
|
+
#
|
|
11
|
+
# Run ad-hoc against all files:
|
|
12
|
+
# pre-commit run --all-files
|
|
13
|
+
|
|
14
|
+
repos:
|
|
15
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
|
+
rev: v0.7.4
|
|
17
|
+
hooks:
|
|
18
|
+
- id: ruff
|
|
19
|
+
args: [--fix]
|
|
20
|
+
- id: ruff-format
|
|
21
|
+
|
|
22
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
23
|
+
rev: v5.0.0
|
|
24
|
+
hooks:
|
|
25
|
+
- id: trailing-whitespace
|
|
26
|
+
- id: end-of-file-fixer
|
|
27
|
+
- id: check-merge-conflict
|
|
28
|
+
- id: check-yaml
|
|
29
|
+
- id: check-toml
|
|
30
|
+
- id: check-added-large-files
|
|
31
|
+
args: [--maxkb=500]
|