Skip to main content

Current PyPi Version Supported Python Versions codecov docs tests style

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)

Source distribution for torchcompat 1.1.4
File Size Uploaded
torchcompat-1.1.4.tar.gz 5.9 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

1.1.4 This release

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

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