Skip to content

Investigate recent test failures, concurrent with upgrade of DPC++ to 2025.0.1 #1901

Closed

Description

@oleksandr-pavlyk

Consider snippet:

import dpctl.tensor as dpt

def test(n):
    x = dpt.arange(n*n, dtype="f4")
    m = dpt.ones(n*n, dtype="?")
    return dpt.all(x[m] == x)

Then

In [38]: [n for n in range(2, 265) if not test(n)]
Out[38]: [260, 261, 262, 263, 264]

In [39]: [n for n in range(2, 265) if not test(n)]
Out[39]: [256, 258, 259, 260, 261, 262, 263, 264]

In [40]: [n for n in range(2, 265) if not test(n)]
Out[40]: [257, 258, 259, 261, 262, 263]

The result is always empty for dpctl compiled with DPC++ 2025.0.0

Activity

  1. oleksandr-pavlyk commented on Nov 20, 2024

    @oleksandr-pavlyk
    ContributorAuthor

    With

    def test4(n):
        m = dpt.ones(n*n, dtype="?")
        cumsum = dpt.zeros(n*n, dtype="i8")
        q = cumsum.sycl_queue
        q.wait()
        num = dpt._tensor_impl.mask_positions(mask=m, cumsum=cumsum, sycl_queue=q)
        return dpt.asnumpy(cumsum - dpt.arange(1, n*n+1, dtype=cumsum.dtype))

    I get

    In [87]: np.nonzero(test4(257))
    Out[87]: (array([513, 514, 515]),)
    
    In [88]: np.nonzero(test4(256))
    Out[88]: (array([0, 1, 2, 3]),)
    
    In [89]: np.nonzero(test4(255))
    Out[89]: (array([], dtype=int64),)
    
    In [90]: np.nonzero(test4(258))
    Out[90]: (array([1028, 1029, 1030, 1031]),)
    
  2. oleksandr-pavlyk commented on Nov 20, 2024

    @oleksandr-pavlyk
    ContributorAuthor

    The same thing with

    def test5(n):
        m = dpt.ones(n*n, dtype="i8")
        cumsum = dpt.cumulative_sum(m)
        return dpt.asnumpy(cumsum) - np.arange(1, n*n+1, dtype=cumsum.dtype)
    
    v = test5(257)
    ind, = np.nonzero(v)
    print(ind, v[ind])  # outputs [513 514 515] [-514 -515 -516]
  3. oleksandr-pavlyk commented on Nov 20, 2024

    @oleksandr-pavlyk
    ContributorAuthor

    Seem to affect all data types:

    
    In [10]: def test5(n, dt):
        ...:     x = dpt.ones(n*n, dtype=dt)
        ...:     cs = dpt.cumulative_sum(x)
        ...:     return dpt.asnumpy(cs) - np.arange(1, n*n+1, dtype=cs.dtype)
        ...:
    
    In [11]: np.nonzero(test5(257, np.float32))
    Out[11]: (array([513, 514, 515]),)
    
    In [12]: np.nonzero(test5(257, np.uint64))
    Out[12]: (array([513, 514, 515]),)
    
    In [13]: np.nonzero(test5(257, np.int64))
    Out[13]: (array([513, 514, 515]),)
    
  4. added 4 commits that reference this issue on Nov 20, 2024
    596833e
    d79831e
    abb1572
    d133a11
  5. changed the title [-]Investigate test failures with DPC++ 2025.0.1[/-] [+]Investigate recent test failures, concurrent with upgrade of DPC++ to 2025.0.1[/+] on Nov 20, 2024
  6. oleksandr-pavlyk commented on Nov 20, 2024

    @oleksandr-pavlyk
    ContributorAuthor

    This failure is not related to the upgrade in the compiler, rather I introduced it recently by a code change during code maintenance: #1896

  7. added a commit that references this issue on Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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