Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions .github/workflows/gpuzipy-wheels.yml

This file was deleted.

123 changes: 123 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Release

# One GitHub Release per version tag (e.g. 2.1.1), covering both GPUZIP flavours:
# - Python: GPUZIPy manylinux CUDA 12 wheels (no GPU needed to compile) + sdist.
# - C++: the header-only library (src/) and the standalone example, as a tarball.
# PRs touching the Python bindings and manual runs only build; wheels are kept as
# workflow artifacts.
#
# To release: set `version` in GPUZIPy/setup.py, merge, then
# git tag 2.1.1 && git push origin 2.1.1
# The tag must match the setup.py version. Python users install with:
# pip install gpuzipy --only-binary gpuzipy \
# --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/<tag>

on:
workflow_dispatch:
pull_request:
paths:
- "GPUZIPy/**"
- "src/Compressor/**"
- ".github/workflows/release.yml"
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
check-version:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check tag matches GPUZIPy/setup.py version
run: |
version=$(grep -oP '^\s*version="\K[^"]+' GPUZIPy/setup.py)
if [ "$version" != "$GITHUB_REF_NAME" ]; then
echo "::error::Tag $GITHUB_REF_NAME does not match GPUZIPy/setup.py version $version"
exit 1
fi

wheels:
name: Wheel ${{ matrix.python }}
needs: [check-version]
# check-version is skipped on PRs/manual runs; build anyway unless it failed.
if: ${{ !failure() && !cancelled() }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: [cp310, cp311, cp312, cp313]
steps:
- uses: actions/checkout@v4

# cibuildwheel copies the whole repo into the container; GPUZIPy's CMake build
# reads ../src/Compressor from there.
- uses: pypa/cibuildwheel@v2.23.3
with:
package-dir: GPUZIPy
output-dir: wheelhouse
env:
CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64

- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}
path: wheelhouse/*.whl

sdist:
needs: [check-version]
if: ${{ !failure() && !cancelled() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run build --sdist --outdir dist GPUZIPy
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

cpp:
needs: [check-version]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Package header-only C++ library
run: |
mkdir -p dist
git archive --prefix="gpuzip-$GITHUB_REF_NAME/" \
-o "dist/gpuzip-$GITHUB_REF_NAME-cpp.tar.gz" \
HEAD src standalone-example LICENSE README.md
- uses: actions/upload-artifact@v4
with:
name: cpp
path: dist/*.tar.gz

release:
if: startsWith(github.ref, 'refs/tags/')
needs: [wheels, sdist, cpp]
runs-on: ubuntu-latest
permissions:
contents: write # GitHub Release
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
body: |
## Python (GPUZIPy)
Prebuilt CUDA 12 wheels for Linux x86_64, Python 3.10-3.13 (GPUs sm_70 to sm_90):
```sh
pip install gpuzipy --only-binary gpuzipy \
--find-links https://github.com/${{ github.repository }}/releases/expanded_assets/${{ github.ref_name }}
```

## C++ (header-only)
`gpuzip-${{ github.ref_name }}-cpp.tar.gz` contains the library (`src/`) and the
standalone example. Add `src/Compressor/include` and/or `src/Prefetch/include` to
your include path.
18 changes: 12 additions & 6 deletions GPUZIPy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ Input/output buffers are raw GPU device pointers (e.g. from [CuPy](https://cupy.

## Install

Prebuilt wheels (Linux x86_64, Python 3.10-3.13, CUDA 12, GPUs from Volta/sm_70 to Hopper/sm_90):
Prebuilt wheels (Linux x86_64, Python 3.10-3.13, CUDA 12, GPUs from Volta/sm_70 to Hopper/sm_90)
are attached to the [GitHub Releases](https://github.com/LSC-Unicamp/GPUZIP/releases):

```sh
pip install gpuzipy
pip install gpuzipy --only-binary gpuzipy \
--find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/2.1.0
```

pip picks the wheel matching your Python version. `--only-binary` stops it from picking
GitHub's auto-generated source archive listed on the same page.

Only an NVIDIA driver supporting CUDA 12 is needed; nvcomp (Bitcomp), cuZFP and cuSZp are bundled.

### Build from source
Expand Down Expand Up @@ -51,10 +56,11 @@ With it, results land directly in `GPUZIPy/example/output/` on the host.

## Releasing wheels

`.github/workflows/gpuzipy-wheels.yml` builds the wheels with cibuildwheel (config in
`pyproject.toml`). Bump `version` in `setup.py`, then push a matching tag, e.g.
`git tag gpuzipy-v0.0.2 && git push origin gpuzipy-v0.0.2`, to publish a GitHub Release and
upload to PyPI.
`.github/workflows/release.yml` builds the wheels with cibuildwheel (config in
`pyproject.toml`). Bump `version` in `setup.py`, merge, then push a matching tag, e.g.
`git tag 2.1.1 && git push origin 2.1.1`. This creates one GitHub Release with the Python
wheels and the C++ header-only package. Then update the `--find-links` tag above and in the
example notebook.

## License

Expand Down
4 changes: 2 additions & 2 deletions GPUZIPy/example/GPUZIPy_Example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"outputs": [],
"source": [
"# Prebuilt CUDA 12 wheel (Linux x86_64, Python 3.10-3.13): no compilation needed.\n",
"!pip install gpuzipy\n",
"# Prebuilt CUDA 12 wheel from the GitHub Release (Linux x86_64, Python 3.10-3.13): no compilation needed.\n",
"!pip install gpuzipy --only-binary gpuzipy --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/2.1.0\n",
"\n",
"# Alternatively, build from source (~7 min on Colab):\n",
"# !git clone https://github.com/LSC-Unicamp/GPUZIP.git && cd GPUZIP/GPUZIPy && pip install ."
Expand Down
2 changes: 1 addition & 1 deletion GPUZIPy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=64", "wheel", "cmake>=3.22", "pybind11>=2.11"]
build-backend = "setuptools.build_meta"

# Release wheels: built with cibuildwheel inside manylinux_2_28 (AlmaLinux 8) with the
# CUDA toolkit installed. See .github/workflows/gpuzipy-wheels.yml.
# CUDA toolkit installed. See .github/workflows/release.yml.
[tool.cibuildwheel]
build = "cp310-* cp311-* cp312-* cp313-*"
skip = "*-musllinux_*"
Expand Down
2 changes: 1 addition & 1 deletion GPUZIPy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def make_release_tree(self, base_dir, files):
# logic and declaration, and simpler if you include description/version in a file.
setup(
name="gpuzipy",
version="0.0.1",
version="2.1.0",
author="Thiago Maltempi",
author_email="maltempi@ic.unicamp.br",
description="Python bindings for GPUZIP's GPU compression layer (Bitcomp, cuZFP, cuSZp).",
Expand Down
Loading