This release is a pre-release and may not be stable for production use.
covex-neuron
Run your PyTorch and Hugging Face code on AWS Trainium, unchanged from NVIDIA except for two lines
covex-neuron is built on TorchNeuron, the native PyTorch backend for Trainium2 and Trainium3. It handles the parts that make Trainium different from a GPU (bf16, fixed input shapes, the Neuron compiler) and runs your script on AWS by the second, next to an NVIDIA GPU for comparison.
Installation
pip install covex-neuron
Quickstart
Add two lines to an existing GPU script:
import covex_neuron as cn
device = cn.device() # "neuron" on Trainium, "cuda" on GPU
pipe = pipeline("sentiment-analysis", model="distilbert/distilbert-base-uncased-finetuned-sst-2-english", device=device)
pipe = cn.prepare(pipe) # no-op on GPU / CPU
cn.prepare takes a transformers model (with its tokenizer), a transformers pipeline, or a diffusers pipeline.
Run it on a GPU and on Trainium from your laptop, using only your AWS credentials:
gpu = cn.run(["sentiment.py"], on="gpu") # 1x NVIDIA A10G
trn = cn.run(["sentiment.py"], on="trainium") # 1x Trainium2 chip
cn.compare(gpu, trn)
You pay per second while the job runs, and nothing keeps running afterwards.
Examples
examples/nvidia has sentiment analysis, text classification and image generation scripts as written for a GPU. examples/trainium has the same scripts with the two lines added. To run both and compare:
python examples/run_demo.py
License
Metadata
Release files for covex-neuron 0.0.1.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| covex_neuron-0.0.1.dev0.tar.gz | 16.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| covex_neuron-0.0.1.dev0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.8 kB
Release files / covex_neuron-0.0.1.dev0.tar.gz
| Download URL | covex_neuron-0.0.1.dev0.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3771e19dc0065981dbbc2b00ec132d4674a27ac067654e3c627452f1fa3fbc8d
|
|
BLAKE2b-256 checksum How to use checksums |
4858caf9d9a7d520088e5164bf1eee15fd97c0a2abdf9220da196c48eefe56d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / covex_neuron-0.0.1.dev0-py3-none-any.whl
| Download URL | covex_neuron-0.0.1.dev0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c39cd777d9e01ea84c51f039ae2c1b77b8a13494b7ac6e1b80816913ba8956c5
|
|
BLAKE2b-256 checksum How to use checksums |
ff3cc308d90ff015c6ceaa5a61d3aac7475a9ec8114aa57d82ee7361ff74e38e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for covex-neuron 0.0.1.dev0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.