torchcompat
pip install torchcompat
Features
Provide a super set implementation of pytorch device interface to enable code to run seamlessly between different accelerators.
Identify uniquely devices
import torchcompat.core as accelerator
# on cuda accelerator == torch.cuda
# on rocm accelerator == torch.cuda
# on xpu accelerator == torch.xpu
# on gaudi accelerator == ...
assert accelerator.is_available() == true
assert accelerator.device_name in ('xpu', 'cuda', "hpu") # rocm is seen as cuda by pytorch
assert accelerator.device_string(0) == "cuda:0" or "xpu:0" or "hpu:0"
assert accelerator.fetch_device(0) == torch.device("cuda:0")
accelerator.set_enable_tf32(true) # toggle the right flags for each backend
Example
example here
Metadata
Release files for torchcompat 1.1.4
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 | Actions |
|---|---|---|---|---|
| torchcompat-1.1.4.tar.gz | 5.9 kB | Without provenance | Details for torchcompat-1.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| torchcompat-1.1.4-py3-none-any.whl | Python 3 | none | any | Details for torchcompat-1.1.4-py3-none-any.whl |
Total release size: 14.9 kB
Release files / torchcompat-1.1.4.tar.gz
| Download URL | torchcompat-1.1.4.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fabd54bea79624f2e7058842f38536b3d80b2a586c1ac88303d42b8e06ae8c84
|
|
BLAKE2b-256 checksum How to use checksums |
2cdeac95694f30034e716e83427a1e9e84ea368735b566300f696178e9e910be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.19
|
Release files / torchcompat-1.1.4-py3-none-any.whl
| Download URL | torchcompat-1.1.4-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e3b3c56717590450588a4d431be387355d16864fdd74edb22fb189b9feca47b
|
|
BLAKE2b-256 checksum How to use checksums |
94b29b5d6f9aa9ffc7d35a42ff8a0e2fcf2e9458be5f0bb6077ad98925f8c043
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.19
|
Security for torchcompat 1.1.4
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.