This is the release note of v5.0.0b4. See here for the complete list of solved issues and merged PRs.
Highlights
- CuPy starts supporting
__cuda_array_interface__, which is the CUDA array interchange interface compatible with Numba>=0.39.0. It means you can now pass CuPy arrays to kernels JITed with Numba. The folowing is a simple example code borrowed from numba/numba#2860:
import cupy
from numba import cuda
@cuda.jit
def add(x, y, out):
start = cuda.grid(1)
stride = cuda.gridsize(1)
for i in range(start, x.shape[0], stride):
out[i] = x[i] + y[i]
a = cupy.arange(10)
b = a * 2
out = cupy.zeros_like(a)
print(out) # => [0 0 0 0 0 0 0 0 0 0]
add[1, 32](a, b, out)
print(out) # => [ 0 3 6 9 12 15 18 21 24 27]- Improved performance.
- Implemented
cumsumandcumprodtondarray. - Implemented
cupy.allclose - Enhanced cuDNN RNN functionality including FP16 support.
New Features
- Implement
__cuda_array_interface__(#1144, thanks @seibert!) - Support FP16 and FP64 in cuDNN RNN related functions (#1471)
- Implement
<t>tpttrand<t>trttpof cuBLAS (#1492) - Add
cumsumandcumprodtondarray(#1500) - Add
cupyx.scipy.get_array_module(#1513) - Implement
cupy.allclose(#1522, thanks @tsurumeso!) - Add
mem_infotoDevice(#1538, thanks @larsoner!)
Enhancements
- Avoid keeping
Deviceobject inMemoryandMemoryPointer(#946) - Speed up ElementwiseKernel launch (#1318)
- Improve memory allocation performance (#1343)
- Fix styles for latest autopep8 (#1352)
- Use CScalar in elementwise and reduction (#1447)
- Define
ndarray.__iter__(#1449) - Move
cupy.sparsetocupyx.scipy.sparse(#1451) - Support negative indices in
array_split(#1454) - Avoid
collections.sequence(#1456) - Avoid variable name
lto follow pep8 (#1460) - Simplify
nonzerofunction (#1487) - Use TensorCore for matmul with fp32 matrixes (#1493)
- Support
nonzerofor complex types (#1501) - Change type checking rules of Fusion ufuncs (#1507)
- Fix minor issues on coding style (#1509)
- Fix errors in NumPy 1.15 (#1514)
- Use
collections.abcto avoid DeprecationWarning in Python 3.7 (#1515) - Support
loop_prepin ufunc (#1537) - Add
_has_memory_hooksto avoid thread local dictionary operation (#1540) - Add specialized CUDA kernel for
fillfunction (#1541) - Improve ndarray creation performance (#1542)
- Use xorshift128 to reduce global memory access (#1546)
- Add cdef and cpdef for better cythonize
core.pyx(#1548)
Bug Fixes
- Fix errors on 0-sized inputs (#1459)
- Use
cython.no_gcto avoid memory leak (#1463) - Fix
cupy.random.dirichletto behave same asnumpy.random.dirichlet(#1468) - Fix indexing behavior when input is zero-sized array (#1503)
- Fix
cupy.realandcupy.imag(#1504) - Avoid compile error in old GCC (CentOS 6) (#1506)
- Fix thrust memory allocation problem (#1511)
- Fix dtype order of
create_comparison(#1551) - Raise error when trying to broadcast
out_paramsin ElementwiseKernel (#1552)
Documentation
- Add upgrade guide for
cupyxnamespaces (#1467) - Fix docstring about
free_all_free(#1519) - Update agnostic code tutorial (#1521, thanks @w-m!)