-
-
Notifications
You must be signed in to change notification settings - Fork 982
Description
Implement GPU version of numpy.* functions in cupy.* namespace.
This is a tracker issue that lists the remaining numpy.* APIs (see also: comparison table). I've categorized them based on difficulty so that new contributors can pick the right task. Your contribution is highly welcomed and appreciated!
List of APIs
Very Easy
-
numpy.asfarray(Add cupy.asfarray #6085) -
numpy.byte_bounds(hint:ndarray.data.ptr) (Addcupy.byte_bounds#7015) -
numpy.format_float_positional(addedcupy.format_float_positional#6308) -
numpy.format_float_scientific(Addcupy.format_float_scientificAPI #6474) -
numpy.ndarray.searchsorted(added cupy.ndarray.searchsorted #7059) - Alias:
numpy.bool,numpy.long,numpy.ulong(Addcupy.bool,cupy.longandcupy.ulong#9253) - Alias:
numpy.isdtype
Easy
-
numpy.apply_over_axes(Addapply_over_axesAPI #8177) -
numpy.array_equiv(Add array_equiv API. #6254) -
numpy.asarray_chkfinite(Addasarray_chkfiniteAPI. #6275) -
numpy.fabs(Addcupy.fabsAPI. #6282) -
numpy.float_power(added api forcupy.float_power#6371) -
numpy.heaviside(addcupy.heavisideapi. #6798) -
numpy.isneginf(Add cupy.isneginf and cupy.isposinf #6089) -
numpy.isposinf(Add cupy.isneginf and cupy.isposinf #6089) -
numpy.mask_indices(Addcupy.mask_indices#6156) -
numpy.real_if_close(Addcupy.real_if_closeAPI #6475) -
numpy.setdiff1d(Addcupy.setdiff1dapi. #6433) -
numpy.setxor1d(addcupy.setxor1dapi #6582) -
numpy.tril_indices&numpy.tril_indices_from(Addtril_indicesandtril_indices_fromAPI. #6305) -
numpy.triu_indices&numpy.triu_indices_from(Addtriu_indicesandtriu_indices_fromAPI. #6316) -
numpy.union1d(Addcupy.union1dAPI. #6357) -
numpy.bitwise_count(Add function bitwise_count #9390) -
numpy.cumulative_prod -
numpy.cumulative_sum([WIP] Add cumulative_sum #9205) -
numpy.matrix_transpose -
numpy.vecdot -
numpy.linalg.diagonal -
numpy.linalg.matmul -
numpy.linalg.matrix_norm -
numpy.linalg.matrix_transpose -
numpy.linalg.outer -
numpy.linalg.svdvals(Add cupy.linalg.svdvals function #9388) -
numpy.linalg.tensordot -
numpy.linalg.trace -
numpy.linalg.vecdot -
numpy.linalg.vector_norm -
numpy.lib.format.* -
numpy.lib.stride_tricks.sliding_window_view(Provide sliding_window_view #6956, Addcupy.lib.stride_tricks.sliding_window_view#7575) -
numpy.emath.*(numpy.lib.scimath.*) (addcupy.emathmodule #7295)
Medium
-
numpy.block -
numpy.unstack -
numpy.delete(Implement delete function, add documentation #7359) -
numpy.geomspace(Implement numpy.geomspace #9082) -
numpy.insert(addcupy.insertapi #6597) -
numpy.put_along_axis(addcupy.put_along_axisAPI #8199) -
numpy.row_stack(Addcupy.row_stackAPI. #6312) -
numpy.spacing -
numpy.vander(Addcupy.vanderAPI. #6279) -
numpy.linalg.eig(Implement cupy.linalg.eig / cupy.linalg.eigvals clone of PR #8854 #8980) -
numpy.linalg.eigvals(Implement cupy.linalg.eig / cupy.linalg.eigvals clone of PR #8854 #8980)
Medium to Hard
-
numpy.histogram_bin_edges -
numpy.ediff1d(Addcupy.ediff1dAPI. #6280) -
numpy.intersect1d(Addcupy.intersect1dAPI. #6402, Addcupy.intersect1dAPI #6407) -
numpy.nanpercentile -
numpy.nanquantile -
numpy.ndarray.ctypes(note: needs design discussion) -
numpy.ndarray.getfield -
numpy.ndarray.resize -
numpy.ndarray.setfield -
numpy.polynomial.* -
numpy.poly(Addcupy.poly#3547, Addcupy.poly#6697) -
numpy.polyder(Addcupy.polyderAPI. #6469) -
numpy.polydiv(Addcupy.polydiv#3780) -
numpy.polyint -
numpy.trapz(Addcupy.trapz#6107) -
numpy.linalg.cond(Implement cupy.linalg.cond #9140) -
numpy.linalg.multi_dot(Addlinalg.multi_dotAPI. #6358) -
numpy.random.Generator.*(see the dedicated tracker issue for details: [Tracker] Add random distributions to new Generator #4557)
Low priority
Iterator functions
-
numpy.ndenumerate -
numpy.nditer -
numpy.nested_iters
Help functions
-
numpy.info -
numpy.lookfor -
numpy.source
Internal functions
-
numpy.deprecate -
numpy.deprecate_with_doc
Dtype APIs - need to filter types unsupported by CuPy
-
numpy.maximum_sctype -
numpy.cast(undocumented API) (hint: seenumpy/core/numerictypes.py) -
numpy.typecodes(undocumented API) -
numpy.sctypeDict(undocumented API) -
numpy.sctypes(undocumented API) -
numpy.nbytes(undocumented API)
Rarely used APIs
-
numpy.einsum_path(Addcupy.einsum_path#6723) -
numpy.frompyfunc(maybe just call GUFunc?)
Steps to Contribute
Note: You will need a GPU environment to develop CuPy.
-
Fork and star ⭐ the CuPy repository 😉
-
Pick a function you want to work on. Check out the NumPy API Reference to understand what should be implemented. Please search for pull requests before start working on, somebody may have opened a PR already.
-
Implement a function in your branch. If you need help, join Gitter or just ask for help in this issue.
-
Implement test code.
-
Build CuPy and run tests to confirm that the function runs fine:
pip install --no-build-isolation -e . && pytest tests/cupy_tests/PATH_TO_YOUR_TEST
See the Contribution Guide for details. -
Submit a pull-request to the
mainbranch. (example: Implement cupy.linalg.cond #9140)
See also: