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.
Files changed (88) hide show
  1. trnsolver-0.17.0/.github/workflows/ci.yml +109 -0
  2. {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/workflows/publish.yml +4 -1
  3. {trnsolver-0.3.0 → trnsolver-0.17.0}/.gitignore +3 -0
  4. trnsolver-0.17.0/.pre-commit-config.yaml +31 -0
  5. trnsolver-0.17.0/CHANGELOG.md +669 -0
  6. {trnsolver-0.3.0 → trnsolver-0.17.0}/CLAUDE.md +14 -1
  7. {trnsolver-0.3.0 → trnsolver-0.17.0}/CONTRIBUTING.md +34 -5
  8. trnsolver-0.17.0/PKG-INFO +245 -0
  9. trnsolver-0.17.0/README.md +209 -0
  10. {trnsolver-0.3.0 → trnsolver-0.17.0}/benchmarks/bench_cuda.py +2 -0
  11. {trnsolver-0.3.0 → trnsolver-0.17.0}/benchmarks/bench_solver.py +19 -1
  12. trnsolver-0.17.0/docs/api/eigen.md +34 -0
  13. {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/api/iterative.md +11 -0
  14. trnsolver-0.17.0/docs/api/nki.md +59 -0
  15. {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/architecture.md +18 -0
  16. {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/benchmarks.md +17 -4
  17. trnsolver-0.17.0/docs/developing_kernels.md +71 -0
  18. {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/index.md +4 -3
  19. trnsolver-0.17.0/docs/installation.md +103 -0
  20. {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/quickstart.md +9 -9
  21. {trnsolver-0.3.0 → trnsolver-0.17.0}/examples/scf_eigen.py +8 -6
  22. {trnsolver-0.3.0 → trnsolver-0.17.0}/infra/terraform/main.tf +5 -1
  23. {trnsolver-0.3.0 → trnsolver-0.17.0}/mkdocs.yml +2 -0
  24. trnsolver-0.17.0/pyproject.toml +106 -0
  25. trnsolver-0.17.0/scripts/bench_jacobi.py +167 -0
  26. {trnsolver-0.3.0 → trnsolver-0.17.0}/scripts/run_neuron_tests.sh +55 -22
  27. trnsolver-0.17.0/scripts/run_simulator_tests.sh +142 -0
  28. trnsolver-0.17.0/scripts/stop_neuron_ci.sh +40 -0
  29. {trnsolver-0.3.0 → trnsolver-0.17.0}/tests/conftest.py +13 -0
  30. trnsolver-0.17.0/tests/test_compile.py +265 -0
  31. trnsolver-0.17.0/tests/test_dtype.py +195 -0
  32. trnsolver-0.17.0/tests/test_eigen.py +171 -0
  33. trnsolver-0.17.0/tests/test_eigh_cutover.py +130 -0
  34. trnsolver-0.17.0/tests/test_eigh_neuron.py +158 -0
  35. trnsolver-0.17.0/tests/test_factor.py +272 -0
  36. trnsolver-0.17.0/tests/test_iterative.py +311 -0
  37. trnsolver-0.17.0/tests/test_jacobi.py +453 -0
  38. trnsolver-0.17.0/tests/test_native_dispatch.py +461 -0
  39. trnsolver-0.17.0/tests/test_nki_compile.py +75 -0
  40. trnsolver-0.17.0/tests/test_nki_native.py +169 -0
  41. trnsolver-0.17.0/tests/test_nki_sim.py +323 -0
  42. trnsolver-0.17.0/trnsolver/__init__.py +70 -0
  43. trnsolver-0.17.0/trnsolver/_jacobi.py +231 -0
  44. trnsolver-0.17.0/trnsolver/eigen.py +866 -0
  45. trnsolver-0.17.0/trnsolver/factor.py +692 -0
  46. trnsolver-0.17.0/trnsolver/iterative.py +429 -0
  47. trnsolver-0.17.0/trnsolver/nki/__init__.py +19 -0
  48. trnsolver-0.17.0/trnsolver/nki/_native.py +100 -0
  49. trnsolver-0.17.0/trnsolver/nki/dispatch.py +639 -0
  50. trnsolver-0.17.0/trnsolver/nki/jacobi.py +550 -0
  51. trnsolver-0.17.0/trnsolver.egg-info/PKG-INFO +245 -0
  52. {trnsolver-0.3.0 → trnsolver-0.17.0}/trnsolver.egg-info/SOURCES.txt +19 -1
  53. {trnsolver-0.3.0 → trnsolver-0.17.0}/trnsolver.egg-info/requires.txt +9 -1
  54. trnsolver-0.17.0/uv.lock +1100 -0
  55. trnsolver-0.3.0/.github/workflows/ci.yml +0 -20
  56. trnsolver-0.3.0/CHANGELOG.md +0 -87
  57. trnsolver-0.3.0/PKG-INFO +0 -127
  58. trnsolver-0.3.0/README.md +0 -98
  59. trnsolver-0.3.0/docs/api/eigen.md +0 -30
  60. trnsolver-0.3.0/docs/api/nki.md +0 -36
  61. trnsolver-0.3.0/docs/installation.md +0 -41
  62. trnsolver-0.3.0/pyproject.toml +0 -54
  63. trnsolver-0.3.0/tests/test_eigen.py +0 -72
  64. trnsolver-0.3.0/tests/test_factor.py +0 -140
  65. trnsolver-0.3.0/tests/test_iterative.py +0 -87
  66. trnsolver-0.3.0/trnsolver/__init__.py +0 -33
  67. trnsolver-0.3.0/trnsolver/eigen.py +0 -170
  68. trnsolver-0.3.0/trnsolver/factor.py +0 -157
  69. trnsolver-0.3.0/trnsolver/iterative.py +0 -179
  70. trnsolver-0.3.0/trnsolver/nki/__init__.py +0 -5
  71. trnsolver-0.3.0/trnsolver/nki/dispatch.py +0 -91
  72. trnsolver-0.3.0/trnsolver.egg-info/PKG-INFO +0 -127
  73. {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  74. {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  75. {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/pull_request_template.md +0 -0
  76. {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/workflows/neuron.yml +0 -0
  77. {trnsolver-0.3.0 → trnsolver-0.17.0}/.github/workflows/notify-umbrella.yml +0 -0
  78. {trnsolver-0.3.0 → trnsolver-0.17.0}/CODE_OF_CONDUCT.md +0 -0
  79. {trnsolver-0.3.0 → trnsolver-0.17.0}/LICENSE +0 -0
  80. {trnsolver-0.3.0 → trnsolver-0.17.0}/benchmarks/conftest.py +0 -0
  81. {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/api/factor.md +0 -0
  82. {trnsolver-0.3.0 → trnsolver-0.17.0}/docs/aws_setup.md +0 -0
  83. {trnsolver-0.3.0 → trnsolver-0.17.0}/infra/terraform/README.md +0 -0
  84. {trnsolver-0.3.0 → trnsolver-0.17.0}/infra/terraform/gpu.tf +0 -0
  85. {trnsolver-0.3.0 → trnsolver-0.17.0}/scripts/run_cuda_tests.sh +0 -0
  86. {trnsolver-0.3.0 → trnsolver-0.17.0}/setup.cfg +0 -0
  87. {trnsolver-0.3.0 → trnsolver-0.17.0}/trnsolver.egg-info/dependency_links.txt +0 -0
  88. {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
- - run: pip install build
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:
@@ -7,6 +7,9 @@ build/
7
7
  .eggs/
8
8
  *.egg
9
9
  .pytest_cache/
10
+ .coverage
11
+ coverage.xml
12
+ htmlcov/
10
13
  .tox/
11
14
  .venv/
12
15
  venv/
@@ -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]