You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The as_strided trick seems to cause some addresses to access invalid memory when using advanced indexing.
The indices must be valid, since the numpy example works, and the basic indexing example works, however the advanced indexing example fails with CUDA_ERROR_ILLEGAL_ADDRESS.
I have used the as_strided version, despite this being an example of the sliding window trick, since I have not yet been able to update to cupy 13 on my system.
To Reproduce
importcupyascpimportnumpyasnpimportcupy_backendsif__name__=='__main__':
n=1000window=256x_np=np.arange(n**2).reshape((n, n))
x_cp=cp.arange(n**2).reshape((n, n))
shape= (n-window+1, n-window+1, window, window)
x_np=np.lib.stride_tricks.as_strided(x_np, shape=shape, strides=2*x_np.strides)
x_cp=cp.lib.stride_tricks.as_strided(x_cp, shape=shape, strides=2*x_cp.strides)
i=43j=744cpu=x_np[i, j]
gpu=x_cp[i, j]
print("Regular indexing: ", np.all(cpu==cp.asnumpy(gpu)))
cpu=x_np[np.array([i]), np.array([j])]
gpu=x_cp[np.array([i]), np.array([j])]
print("Advanced indexing: ", np.all(cpu==cp.asnumpy(gpu)))
# i, j values found through the following search.# for i in range(x_np.shape[0]):# for j in range(x_np.shape[1]):# cpu = x_np[np.array([i]), np.array([j])]# gpu = x_cp[np.array([i]), np.array([j])]# try:# if np.any(cpu != cp.asnumpy(gpu)):# print(i, j, cpu, cp.asnumpy(gpu))# except cupy_backends.cuda.api.runtime.CUDARuntimeError:# print(i, j)# exit(1)
Installation
Conda-Forge (conda install ...)
Environment
OS : Linux-5.4.0-153-generic-x86_64-with-glibc2.31
Python Version : 3.10.13
CuPy Version : 12.3.0
CuPy Platform : NVIDIA CUDA
NumPy Version : 1.26.2
SciPy Version : 1.11.4
Cython Build Version : 0.29.37
Cython Runtime Version : None
CUDA Root : /home/uyy37579/miniconda3/envs/ptyrodactyl
nvcc PATH : None
CUDA Build Version : 11080
CUDA Driver Version : 11040
CUDA Runtime Version : 11040
cuBLAS Version : (available)
cuFFT Version : 10502
cuRAND Version : 10205
cuSOLVER Version : (11, 2, 0)
cuSPARSE Version : (available)
NVRTC Version : (11, 4)
Thrust Version : 101501
CUB Build Version : 101501
Jitify Build Version : d7180e1
cuDNN Build Version : None
cuDNN Version : None
NCCL Build Version : None
NCCL Runtime Version : None
cuTENSOR Version : None
cuSPARSELt Build Version : None
Device 0 Name : NVIDIA A100-PCIE-40GB
Device 0 Compute Capability : 80
Device 0 PCI Bus ID : 0000:04:00.0
Device 1 Name : NVIDIA A100-PCIE-40GB
Device 1 Compute Capability : 80
Device 1 PCI Bus ID : 0000:05:00.0
Additional Information
Possibly related to #4825 but I don't think that this is an issue with how much memory is being used, or it should fail in every case.
The text was updated successfully, but these errors were encountered:
Description
The as_strided trick seems to cause some addresses to access invalid memory when using advanced indexing.
The indices must be valid, since the numpy example works, and the basic indexing example works, however the advanced indexing example fails with
CUDA_ERROR_ILLEGAL_ADDRESS
.I have used the as_strided version, despite this being an example of the sliding window trick, since I have not yet been able to update to cupy 13 on my system.
To Reproduce
Installation
Conda-Forge (
conda install ...
)Environment
Additional Information
Possibly related to #4825 but I don't think that this is an issue with how much memory is being used, or it should fail in every case.
The text was updated successfully, but these errors were encountered: