Metadata-Version: 2.1
Name: lightning-habana
Version: 1.6.0.dev0
Summary: Lightning support for Intel Habana accelerators
Home-page: https://github.com/Lightning-AI/lightning-habana
Download-URL: https://github.com/Lightning-AI/lightning-habana
Author: Lightning-AI et al.
Author-email: name@lightning.ai
License: Apache-2.0
Project-URL: Bug Tracker, https://github.com/Lightning-AI/lightning-habana/issues
Project-URL: Documentation, https://lightning-habana.rtfd.io/en/latest/
Project-URL: Source Code, https://github.com/Lightning-AI/lightning-habana
Keywords: deep learning,pytorch,AI
Classifier: Environment :: Console
Classifier: Natural Language :: English
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lightning-utilities >=0.7.0
Provides-Extra: base
Requires-Dist: lightning-utilities >=0.7.0 ; extra == 'base'
Provides-Extra: examples
Requires-Dist: jsonargparse[signatures] ; extra == 'examples'
Provides-Extra: lightning
Requires-Dist: lightning >=2.1.0 ; extra == 'lightning'
Provides-Extra: pytorch-lightning
Requires-Dist: pytorch-lightning >=2.1.0 ; extra == 'pytorch-lightning'
Provides-Extra: typing
Requires-Dist: mypy ==1.10.0 ; extra == 'typing'
Requires-Dist: pytorch-lightning ==2.2.5 ; extra == 'typing'

# Lightning ⚡ Intel Habana

[![lightning](https://img.shields.io/badge/-Lightning_2.0+-792ee5?logo=pytorchlightning&logoColor=white)](https://lightning.ai/)
[![PyPI Status](https://badge.fury.io/py/lightning-habana.svg)](https://badge.fury.io/py/lightning-habana)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lightning-habana)](https://pypi.org/project/lightning-habana/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/lightning-Habana)](https://pepy.tech/project/lightning-habana)
[![Deploy Docs](https://github.com/Lightning-AI/lightning-Habana/actions/workflows/docs-deploy.yml/badge.svg)](https://lightning-ai.github.io/lightning-Habana/)

[![General checks](https://github.com/Lightning-AI/lightning-habana/actions/workflows/ci-checks.yml/badge.svg?event=push)](https://github.com/Lightning-AI/lightning-habana/actions/workflows/ci-checks.yml)
[![Build Status](https://dev.azure.com/Lightning-AI/compatibility/_apis/build/status/Lightning-AI.lightning-Habana?branchName=main)](https://dev.azure.com/Lightning-AI/compatibility/_build/latest?definitionId=45&branchName=main)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/lightning-Habana/main.svg)](https://results.pre-commit.ci/latest/github/Lightning-AI/lightning-Habana/main)

[Habana® Gaudi® AI Processor (HPU)](https://habana.ai/) training processors are built on a heterogeneous architecture with a cluster of fully programmable Tensor Processing Cores (TPC) along with its associated development tools and libraries, and a configurable Matrix Math engine.

The TPC core is a VLIW SIMD processor with an instruction set and hardware tailored to serve training workloads efficiently.
The Gaudi memory architecture includes on-die SRAM and local memories in each TPC and,
Gaudi is the first DL training processor that has integrated RDMA over Converged Ethernet (RoCE v2) engines on-chip.

On the software side, the PyTorch Habana bridge interfaces between the framework and SynapseAI software stack to enable the execution of deep learning models on the Habana Gaudi device.

Gaudi provides a significant cost-effective benefit, allowing you to engage in more deep learning training while minimizing expenses.

For more information, check out [Gaudi Architecture](https://docs.habana.ai/en/latest/Gaudi_Overview/Gaudi_Overview.html) and [Gaudi Developer Docs](https://developer.habana.ai).

______________________________________________________________________

## Installing Lighting Habana

To install Lightning Habana, run the following command:

```bash
pip install -U lightning lightning-habana
```

______________________________________________________________________

**NOTE**

Ensure either of lightning or pytorch-lightning is used when working with the plugin.
Mixing strategies, plugins etc from both packages is not yet validated.

______________________________________________________________________

## Using PyTorch Lighting with HPU

To enable PyTorch Lightning with HPU accelerator, provide `accelerator=HPUAccelerator()` parameter to the Trainer class.

```python
from lightning import Trainer
from lightning_habana.pytorch.accelerator import HPUAccelerator

# Run on one HPU.
trainer = Trainer(accelerator=HPUAccelerator(), devices=1)
# Run on multiple HPUs.
trainer = Trainer(accelerator=HPUAccelerator(), devices=8)
# Choose the number of devices automatically.
trainer = Trainer(accelerator=HPUAccelerator(), devices="auto")
```

The `devices=1` parameter with HPUs enables the Habana accelerator for single card training using `SingleHPUStrategy`.

The `devices>1` parameter with HPUs enables the Habana accelerator for distributed training. It uses `HPUDDPStrategy` which is based on DDP strategy with the integration of Habana’s collective communication library (HCCL) to support scale-up within a node and scale-out across multiple nodes.

# Support Matrix

| **SynapseAI**         | **1.16.0**                                          |
| --------------------- | --------------------------------------------------- |
| PyTorch               | 2.2.2                                               |
| (PyTorch) Lightning\* | 2.2.x                                               |
| **Lightning Habana**  | **1.6.0-dev0**                                      |
| DeepSpeed\*\*         | Forked from v0.14.0 of the official DeepSpeed repo. |

\* covers both packages [`lightning`](https://pypi.org/project/lightning/) and [`pytorch-lightning`](https://pypi.org/project/pytorch-lightning/)

For more information, check out [HPU Support Matrix](https://docs.habana.ai/en/latest/Support_Matrix/Support_Matrix.html)
