Skip to main content

trnsci

CI codecov pre-commit PyPI Python License Docs

Scientific computing suite for AWS Trainium via NKI. Six focused libraries providing the cu* equivalents the Neuron SDK doesn't ship.

Suite

Project NVIDIA analog Scope PyPI
trnfft cuFFT FFT, complex tensors, STFT, spherical harmonic transforms, complex NN layers trnfft
trnblas cuBLAS BLAS Levels 1–3, batched GEMM, DF-MP2 energy trnblas
trnrand cuRAND Threefry/Philox PRNG, Sobol/Halton QMC trnrand
trnsolver cuSOLVER Cholesky/LU/QR/SVD, Jacobi eigh, CG/GMRES and block CG, SCF eigensolvers trnsolver
trnsparse cuSPARSE BSR-128 SpMM, Schwarz screening, block-sparse attention, fused kernel-matrix operator trnsparse
trntensor cuTENSOR Einstein summation with path planning, CP/Tucker/TT, streamed DF integrals, multi-chip sharding trntensor

Install

# Meta-package with all six sub-projects
pip install "trnsci[all]"

# Individual components
pip install "trnsci[fft]"     # just trnfft
pip install "trnsci[blas]"    # just trnblas
# ... etc

On Trn2/Trn3, start from the Neuron SDK 2.33 Deep Learning AMI (PyTorch 2.14 environment), which already has torch-neuronx and NKI, or add them with pip install "trnsci[all,torchneuron]" --extra-index-url https://pip.repos.neuron.amazonaws.com (Python ≥ 3.12). On Trn1/Inf2, pip install "trnsci[all,neuron]" --extra-index-url https://pip.repos.neuron.amazonaws.com adds the PyTorch/XLA-lineage packages. Details and the current trnsci[all] minimums: installation.

Development install

git clone git@github.com:trnsci/trnsci.git
cd trnsci
for p in trnfft trnblas trnrand trnsparse trntensor; do
  [ -d "$p" ] || git clone "git@github.com:trnsci/$p.git"
done
[ -d trnsolve ] || git clone git@github.com:trnsci/trnsolver.git trnsolve
make install-dev   # pip install -e on each sub-project + umbrella
make test-all      # run pytest across all sub-projects

Cross-project example

python examples/quantum_chemistry/df_mp2_synthetic.py --demo
python examples/quantum_chemistry/df_mp2_synthetic.py --demo --device neuron   # Trn2/Trn3

Closed-shell DF-MP2 energy evaluation composing trnrand (synthetic inputs), trnsparse (Schwarz screening report), trnsolver (Cholesky of the DF metric), trnblas (half-transforms) and trntensor (mp2_energy), checked against a float64 reference. examples/quantum_chemistry/df_mp2_profile.py profiles the same pipeline across a ladder of sizes. See also examples/nvidia_samples/ for direct ports of canonical NVIDIA CUDA samples.

Status

All sub-projects are Alpha. CPU/PyTorch fallback is functional end-to-end. All six libraries ship NKI kernels with native TorchNeuron dispatch on Trn2/Trn3 (Neuron SDK 2.33), every library runs a conformance suite against independent references, and their current releases are validated on Trn2 (validation status). The PyTorch/XLA path on Trn1 is in maintenance. On the native device, auto dispatch uses an NKI kernel only where it measured faster than aten, and float64 follows one suite policy: the device has no float64 arithmetic, so auto computes it on the host.

Workload-level results on one Trn2 chip — a 10⁶-point Gaussian process, spherical harmonic transforms, DF-RHF/MP2 to 3508 basis functions and DeepVariant call_variants — are on exemplars.

Roadmap

Five-phase plan from current alpha to generation-tuned stable release, tracked in the GitHub milestones and on the project board. See the reader-oriented version on trnsci.dev and the phase definitions in ROADMAP.md.

Community

License

Apache 2.0 — Copyright 2026 Scott Friedman.

Disclaimer

trnsci is an independent open-source project. It is not sponsored by, endorsed by, or affiliated with Amazon.com, Inc., Amazon Web Services, Inc., or Annapurna Labs Ltd.

"AWS", "Amazon", "Trainium", "Inferentia", "NeuronCore", "Neuron SDK", and related identifiers are trademarks of their respective owners and are used here solely for descriptive and interoperability purposes. Use does not imply endorsement, partnership, or any other relationship.

All work, opinions, analyses, benchmark results, architectural commentary, and editorial judgments in this repository and on trnsci.dev are those of the project's contributors. They do not represent the views, positions, or commitments of Amazon, AWS, or Annapurna Labs.

Feedback directed at the Neuron SDK or Trainium hardware is good-faith ecosystem commentary from independent users. It is not privileged information, is not pre-reviewed by AWS, and should not be read as authoritative about product roadmap, behavior, or quality.

For official AWS guidance, see aws-neuron documentation and the AWS Trainium product page.

Metadata

Release files for trnsci 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trnsci 0.2.1
File Size Uploaded Provenance Actions
trnsci-0.2.1.tar.gz 465.3 kB With provenance Details for trnsci-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trnsci 0.2.1
File Interpreter ABI Platform Actions
trnsci-0.2.1-py3-none-any.whl Python 3 none any Details for trnsci-0.2.1-py3-none-any.whl

Total release size: 473.8 kB

Release files / trnsci-0.2.1.tar.gz

Download URL trnsci-0.2.1.tar.gz
Size 465.3 kB
Tags Source
SHA-256 checksum
How to use checksums
00d567e324e62a54595c3ae923471d1121d7adc8b8bd82f6c70c4cb69c14f48e
BLAKE2b-256 checksum
How to use checksums
521a03190ad1f53fa00435e1b3eb7b1b0f9b421ec710e133db186ca64c3f3f65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / trnsci-0.2.1-py3-none-any.whl

Download URL trnsci-0.2.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a34c4f762a1fc13961240672f3c52cda20726df4f74de128fe06b8b58fc85f9a
BLAKE2b-256 checksum
How to use checksums
5ae516b7ede09d3b10eb99fcdb04969112a3f16b4d815a51ec573b396bc319fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for trnsci 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for trnsci-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page