Skip to content

Migrate host_task object management to a thread pool based approach - #2359

Open
ndgrigorian wants to merge 5 commits into
masterfrom
feature/drop-host-task-object-management
Open

Migrate host_task object management to a thread pool based approach#2359
ndgrigorian wants to merge 5 commits into
masterfrom
feature/drop-host-task-object-management

Conversation

@ndgrigorian

Copy link
Copy Markdown
Collaborator

Inspired by comment in: AdaptiveCpp/AdaptiveCpp#1915

we move away from use of host_task, which enables compatibility with AdaptiveCpp, and fixes long-standing undefined behavior of calling sycl::free from within a host_task. The host_task decrementing the refcount would cause the USMDeleter to be called in its scope, which is undefined behavior under the SYCL spec

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

Inspired by comment in: AdaptiveCpp/AdaptiveCpp#1915

we move away from use of host_task, which enables compatibility with AdaptiveCpp
@ndgrigorian
ndgrigorian force-pushed the feature/drop-host-task-object-management branch from c41755c to bbf7d44 Compare August 10, 2026 18:17
@github-actions

Copy link
Copy Markdown

@coveralls

coveralls commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 74.501% (+0.04%) from 74.462% — feature/drop-host-task-object-management into master

Comment thread dpctl/apis/include/dpctl4pybind11.hpp
Comment thread dpctl/apis/include/dpctl4pybind11.hpp
Comment thread dpctl/apis/include/detail/keep_alive_pool.hpp Outdated
Comment thread dpctl/utils/_order_manager.py
Comment thread docs/doc_sources/api_reference/dpctl/utils.rst Outdated
Comment thread dpctl/apis/include/detail/keep_alive_pool.hpp Outdated
Comment thread dpctl/apis/include/dpctl4pybind11.hpp
Comment thread dpctl/apis/include/detail/keep_alive_pool.hpp
Also change pool getter to avoid any dpctl4pybind11 including extensions from having their own thread pools
@ndgrigorian
ndgrigorian requested a review from antonwolfy August 19, 2026 00:28
Comment thread dpctl/_sycl_queue.pyx
Comment thread dpctl/apis/include/detail/keep_alive_pool.hpp
} // end of namespace detail

template <std::size_t num>
sycl::event keep_args_alive(sycl::queue &q,

@antonwolfy antonwolfy Aug 19, 2026

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.

@vlad-perevezentsev, is that intended in dpnp we are using the local copy of that function dpnp::utils::keep_args_alive instead of dpctl vendored function?

Btw, due to that there is no real impact on dpnp due to that dpctl migration change, except new deprecation wanrnings.

Comment thread docs/doc_sources/beginners_guides/installation.rst
Comment thread dpctl/apis/include/dpctl4pybind11.hpp
Comment thread dpctl/apis/include/dpctl4pybind11.hpp
Comment thread dpctl/_async_dec_ref.hpp
Comment thread dpctl/CMakeLists.txt
Comment thread dpctl/_sycl_queue.pyx
Comment thread dpctl/_async_dec_ref.hpp
Comment thread dpctl/apis/include/dpctl4pybind11.hpp
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