Hello, we received a feature request to add support for user-provided buffers in the nvCOMP official Python API.
opened 04:04PM - 07 Apr 25 UTC
Currently kvikio contains Cython bindings to the nvcomp C++ library. Now that nv… comp has [an official Python API](https://docs.nvidia.com/cuda/nvcomp/py_api.html) we should consider eventually moving to use that if necessary rather than maintaining our own. However, it is also not clear to me if kvikio needs that at all. kvikio was historically the sole place to access nvcomp APIs from Python, so rather than using nvcomp APIs we were primarily a _source_ for those APIs in other libraries. If that is still the case, we could consider deprecating and removing those bits altogether.
As I understand, KvikIO 25.06 and earlier has bindings to the “low-level” nvCOMP C++ API. As of 4.2.0.11, I believe nvCOMP’s Python API only includes bindings to the “high-level” nvCOMP C++ API.
Some Python users are interested in the finer control that the “low-level” nvCOMP API provides, and this post is intended to document the feature request.
Thank you for your help,
Greg Kimball
References:
KvikIO nvCOMP API, deprecated
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
from typing import Any, Mapping, Optional, Sequence
import cupy as cp
import cupy.typing
from numcodecs.compat import ensure_contiguous_ndarray_like
from kvikio._lib.libnvcomp_ll import SUPPORTED_ALGORITHMS
from kvikio.numcodecs import BufferLike, CudaCodec
class NvCompBatchCodec(CudaCodec):
"""Codec that uses batch algorithms from nvCOMP library.
An algorithm is selected using `algorithm` parameter.
If the algorithm takes additional options, they can be
passed to the algorithm using `options` dictionary.
"""
This file has been truncated. show original
nvCOMP Python API
This feature request is internally documented and will be targeted to a future release.