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

Resolve crash identified in backend implementation of dpnp.choose #2063

Merged
merged 9 commits into from
Sep 19, 2024

Conversation

antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Sep 18, 2024

The PR resolves crash in dpnp.choose observing in internal CI/CD flow on PVC machine with Linux OS.

The issue was caused by missing dependency of temporary allocated device memory on a computing event. Thus the memory was released before the execution kernel completes work,
While allocation of temporary memory was implicit, because DPNPC_ptr_adapter constructor identified the input pointer choices1 as of unknown USM allocation type. And it was valid classification, since the pointer was allocated in host memory for holding a list of pointers on arrays in device memory.

The change assumes to request explicit memory transfer for choices1 pointer from host to device memory and to add a dependency from the temporary allocated device memory on the event from the submitted kernel.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to 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 filing the PR as a draft?

@antonwolfy antonwolfy self-assigned this Sep 18, 2024
Copy link
Contributor

github-actions bot commented Sep 18, 2024

View rendered docs @ https://intelpython.github.io/dpnp/index.html

@antonwolfy antonwolfy marked this pull request as ready for review September 19, 2024 10:21
@antonwolfy antonwolfy changed the title Add a protection thorugh extra memory copy in backend implementation of dpnp.choose Resolve crash identified in backend implementation of dpnp.choose Sep 19, 2024
Copy link
Collaborator

@vtavana vtavana left a comment

Choose a reason for hiding this comment

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

Thank you, @antonwolfy!

@vtavana vtavana merged commit a6b8010 into master Sep 19, 2024
39 of 46 checks passed
@vtavana vtavana deleted the resolve-crash-in-dpnp.choose branch September 19, 2024 22:25
vtavana pushed a commit that referenced this pull request Sep 19, 2024
…2063)

* Add memory copy to device memory

* Keep extra memcopy only for the result array

* Add missing memory copy from host to device memory

* Applied pre-commit formatting

* Updated changelog

* Add empty line in changelog

* Correct the description of issue in changelog
@vtavana vtavana mentioned this pull request Sep 19, 2024
6 tasks
github-actions bot added a commit that referenced this pull request Sep 19, 2024
…2063)

* Add memory copy to device memory

* Keep extra memcopy only for the result array

* Add missing memory copy from host to device memory

* Applied pre-commit formatting

* Updated changelog

* Add empty line in changelog

* Correct the description of issue in changelog a6b8010
github-actions bot added a commit that referenced this pull request Sep 19, 2024
antonwolfy added a commit that referenced this pull request Sep 20, 2024
…2063) (#2068)

* Add memory copy to device memory

* Keep extra memcopy only for the result array

* Add missing memory copy from host to device memory

* Applied pre-commit formatting

* Updated changelog

* Add empty line in changelog

* Correct the description of issue in changelog

Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
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.

2 participants