Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed simplify_iteration_two_strides, simplify_iteration_three_strides #1054

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

oleksandr-pavlyk
Copy link
Collaborator

The target ordering used to be based on absolute values of the first vector of strides, now it uses lexicographic ordering of tuples of absolute values of all strides involved.

This enables iteration space reduction for examples where all strides in the first vector are all zero, like in the example arising from

dpctl.tensor.full((2,3,4,), dpctl.tensor.asarray(1))

The following two invocations show that iteration space used is 1d:

onetrace -d -v --demangle python -c \
    "import dpctl.tensor as dpt; x = dpt.ones((30, 40, 50), dtype='i4'); y = dpt.empty_like(x, dtype='f4'); y[:] = x"
onetrace -d -v --demangle python -c \
     "import dpctl.tensor as dpt; dpt.full((2,3,4), dpt.asarray(1, dtype='f4'))"
  • 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?

The target ordering used to be based on absolute values of the first
vector of strides, now it uses lexicographic ordering of tuples of
absolute values of all strides involved.

This enables iteration space reduction for examples where all strides
in the first vector are all zero, like in the example arising from

```
dpctl.tensor.full((2,3,4,), dpctl.tensor.asarray(1))
```

The following two invocations show that iteration space used is 1d:

```
onetrace -d -v --demangle python -c "import dpctl.tensor as dpt; x = dpt.ones((30, 40, 50), dtype='i4'); y = dpt.empty_like(x, dtype='f4'); print((x.flags, y.flags)); y[:] = x"
onetrace -d -v --demangle python -c "import dpctl.tensor._tensor_impl as ti, dpctl.tensor as dpt; dpt.full((2,3,4), dpt.asarray(1, dtype='f4'))"
```
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the enhance-iter-space-simplification branch from 1fbe04e to 078493e Compare February 1, 2023 19:42
@github-actions
Copy link

github-actions bot commented Feb 1, 2023

@github-actions
Copy link

github-actions bot commented Feb 1, 2023

Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_56 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

@github-actions
Copy link

github-actions bot commented Feb 1, 2023

Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_52 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

@oleksandr-pavlyk oleksandr-pavlyk merged commit 9e37ecb into master Feb 3, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the enhance-iter-space-simplification branch February 3, 2023 00:33
@github-actions
Copy link

github-actions bot commented Feb 3, 2023

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

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_62 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

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.

1 participant