numba-dpex icon indicating copy to clipboard operation
numba-dpex copied to clipboard

numpy sum operator (axis) isn't supported

Open mingjie-intel opened this issue 2 years ago • 1 comments

Running into this issue when implementing l2_norm into dpebench:

Here is the code:

@nb.njit(parallel=False, fastmath=True)
def l2_norm(a, d):
    sq = np.square(a)
    sum = sq.sum(axis=1)
    d[:] = np.sqrt(sum)

Here is the error:

KeyError: "Failed in dpex_nopython mode pipeline (step: Rewrite name of Numpy functions to overload already overloaded function)\n'attr'"

It seems axis isn't supported at this moment.

mingjie-intel avatar Oct 03 '22 18:10 mingjie-intel

There are two issues here:

  1. Parfor does not support sum with the axis keyword.
  2. GPU kernel generation for reductions is not yet supported.

@DrTodd13 can you take a look at the first point?

diptorupd avatar Jan 12 '23 21:01 diptorupd