Skip to content

Return events for comp. tasks, rather than temp-clean up host tasks #1176

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

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

oleksandr-pavlyk
Copy link
Contributor

Return events for computational tasks, rather than temp-clean up host tasks

This resolves a hang that Anton has uncovered. The gist of the bug is

for i in range(op_count):
    v[i] = dpt.empty_like(a[i], order='F', dtype=v_type)

    ht_copy_ev[i], copy_ev = ti._copy_usm_ndarray_into_usm_ndarray(src=a[i], dst=v[i], sycl_queue=a_sycl_queue)

    di._wait(copy_ev)

Here is di is a Pybind11 extensions, whose function _wait was implemented as

   m.def("_wait", [](sycl::event e) -> void { e.wait(); }, "");

The script would hang on the second iteration of the loop if di._wait call. The hang disappears after the change in this commit. Out attempts to build a C++ reproducer have not been successful thus far.

  • 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?

… tasks

This resolves a hang that Anton has uncovered. The gist of the bug is

```
for i in range(op_count):
    v[i] = dpt.empty_like(a[i], order='F', dtype=v_type)

    ht_copy_ev[i], copy_ev = ti._copy_usm_ndarray_into_usm_ndarray(src=a[i], dst=v[i], sycl_queue=a_sycl_queue)

    di._wait(copy_ev)
```

Here is `di` is a Pybind11 extensions, whose function `_wait` was implemented as

```
   m.def("_wait", [](sycl::event e) -> void { e.wait(); }, "");
```

The script would hang on the second iteration of the loop if `di._wait` call.
The hang disappears after the change in this commit. Out attempts to build a C++ reproducer
have not been successful thus far.
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the revert-returning-host-tasks branch from 57ba8e2 to 80f0463 Compare April 18, 2023 17:43
@github-actions
Copy link

@coveralls
Copy link
Collaborator

Coverage Status

Coverage: 83.254%. Remained the same when pulling 80f0463 on revert-returning-host-tasks into b050e8c on master.

@oleksandr-pavlyk
Copy link
Contributor Author

A reproducer for a hang fixed by this PR was filed as JIRA CMPLRLLVM-46895.

@oleksandr-pavlyk oleksandr-pavlyk marked this pull request as ready for review April 18, 2023 21:35
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_115 ran successfully.
Passed: 47
Failed: 787
Skipped: 282

@oleksandr-pavlyk oleksandr-pavlyk merged commit 4e41318 into master Apr 19, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the revert-returning-host-tasks branch April 19, 2023 02:45
@github-actions
Copy link

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

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev0=py310h76be34b_117 ran successfully.
Passed: 120
Failed: 887
Skipped: 109

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_0 ran successfully.
Passed: 120
Failed: 887
Skipped: 109

vtavana pushed a commit that referenced this pull request Apr 24, 2023
Return events for comp. tasks, rather than temp-clean up host tasks
vtavana pushed a commit that referenced this pull request Apr 24, 2023
Return events for comp. tasks, rather than temp-clean up host tasks
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.

3 participants