trnsci 0.1.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 (47) hide show
  1. trnsci-0.1.0/.github/workflows/docs.yml +54 -0
  2. trnsci-0.1.0/.github/workflows/publish.yml +56 -0
  3. trnsci-0.1.0/.github/workflows/test.yml +45 -0
  4. trnsci-0.1.0/.gitignore +33 -0
  5. trnsci-0.1.0/CHANGELOG.md +54 -0
  6. trnsci-0.1.0/CLAUDE.md +38 -0
  7. trnsci-0.1.0/CODE_OF_CONDUCT.md +25 -0
  8. trnsci-0.1.0/CONTRIBUTING.md +69 -0
  9. trnsci-0.1.0/LICENSE +201 -0
  10. trnsci-0.1.0/Makefile +36 -0
  11. trnsci-0.1.0/PKG-INFO +112 -0
  12. trnsci-0.1.0/README.md +64 -0
  13. trnsci-0.1.0/docs/CNAME +1 -0
  14. trnsci-0.1.0/docs/contributing.md +7 -0
  15. trnsci-0.1.0/docs/cuda_rosetta.md +123 -0
  16. trnsci-0.1.0/docs/deployment.md +74 -0
  17. trnsci-0.1.0/docs/index.md +49 -0
  18. trnsci-0.1.0/docs/installation.md +29 -0
  19. trnsci-0.1.0/docs/libraries.md +17 -0
  20. trnsci-0.1.0/docs/trainium_positioning.md +52 -0
  21. trnsci-0.1.0/docs/why.md +34 -0
  22. trnsci-0.1.0/docs/workflows/integration.md +25 -0
  23. trnsci-0.1.0/docs/workflows/quantum_chemistry.md +43 -0
  24. trnsci-0.1.0/docs/workflows/speech_enhancement.md +34 -0
  25. trnsci-0.1.0/examples/README.md +21 -0
  26. trnsci-0.1.0/examples/nvidia_samples/README.md +20 -0
  27. trnsci-0.1.0/examples/nvidia_samples/batch_cublas.py +63 -0
  28. trnsci-0.1.0/examples/nvidia_samples/conjugate_gradient.py +84 -0
  29. trnsci-0.1.0/examples/nvidia_samples/cusolver_syevd.py +55 -0
  30. trnsci-0.1.0/examples/nvidia_samples/cutensor_contraction.py +65 -0
  31. trnsci-0.1.0/examples/nvidia_samples/mc_estimate_pi.py +64 -0
  32. trnsci-0.1.0/examples/nvidia_samples/simple_cufft_2d_r2c.py +53 -0
  33. trnsci-0.1.0/examples/quantum_chemistry/README.md +25 -0
  34. trnsci-0.1.0/examples/quantum_chemistry/df_mp2_synthetic.py +191 -0
  35. trnsci-0.1.0/examples/quantum_chemistry/pyscf_bridge_sketch.md +61 -0
  36. trnsci-0.1.0/examples/reverse_port_note.md +57 -0
  37. trnsci-0.1.0/examples/speech_enhancement/README.md +22 -0
  38. trnsci-0.1.0/examples/speech_enhancement/demo.py +128 -0
  39. trnsci-0.1.0/mkdocs.yml +54 -0
  40. trnsci-0.1.0/pyproject.toml +65 -0
  41. trnsci-0.1.0/setup.cfg +4 -0
  42. trnsci-0.1.0/tests/test_integration.py +69 -0
  43. trnsci-0.1.0/trnsci.egg-info/PKG-INFO +112 -0
  44. trnsci-0.1.0/trnsci.egg-info/SOURCES.txt +45 -0
  45. trnsci-0.1.0/trnsci.egg-info/dependency_links.txt +1 -0
  46. trnsci-0.1.0/trnsci.egg-info/requires.txt +37 -0
  47. trnsci-0.1.0/trnsci.egg-info/top_level.txt +1 -0
@@ -0,0 +1,54 @@
1
+ name: Deploy docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+ # Rebuild daily to pick up sub-project changes.
8
+ schedule:
9
+ - cron: "0 6 * * *"
10
+ # External trigger so sub-project CIs can kick off an umbrella rebuild.
11
+ repository_dispatch:
12
+ types: [subproject-updated]
13
+
14
+ permissions:
15
+ contents: write
16
+
17
+ jobs:
18
+ deploy:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v6
22
+ with:
23
+ fetch-depth: 0
24
+
25
+ - uses: actions/setup-python@v6
26
+ with:
27
+ python-version: "3.11"
28
+
29
+ - name: Clone sub-projects
30
+ run: |
31
+ set -euo pipefail
32
+ # Each sub-project's own mkdocs.yml is composed into the umbrella site
33
+ # via mkdocs-monorepo-plugin. The trnsolver repo lives at the
34
+ # "trnsolve" directory name inside the umbrella layout.
35
+ declare -A REPOS=(
36
+ [trnfft]=trnfft
37
+ [trnblas]=trnblas
38
+ [trnrand]=trnrand
39
+ [trnsolve]=trnsolver
40
+ [trnsparse]=trnsparse
41
+ [trntensor]=trntensor
42
+ )
43
+ for dir in "${!REPOS[@]}"; do
44
+ repo="${REPOS[$dir]}"
45
+ git clone --depth 1 "https://github.com/trnsci/${repo}.git" "$dir"
46
+ done
47
+
48
+ - name: Install docs dependencies
49
+ run: |
50
+ pip install --upgrade pip
51
+ pip install mkdocs-material mkdocs-monorepo-plugin
52
+
53
+ - name: Build and deploy to gh-pages
54
+ run: mkdocs gh-deploy --force --clean
@@ -0,0 +1,56 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v6
12
+ - uses: actions/setup-python@v6
13
+ with:
14
+ python-version: "3.12"
15
+ - run: pip install build
16
+ - run: python -m build
17
+ - uses: actions/upload-artifact@v4
18
+ with:
19
+ name: dist
20
+ path: dist/
21
+
22
+ publish-pypi:
23
+ needs: build
24
+ runs-on: ubuntu-latest
25
+ # Only publish stable releases (v1.2.3), not pre-releases (v1.2.3-rc1)
26
+ if: ${{ !contains(github.event.release.tag_name, '-') }}
27
+ environment:
28
+ name: pypi
29
+ url: https://pypi.org/project/trnsci/
30
+ permissions:
31
+ id-token: write
32
+ steps:
33
+ - uses: actions/download-artifact@v4
34
+ with:
35
+ name: dist
36
+ path: dist/
37
+ - uses: pypa/gh-action-pypi-publish@release/v1
38
+
39
+ publish-testpypi:
40
+ needs: build
41
+ runs-on: ubuntu-latest
42
+ # Only publish pre-releases to TestPyPI
43
+ if: ${{ contains(github.event.release.tag_name, '-') }}
44
+ environment:
45
+ name: testpypi
46
+ url: https://test.pypi.org/project/trnsci/
47
+ permissions:
48
+ id-token: write
49
+ steps:
50
+ - uses: actions/download-artifact@v4
51
+ with:
52
+ name: dist
53
+ path: dist/
54
+ - uses: pypa/gh-action-pypi-publish@release/v1
55
+ with:
56
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,45 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ # The sub-project libraries each have their own CI. The umbrella repo's
9
+ # CI only verifies that the cross-library integration test works when
10
+ # all six libraries are installed from their current upstream locations.
11
+ #
12
+ # Sub-project repos currently live under scttfrdmn/. After transfer to
13
+ # the trnsci/ org, update the git URLs below.
14
+
15
+ env:
16
+ SUBPROJECT_OWNER: scttfrdmn
17
+
18
+ jobs:
19
+ integration:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+ - uses: actions/setup-python@v6
24
+ with:
25
+ python-version: "3.11"
26
+
27
+ - name: Install sub-projects from git
28
+ run: |
29
+ set -euo pipefail
30
+ for pkg in trnfft trnblas trnrand trnsolver trnsparse trntensor; do
31
+ echo "==> $pkg"
32
+ if ! pip install "git+https://github.com/${SUBPROJECT_OWNER}/${pkg}.git#egg=${pkg}[dev]" ; then
33
+ echo " skipping $pkg — repo not found under ${SUBPROJECT_OWNER}/ yet"
34
+ fi
35
+ done
36
+
37
+ - name: Install umbrella
38
+ run: pip install -e ".[dev]"
39
+
40
+ - name: Run integration tests
41
+ run: pytest tests/ -v -x --tb=short -m "not neuron"
42
+
43
+ - name: Run DF-MP2 demo
44
+ run: python examples/quantum_chemistry/df_mp2_synthetic.py --demo
45
+ continue-on-error: true
@@ -0,0 +1,33 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.egg
9
+ .pytest_cache/
10
+ .tox/
11
+ .venv/
12
+ venv/
13
+ *.so
14
+ .idea/
15
+ .vscode/
16
+ *.swp
17
+ *.swo
18
+ *~
19
+ site/
20
+ .benchmarks/
21
+ .terraform/
22
+ *.tfstate
23
+ *.tfstate.backup
24
+ .terraform.lock.hcl
25
+
26
+ # Sub-projects live here as sibling directories but each has its own .git
27
+ # and its own repo under github.com/trnsci/. The umbrella does not vendor them.
28
+ /trnfft/
29
+ /trnblas/
30
+ /trnrand/
31
+ /trnsolve/
32
+ /trnsparse/
33
+ /trntensor/
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+
3
+ All notable changes to the trnsci umbrella package.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] — 2026-04-13
9
+
10
+ Initial umbrella release.
11
+
12
+ ### Added
13
+
14
+ - **Meta-package** that coordinates installation of the six trnsci sub-projects:
15
+ `trnfft`, `trnblas`, `trnrand`, `trnsolver`, `trnsparse`, `trntensor`.
16
+ - **Optional extras**: `[fft]`, `[blas]`, `[rand]`, `[solver]`, `[sparse]`,
17
+ `[tensor]`, `[all]`, `[neuron]`, `[dev]`. `pip install trnsci[all]` pulls
18
+ in every sub-project.
19
+ - **Cross-project DF-MP2 integration example** at
20
+ `examples/quantum_chemistry/df_mp2_synthetic.py`, composing `trnrand` +
21
+ `trnsparse` + `trnsolver` + `trnblas` + `trntensor` in one pipeline.
22
+ - **NVIDIA CUDA sample ports** under `examples/nvidia_samples/`: direct ports
23
+ of `cuFFT/2d_r2c_c2r`, `cuda-samples/batchCUBLAS`, `MC_EstimatePi{P,Q}`,
24
+ `cuSOLVER/syevd`, `cuda-samples/conjugateGradient`, and
25
+ `cuTENSOR/contraction` against trnsci APIs, each citing the upstream
26
+ sample by URL.
27
+ - **Speech-enhancement workflow** at `examples/speech_enhancement/demo.py` —
28
+ synthetic cIRM pipeline exercising trnfft's STFT, ComplexTensor, and
29
+ complex NN layers.
30
+ - **Unified documentation site** at https://trnsci.dev/ — landing,
31
+ `why.md` essay, `cuda_rosetta.md` (CUDA → trnsci mapping table with
32
+ per-library deep dives), `trainium_positioning.md` (placing Trainium
33
+ between NVIDIA SMs and Google TPUs), and workflow pages for speech
34
+ enhancement and quantum chemistry. Sub-project docs are composed under
35
+ `trnsci.dev/<name>/` via `mkdocs-monorepo-plugin`.
36
+ - **Canonical contribution norms**: `CONTRIBUTING.md` and
37
+ `CODE_OF_CONDUCT.md` (Contributor Covenant 2.1) mirrored across all
38
+ seven repos.
39
+ - **CI workflows** (`test.yml`, `docs.yml`, `publish.yml`) on Node.js 24
40
+ (actions/checkout@v6, actions/setup-python@v6). `docs.yml` clones all
41
+ six sub-projects at build time and publishes the combined site; daily
42
+ cron + repository_dispatch keeps the site fresh.
43
+
44
+ ### Notes
45
+
46
+ - All sub-projects pinned to the same neuronxcc floor (`>=2.24`) and the
47
+ same torch-neuronx floor (`>=2.9`).
48
+ - Sub-projects remain independent repos with independent releases. The
49
+ umbrella tracks minimum sub-project versions via the extras above.
50
+ - PyTorch fallback works end-to-end for every sub-project on any hardware.
51
+ NKI kernels are scaffolded; on-hardware validation on trn1 / trn2 is
52
+ the next milestone across the suite.
53
+
54
+ [0.1.0]: https://github.com/trnsci/trnsci/releases/tag/v0.1.0
trnsci-0.1.0/CLAUDE.md ADDED
@@ -0,0 +1,38 @@
1
+ # trnsci
2
+
3
+ Umbrella for the trn-* scientific computing suite for AWS Trainium via NKI.
4
+
5
+ ## Layout
6
+
7
+ ```
8
+ trnsci/
9
+ ├── trnfft/ # cuFFT-equivalent: FFT, complex tensors
10
+ ├── trnblas/ # cuBLAS-equivalent: BLAS Level 1-3
11
+ ├── trnrand/ # cuRAND-equivalent: PRNG + QMC
12
+ ├── trnsolve/ # cuSOLVER-equivalent: factorizations, eigh (package name: trnsolver)
13
+ ├── trnsparse/ # cuSPARSE-equivalent: sparse formats + SpMM
14
+ ├── trntensor/ # cuTENSOR-equivalent: einsum + decompositions
15
+ ├── examples/ # Cross-project integration examples
16
+ ├── tests/ # Integration tests
17
+ ├── docs/ # Umbrella mkdocs site (links into per-project docs)
18
+ └── pyproject.toml # Meta-package (trnsci[all] → all six)
19
+ ```
20
+
21
+ Each sub-project has its own `CLAUDE.md`, `pyproject.toml`, `tests/`, and `.git/`. The umbrella is a coordinating layer — it does not own their code.
22
+
23
+ ## Conventions across the suite
24
+
25
+ - Apache 2.0, Copyright 2026 Scott Friedman
26
+ - Python ≥3.10, torch ≥2.1, numpy ≥1.24
27
+ - Optional `[neuron]` extra pins `neuronxcc>=2.24` (NKI 2.24+ calling convention)
28
+ - NKI dispatch pattern: each project exposes `set_backend("auto"|"pytorch"|"nki")` via `<pkg>/nki/dispatch.py`
29
+ - Tests marked `@pytest.mark.neuron` for on-hardware-only tests
30
+ - `pytest -m "not neuron"` is the CPU-only CI path
31
+
32
+ ## Cross-project composition
33
+
34
+ `examples/df_mp2_integrated.py` is the canonical integration demo — shows how the sub-projects compose for a realistic workload (density-fitted MP2 energy). Treat it as the reference for cross-project API usage.
35
+
36
+ ## Release coordination
37
+
38
+ Sub-projects version independently. The umbrella `trnsci` package version reflects the meta-package itself, not the sub-projects. When a sub-project releases, bump the corresponding minimum in `pyproject.toml` extras.
@@ -0,0 +1,25 @@
1
+ # Code of Conduct
2
+
3
+ This project adopts the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, as its code of conduct. The full text is available at:
4
+
5
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct/
6
+
7
+ ## Scope
8
+
9
+ This Code applies within all project spaces — the GitHub repositories under the [trnsci](https://github.com/trnsci) organization, issue trackers, pull request discussions, and any public forums where an individual is representing the project or its community.
10
+
11
+ ## Reporting
12
+
13
+ Concerns about behaviour in project spaces may be reported confidentially to:
14
+
15
+ **scttfrdmn@gmail.com**
16
+
17
+ All reports will be reviewed and investigated promptly and fairly. The project maintainers are obligated to respect the privacy and security of the reporter.
18
+
19
+ ## Enforcement
20
+
21
+ Maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
22
+
23
+ ## Attribution
24
+
25
+ This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. It is licensed under CC BY 4.0.
@@ -0,0 +1,69 @@
1
+ # Contributing to trnsci
2
+
3
+ Thanks for your interest in contributing. This document covers the whole suite — the same guidelines apply to the umbrella and to each of the six sub-projects (`trnfft`, `trnblas`, `trnrand`, `trnsolver`, `trnsparse`, `trntensor`).
4
+
5
+ ## Where does my change belong?
6
+
7
+ - **Scoped to a single library** — bug fix, new feature, added kernel in one sub-project → open a PR in that sub-project's repo.
8
+ - **Cross-cutting** — integration examples, umbrella docs, CUDA-rosetta content, coordinated version bumps, shared tooling → open a PR against [trnsci/trnsci](https://github.com/trnsci/trnsci).
9
+
10
+ If you aren't sure, open the PR where it's easiest and we'll move it.
11
+
12
+ ## Development setup
13
+
14
+ ```bash
15
+ git clone git@github.com:trnsci/trnsci.git
16
+ cd trnsci
17
+ # Clone sibling sub-projects if you don't already have them:
18
+ for p in trnfft trnblas trnrand trnsolver trnsparse trntensor; do
19
+ [ -d "$p" ] || git clone "git@github.com:trnsci/$p.git"
20
+ done
21
+ make install-dev
22
+ make test-all
23
+ ```
24
+
25
+ A single sub-project in isolation:
26
+
27
+ ```bash
28
+ cd trnfft # or any other
29
+ pip install -e ".[dev]"
30
+ pytest tests/ -v -m "not neuron"
31
+ ```
32
+
33
+ ## Tests
34
+
35
+ - `pytest tests/ -v -m "not neuron"` — the CPU-only suite. Must pass on every PR.
36
+ - `pytest tests/ -v -m neuron` — on-hardware suite, run from a machine with AWS credentials via `scripts/run_neuron_tests.sh`. Not part of standard CI.
37
+
38
+ ## Conventions
39
+
40
+ - **License header** — new files get the Apache 2.0 notice and `Copyright 2026 Scott Friedman` where a notice is customary (long source files, not one-line configs).
41
+ - **Python** — ≥ 3.10; `torch` ≥ 2.1; `numpy` ≥ 1.24.
42
+ - **No emoji** in source, commits, or docs unless the feature is literally about emoji.
43
+ - **Docstrings** only where they help a reader who doesn't have the context you had when writing. Don't restate the signature.
44
+ - **No throwaway files** in the repo root — work-in-progress notes belong in PR descriptions or `docs/`.
45
+
46
+ ## Commit style
47
+
48
+ Conventional-ish prefixes: `fix:`, `feat:`, `docs:`, `test:`, `bench:`, `chore:`, `refactor:`. Keep the subject line ≤ 72 characters. Longer context goes in the body.
49
+
50
+ ## Pull requests
51
+
52
+ Before opening a PR:
53
+
54
+ - [ ] `pytest tests/ -v -m "not neuron"` passes
55
+ - [ ] If you changed public API or behaviour, `CHANGELOG.md` has an `[Unreleased]` entry
56
+ - [ ] If you added a public symbol, the project's `docs/api.md` lists it
57
+ - [ ] PR description says *what* changed and *why*, not just *what*
58
+
59
+ ## Issues
60
+
61
+ Label each issue one of: `bug`, `feature`, `question`, `docs`, `infra`. Bugs include repro steps and expected-vs-actual output. Features describe the use case.
62
+
63
+ ## Code of conduct
64
+
65
+ By participating, you agree to abide by the [Contributor Covenant v2.1](CODE_OF_CONDUCT.md). Report concerns to the contact listed there.
66
+
67
+ ## License
68
+
69
+ Contributions are Apache 2.0, per the repository's [LICENSE](LICENSE). You attest you have the right to submit the code.
trnsci-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ Copyright 2026 Scott Friedman
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for describing the origin of the Work and
143
+ reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may accept support,
169
+ obligations, or other liability only on behalf of Yourself and on
170
+ Your sole responsibility, not on behalf of any other Contributor,
171
+ and only if You agree to indemnify, defend, and hold each Contributor
172
+ harmless for any liability incurred by, or claims asserted against,
173
+ such Contributor by reason of your accepting any such warranty or
174
+ additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Scott Friedman
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
trnsci-0.1.0/Makefile ADDED
@@ -0,0 +1,36 @@
1
+ .PHONY: install-dev test-all docs docs-serve bench-all clean
2
+
3
+ SUBPROJECTS := trnfft trnblas trnrand trnsolve trnsparse trntensor
4
+
5
+ install-dev:
6
+ @for p in $(SUBPROJECTS); do \
7
+ echo "==> pip install -e ./$$p"; \
8
+ pip install -e "./$$p[dev]" || exit 1; \
9
+ done
10
+ pip install -e ".[dev]"
11
+
12
+ test-all:
13
+ @for p in $(SUBPROJECTS); do \
14
+ echo "==> pytest $$p"; \
15
+ ( cd $$p && pytest tests/ -v -x --tb=short -m "not neuron" ) || exit 1; \
16
+ done
17
+ pytest tests/ -v -x --tb=short -m "not neuron"
18
+
19
+ docs:
20
+ mkdocs build --strict
21
+
22
+ docs-serve:
23
+ mkdocs serve
24
+
25
+ bench-all:
26
+ @for p in $(SUBPROJECTS); do \
27
+ if [ -d "$$p/benchmarks" ]; then \
28
+ echo "==> benchmarks in $$p"; \
29
+ ( cd $$p && pytest benchmarks/ --benchmark-only ) || true; \
30
+ fi; \
31
+ done
32
+
33
+ clean:
34
+ find . -name __pycache__ -type d -exec rm -rf {} + 2>/dev/null || true
35
+ find . -name '*.egg-info' -type d -exec rm -rf {} + 2>/dev/null || true
36
+ rm -rf site/ build/ dist/