Skip to content

dpctl.tensor.max returns incorrect result when reducing over axis=0 #1455

Closed
@antonwolfy

Description

@antonwolfy

After installing newer dpctl version:

$ conda install dpctl=0.15.1dev0 -c dppy/label/dev --override-channels
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/xantvol/miniconda3/envs/dpnp_dev

  added / updated specs:
    - dpctl=0.15.1dev0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    dpctl-0.15.1dev0           |  py39ha25a700_63        12.2 MB  dppy/label/dev
    ------------------------------------------------------------
                                           Total:        12.2 MB

The following packages will be UPDATED:

  dpctl                          0.15.1dev0-py39ha25a700_42 --> 0.15.1dev0-py39ha25a700_63

the below example with max reduction has been broken:

import numpy, dpctl, dpctl.tensor as dpt

dpctl.__version__
# Out: '0.15.1dev0+63.g03fd73794'

dt = numpy.int32
a = numpy.array([[[-2.0, 3.0], [9.1, 0.2]],
                 [[-2.0, 5.0], [-2, -1.2]],
                 [[1.0, -2.0], [5.0, -1.1]]], dtype=dt)
b = dpt.asarray(a)

numpy.max(a, axis=0)
# Out:
array([[1, 5],
       [9, 0]], dtype=int32)

dpt.max(b, axis=0)
# Out:
usm_ndarray([[9, 5],
             [1, 5]], dtype=int32)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions