Metadata-Version: 2.1
Name: pytorch-rocm-gtt
Version: 0.1.1
Summary: 
Author: rochacbruno
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown

# pytorch_rocm_gtt

[![codecov](https://codecov.io/gh/pappacena/pytorch-rocm-gtt/branch/main/graph/badge.svg?token=pytorch-rocm-gtt_token_here)](https://codecov.io/gh/pappacena/pytorch-rocm-gtt)
[![CI](https://github.com/pappacena/pytorch-rocm-gtt/actions/workflows/main.yml/badge.svg)](https://github.com/pappacena/pytorch-rocm-gtt/actions/workflows/main.yml)


Python package to allow ROCm to overcome the reserved iGPU memory limits.

Based on https://github.com/pomoke/torch-apu-helper/tree/main, after discussion here: https://github.com/ROCm/ROCm/issues/2014

## Install it from PyPI

```bash
pip install pytorch_rocm_gtt
```

## Usage

Just call this before starting pytorch allocations (model or torch):

```py
import pytorch_rocm_gtt

pytorch_rocm_gtt.patch()
```

`hipcc` command should be in your `$PATH`.

After that, just allocate GPU memory as you would with cuda:

```py
import torch

torch.rand(1000).to("cuda")
```

## Compatibility
In order to use this package, your APU must be compatible with ROCm in the first place.

Check AMD documentation on how to install ROCm for your distribution.


## Development

Read the [CONTRIBUTING.md](CONTRIBUTING.md) file.

### How to release

Update pyproject.toml file with the desired version, and run `make release` to create the new tag.

After that, the github action will publish to pypi.

Once it is published, run the `docker_build_and_publish.sh <version-number>` script to update the docker images.

