import cupy
shape = (2, 2, 2, 2, 2, 2, 2)
axis = (1, 3, 4, 6)
a = cupy.zeros(shape, dtype=cupy.float32)
c = cupy.sum(a, axis=axis, keepdims=True)
Traceback (most recent call last):
File "a.py", line 5, in <module>
c = cupy.sum(a, axis=axis, keepdims=True)
File "/home/imanishi/cupy1/cupy/math/sumprod.py", line 34, in sum
return a.sum(axis, dtype, out, keepdims)
File "cupy/core/core.pyx", line 859, in cupy.core.core.ndarray.sum
cpdef ndarray sum(self, axis=None, dtype=None, out=None, keepdims=False):
File "cupy/core/core.pyx", line 867, in cupy.core.core.ndarray.sum
return _math._ndarray_sum(self, axis, dtype, out, keepdims)
File "cupy/core/_routines_math.pyx", line 101, in cupy.core._routines_math._ndarray_sum
return _sum_auto_dtype(self, axis, dtype, out, keepdims)
File "cupy/core/_reduction.pyx", line 409, in cupy.core._reduction._SimpleReductionKernel.__call__
return self._call(
File "cupy/core/_reduction.pyx", line 329, in cupy.core._reduction._AbstractReductionKernel._call
func.linear_launch(
File "cupy/cuda/function.pyx", line 187, in cupy.cuda.function.Function.linear_launch
_launch(
File "cupy/cuda/function.pyx", line 154, in cupy.cuda.function._launch
driver.launchKernel(
File "cupy/cuda/driver.pyx", line 299, in cupy.cuda.driver.launchKernel
check_status(status)
File "cupy/cuda/driver.pyx", line 124, in cupy.cuda.driver.check_status
raise CUDADriverError(status)
cupy.cuda.driver.CUDADriverError: CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES: too many resources requested for launch
Reduction routines become to fail in some cases after #2920 was merged.
Reproducer:
Traceback of the error: