Skip to content

Commit 1224c60

Browse files
committed
Update PyPI
1 parent d39d9e8 commit 1224c60

File tree

4 files changed

+45
-14
lines changed

4 files changed

+45
-14
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recursive-include cuda *.cu
2+
recursive-include cuda *.cuh

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
# NeuZip: Memory-Efficient Training and Inference with Dynamic Compression of Neural Networks
22

3-
This is the official repository for the paper "NeuZip: Memory-Efficient Training and Inference with Dynamic Compression of Neural Networks".
4-
This repository contains the code for the experiments in the paper.
3+
This is the official repository for the paper [*NeuZip: Memory-Efficient Training and Inference with Dynamic Compression of Neural Networks*](https://arxiv.org/abs/2410.20650). This repository contains the code for the experiments in the paper.
54

65
# Installation
76

8-
First, please install NVComp library on your own. You can find the installation instructions on its [GitHub page](https://github.com/NVIDIA/nvcomp).
7+
## From PyPI
98

10-
Then, you can install the package by running the following command in the root directory of the repository:
9+
We provide a simple way to install the package from PyPI. You can install the package by running the following command:
1110

1211
```bash
12+
pip install neuzip
13+
```
14+
15+
Note that we only upload the source distribution to PyPI. You need to have NVCC correctly installed on your system to compile the package.
16+
17+
## From source
18+
19+
You can also install the package from source, which is useful if you want to modify the code.
20+
21+
```bash
22+
git clone https://github.com/BorealisAI/neuzip
23+
cd neuzip
1324
pip install -e .
1425
```
1526

16-
# Usage
27+
# Basic usage
1728

18-
You can use the `neuzip` package to compress and decompress tensors. Here is an example:
29+
Using `neuzip` for your PyTorch model is pretty easy. Here is a simple example:
1930

20-
```python
21-
import neuzip
22-
manager = neuzip.Manager() # Create a manager
23-
handle = manager.write(tensor) # Compress a tensor
24-
tensor = manager.read(handle) # Decompress a tensor
31+
```diff
32+
model: torch.nn.Module = # your model
33+
+ manager = neuzip.Manager()
34+
+ model = manager.convert(model)
2535
```
2636

27-
# Replicating Experiments
37+
The compressed model can be used in the same way as the original model while consuming less memory.
38+
39+
# Replicating experiments
2840

2941
You can replicate all the experiments in the paper by using the files in the [examples/](examples/) directory. Each file corresponds to one or more experiments in the paper.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "torch", "numpy"]
3+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
import os
99

1010
import torch
11-
from setuptools import setup
11+
from setuptools import find_packages, setup
12+
from torch.torch_version import Version
1213
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
1314

14-
NEUZIP_VERSION = "0.0.1"
15+
NEUZIP_VERSION = "0.1.1"
1516

1617
setup(
1718
name="neuzip",
@@ -33,6 +34,19 @@
3334
],
3435
),
3536
],
37+
install_requires=[
38+
"torch",
39+
"transformers",
40+
"numpy",
41+
f"nvidia-nvcomp-cu{Version(torch.version.cuda).major}",
42+
],
43+
packages=find_packages(),
44+
package_data={
45+
"neuzip._cuda": ["*.cuh", "*.cu"],
46+
},
47+
include_package_data=True,
48+
url="https://github.com/BorealisAI/neuzip",
49+
license="CC BY-NC-SA 4.0",
3650
version=NEUZIP_VERSION,
3751
cmdclass={"build_ext": BuildExtension},
3852
)

0 commit comments

Comments
 (0)