[NVCOMP] Strange Bug/Behavior in NVCOMP Python API

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?

Here are some details about my setup:

  • Server: is a DGX A100:
$ uname -a
Linux dgx01 5.15.0-1042-nvidia #42-Ubuntu SMP Wed Nov 15 20:28:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • GPU: NVIDIA A100 40GB:
Thu Jan 23 17:05:47 2025       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.154.05             Driver Version: 535.154.05   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA A100-SXM4-40GB          On  | 00000000:87:00.0 Off |                    0 |
| N/A   44C    P0              59W / 400W |      3MiB / 40960MiB |      0%      Default |
|                                         |                      |             Disabled |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+
1 Like

I have the same problem.

1 Like