torchcompat
=============================
|pypi| |py_versions| |codecov| |docs| |tests| |style|
.. |pypi| image:: https://img.shields.io/pypi/v/torchcompat.svg
:target: https://pypi.python.org/pypi/torchcompat
:alt: Current PyPi Version
.. |py_versions| image:: https://img.shields.io/pypi/pyversions/torchcompat.svg
:target: https://pypi.python.org/pypi/torchcompat
:alt: Supported Python Versions
.. |codecov| image:: https://codecov.io/gh/Delaunay/torchcompat/branch/master/graph/badge.svg?token=40Cr8V87HI
:target: https://codecov.io/gh/Delaunay/torchcompat
.. |docs| image:: https://readthedocs.org/projects/torchcompat/badge/?version=latest
:target: https://torchcompat.readthedocs.io/en/latest/?badge=latest
.. |tests| image:: https://github.com/Delaunay/torchcompat/actions/workflows/test.yml/badge.svg?branch=master
:target: https://github.com/Delaunay/torchcompat/actions/workflows/test.yml
.. |style| image:: https://github.com/Delaunay/torchcompat/actions/workflows/style.yml/badge.svg?branch=master
:target: https://github.com/Delaunay/torchcompat/actions/workflows/style.yml
.. code-block:: text
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
.. code-block:: python
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
-------
.. code-block:: python
example here
Raw data
{
"_id": null,
"home_page": "https://torchcompat.readthedocs.io",
"name": "torchcompat",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Anonymous",
"author_email": "anony@mous.com",
"download_url": "https://files.pythonhosted.org/packages/2c/de/ac95694f30034e716e83427a1e9e84ea368735b566300f696178e9e910be/torchcompat-1.1.4.tar.gz",
"platform": null,
"description": "torchcompat\n=============================\n\n|pypi| |py_versions| |codecov| |docs| |tests| |style|\n\n.. |pypi| image:: https://img.shields.io/pypi/v/torchcompat.svg\n :target: https://pypi.python.org/pypi/torchcompat\n :alt: Current PyPi Version\n\n.. |py_versions| image:: https://img.shields.io/pypi/pyversions/torchcompat.svg\n :target: https://pypi.python.org/pypi/torchcompat\n :alt: Supported Python Versions\n\n.. |codecov| image:: https://codecov.io/gh/Delaunay/torchcompat/branch/master/graph/badge.svg?token=40Cr8V87HI\n :target: https://codecov.io/gh/Delaunay/torchcompat\n\n.. |docs| image:: https://readthedocs.org/projects/torchcompat/badge/?version=latest\n :target: https://torchcompat.readthedocs.io/en/latest/?badge=latest\n\n.. |tests| image:: https://github.com/Delaunay/torchcompat/actions/workflows/test.yml/badge.svg?branch=master\n :target: https://github.com/Delaunay/torchcompat/actions/workflows/test.yml\n\n.. |style| image:: https://github.com/Delaunay/torchcompat/actions/workflows/style.yml/badge.svg?branch=master\n :target: https://github.com/Delaunay/torchcompat/actions/workflows/style.yml\n\n\n.. code-block:: text\n\n pip install torchcompat\n\n\nFeatures\n--------\n\n* Provide a super set implementation of pytorch device interface\n to enable code to run seamlessly between different accelerators.\n* Identify uniquely devices\n\n\n.. code-block:: python\n\n import torchcompat.core as accelerator\n\n # on cuda accelerator == torch.cuda\n # on rocm accelerator == torch.cuda\n # on xpu accelerator == torch.xpu\n # on gaudi accelerator == ...\n\n assert accelerator.is_available() == true\n assert accelerator.device_name in ('xpu', 'cuda', \"hpu\") # rocm is seen as cuda by pytorch\n assert accelerator.device_string(0) == \"cuda:0\" or \"xpu:0\" or \"hpu:0\"\n assert accelerator.fetch_device(0) == torch.device(\"cuda:0\")\n\n\n accelerator.set_enable_tf32(true) # toggle the right flags for each backend\n\n\nExample\n-------\n\n.. code-block:: python\n\n example here\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "torch compatibility layer",
"version": "1.1.4",
"project_urls": {
"Homepage": "https://torchcompat.readthedocs.io"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "94b29b5d6f9aa9ffc7d35a42ff8a0e2fcf2e9458be5f0bb6077ad98925f8c043",
"md5": "9ce230c5d8993854bc52f95edc03fd3a",
"sha256": "2e3b3c56717590450588a4d431be387355d16864fdd74edb22fb189b9feca47b"
},
"downloads": -1,
"filename": "torchcompat-1.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ce230c5d8993854bc52f95edc03fd3a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9000,
"upload_time": "2024-07-11T16:36:10",
"upload_time_iso_8601": "2024-07-11T16:36:10.755485Z",
"url": "https://files.pythonhosted.org/packages/94/b2/9b5d6f9aa9ffc7d35a42ff8a0e2fcf2e9458be5f0bb6077ad98925f8c043/torchcompat-1.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2cdeac95694f30034e716e83427a1e9e84ea368735b566300f696178e9e910be",
"md5": "2a0b3cb74f9a4f4a8de7d29797755a1c",
"sha256": "fabd54bea79624f2e7058842f38536b3d80b2a586c1ac88303d42b8e06ae8c84"
},
"downloads": -1,
"filename": "torchcompat-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "2a0b3cb74f9a4f4a8de7d29797755a1c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5909,
"upload_time": "2024-07-11T16:36:12",
"upload_time_iso_8601": "2024-07-11T16:36:12.164112Z",
"url": "https://files.pythonhosted.org/packages/2c/de/ac95694f30034e716e83427a1e9e84ea368735b566300f696178e9e910be/torchcompat-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-11 16:36:12",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "torchcompat"
}