Skip to content

Closes gh-1250 by fixing stride simplification logic - #1306

Merged
oleksandr-pavlyk merged 1 commit into
masterfrom
fix-gh-1250-stride-simplification
Jul 26, 2023
Merged

oleksandr-pavlyk merged 1 commit into
masterfrom
fix-gh-1250-stride-simplification

Conversation

@oleksandr-pavlyk

@oleksandr-pavlyk oleksandr-pavlyk commented Jul 25, 2023 •

Copy link
Copy Markdown
Contributor

When simplifying iteration space, first consider strides of output array (last stride argument) since output arrays should never have zero strides.

In [4]: from dpctl.tensor._tensor_impl import _contract_iter3

In [5]: sh, st1, st2, st3 = (8192, 8192), (0, 1), (1, 0), (8192, 1) # shape, strides in issue

In [6]: _contract_iter3(sh, st1, st2, st3)
Out[6]: ([8192, 8192], [0, 1], 0, [1, 0], 0, [8192, 1], 0)

In [7]: _contract_iter3(sh, st2, st1, st3)
Out[7]: ([8192, 8192], [1, 0], 0, [0, 1], 0, [8192, 1], 0)
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

When simplifying iteration space, first consider strides
of output array (last stride argument) since output arrays
should never have zero strides.
@github-actions

Copy link
Copy Markdown

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 83.236%. remained the same when pulling cb6797e on fix-gh-1250-stride-simplification into 616c21e on master.

@github-actions

Copy link
Copy Markdown

Array API standard conformance tests for dpctl=0.14.6dev0=py310h7bf5fec_28 ran successfully.
Passed: 478
Failed: 522
Skipped: 119

@ndgrigorian ndgrigorian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested out the branch and didn't catch any regressions, particularly in dpt.where performance.

@npolina4

Copy link
Copy Markdown
Contributor

Thanks! This PR is improve dpbench gpairs performance.

@oleksandr-pavlyk
oleksandr-pavlyk merged commit f9e3014 into master Jul 26, 2023
@oleksandr-pavlyk
oleksandr-pavlyk deleted the fix-gh-1250-stride-simplification branch July 26, 2023 19:25
@github-actions

Copy link
Copy Markdown

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions

Copy link
Copy Markdown

Array API standard conformance tests for dpctl= ran successfully.
Passed: 567
Failed: 433
Skipped: 119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants