Hi NVCOMP Team,
I’d like to report a bug that seems straightforward yet unexpected. Since the NVCOMP GitHub repository appears less active, I’m reaching out here instead.
I am running the exact code provided in the NVCOMP Python API documentation. However, I’ve noticed that the datatype in nvcomp.Array
is always set to uint8
, which is incorrect for this use case. The issue arises directly from the nvcomp.Array
, and it disrupts subsequent operations.
Code:
import numpy as np
import cupy as cp
from nvidia import nvcomp
print("nvcomp version:", nvcomp.__version__)
print("nvcomp cuda version:", nvcomp.__cuda_version__)
ascending = np.arange(0, 4096, dtype=np.int32)
nvarr_h = nvcomp.as_array(ascending)
print(ascending.__array_interface__)
print(nvarr_h.__array_interface__)
print(nvarr_h.__cuda_array_interface__)
print(nvarr_h.buffer_size)
print(nvarr_h.buffer_kind)
print(nvarr_h.ndim)
print(nvarr_h.dtype)
print(nvarr_h.shape)
print(nvarr_h.strides)
print(nvarr_h.item_size)
print(nvarr_h.size)
Output:
nvcomp version: 4.1.0
nvcomp cuda version: 12050
{'data': (94855846852368, False), 'strides': None, 'descr': [('', '<i4')], 'typestr': '<i4', 'shape': (4096,), 'version': 3}
{'shape': (4096,), 'strides': None, 'typestr': '|u1', 'data': (94855846852368, False), 'version': 3}
{'shape': (4096,), 'strides': None, 'typestr': '|u1', 'data': (94855846852368, False), 'version': 3, 'stream': 1}
4096
ArrayBufferKind.STRIDED_HOST
1
uint8
(4096,)
(1,)
1
4096
This behavior seems too basic to be a widespread bug, so I’m wondering if it’s specific to my environment. How can I ensure the correct datatype is used?