Metadata-Version: 2.4
Name: streamlz
Version: 3.3.0rc1
Summary: GPU LZ77 codec (CUDA + Vulkan) that decodes 2-3x faster than nvCOMP at equal or better ratio
Author: StreamLZ Contributors
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/StreamLZ/Compressor-GPU
Project-URL: Changelog, https://github.com/StreamLZ/Compressor-GPU/blob/main/CHANGELOG.md
Keywords: compression,gpu,cuda,vulkan,lz77,codec
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Archiving :: Compression
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Dynamic: license-file

# streamlz

GPU LZ77 codec with CUDA and Vulkan backends. Decodes 2-3x faster than
nvCOMP at equal or better compression ratio.

```bash
pip install streamlz
```

```python
import streamlz

c = streamlz.Compressor()            # CUDA if present, else Vulkan
frame = c.compress(data, level=5)
back  = c.decompress(frame)
assert back == data
```

One `Compressor` handles both directions. Six levels: L1 for speed, L5
for density, L6 adds a word-replacing transform for text.

## Backends

Both produce byte-identical frames, so a frame written by one decodes on
the other.

```python
streamlz.available_backends()          # e.g. ['cuda', 'vulkan']
c = streamlz.Compressor(backend="vulkan")

from streamlz import cuda, vulkan      # or import one directly
```

| Backend | Needs |
|---|---|
| CUDA | NVIDIA driver, compute capability 8.0+ (RTX 30-series and up) |
| Vulkan | Vulkan 1.2+ device with subgroup size 32: NVIDIA Turing+, AMD RDNA1+, Intel UHD/Iris/Arc |

Neither needs a CUDA Toolkit or Vulkan SDK installed - the shared
libraries ship in the wheel and only the driver is required at runtime.
There is no CPU fallback: no GPU means no codec.

## Device-to-device

Callers already holding GPU memory can skip the host round trip
entirely, which is where the headline throughput lives:

```python
c.compress_d2d(d_src, src_size, d_dst, dst_capacity, level=5)
c.decompress_d2d(d_frame, frame_size, d_dst, dst_capacity)
```

## Notes

The first run on a new machine compiles the embedded GPU kernels for
your card and the driver caches the result - about 140 ms cached
against roughly 3.5 seconds uncached. In a container or CI runner where
that cache cannot persist, point `CUDA_CACHE_PATH` at a writable
directory that survives between runs.

Apache 2.0. Source, benchmarks and the wire-format spec:
https://github.com/StreamLZ/Compressor-GPU
