-
-
Notifications
You must be signed in to change notification settings - Fork 491
Integrating thrust into HPX #6744
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
base: master
Are you sure you want to change the base?
Conversation
This commit adds a basic poc implementation for thrust policy and algorithm dispatch based on it
|
Can one of the admins verify this patch? |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work on this!
libs/core/async_cuda/include/hpx/async_cuda/thrust/algorithms.hpp
Outdated
Show resolved
Hide resolved
libs/core/async_cuda/include/hpx/async_cuda/thrust/algorithms.hpp
Outdated
Show resolved
Hide resolved
libs/core/async_cuda/include/hpx/async_cuda/thrust/detail/algorithm_map.hpp
Outdated
Show resolved
Hide resolved
libs/core/async_cuda/include/hpx/async_cuda/thrust/detail/algorithm_map.hpp
Outdated
Show resolved
Hide resolved
libs/core/async_cuda/include/hpx/async_cuda/thrust/algorithms.hpp
Outdated
Show resolved
Hide resolved
libs/core/async_cuda/include/hpx/async_cuda/thrust/algorithms.hpp
Outdated
Show resolved
Hide resolved
Add par_nosync execution policy support which allows async execution , leveraging exiting async_cuda infrastructure and add tag invoke policy branching
|
Thank you for the review @hkaiser , i pushed another commit which is a lot more representative of current state and i have made a lot of changes , the previous commit was outdated and an intial proof of concept draft . Also i am still adding algorithms in algorithm_map along with cmake checks I will incorporate the general feedback mentioned above in the forthcoming commit here but if you could look at the implementation logic and see if we could make any improvements here . I will include that as well Also @Pansysk75 and i were pondering on weather we should move thrust implementations to its own directory from async_commit since it might be confusing as all of thrust isnt 'async' . Would love your opinion here |
Yes, turning this into a separate HPX module (e.g., |
libs/core/async_cuda/include/hpx/async_cuda/thrust/algorithms.hpp
Outdated
Show resolved
Hide resolved
libs/core/async_cuda/include/hpx/async_cuda/thrust/algorithms.hpp
Outdated
Show resolved
Hide resolved
libs/core/async_cuda/include/hpx/async_cuda/thrust/algorithms.hpp
Outdated
Show resolved
Hide resolved
|
thrust implementation depends on async_cuda for async thrust policy , since we use the target from there to get stream and future while dispatching with par_nosync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks!
| @@ -0,0 +1,603 @@ | |||
| // Copyright (c) 2025 Aditya Sapra | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have preferred for the policies to be derived from the HPX policy base class as this reduces the amount of code duplication considerably. For now, your code is fine. Please consider changing it if there is sufficient time left, however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay let me make another branch with that approach and get it validated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Hartmut Kaiser <[email protected]>
Co-authored-by: Hartmut Kaiser <[email protected]>
|
@hkaiser i made the requested changes and the refactored derive from base changes are on https://github.com/adityacodes30/hpx/tree/policyRefactoring . Let me know if they look fine and i will merge them into this branch. Also i had to add a guard in any_sender since i was getting errors with device compilation through nvcc , ( inline |
|
@adityacodes30 Could you bring this branch up-to-speed with master? Also, could you take care of the clang_format and cmake_format issues? Thanks! |
|
Sure ! |
Integrate HPX algorithms with Nvidia CCCL (Thrust)
This PR implements integration between NVIDIA Thrust and HPX, enabling HPX algorithms to dispatch to GPU-accelerated Thrust implementations through HPX's execution policy system.
Google Summer of Code 2025 Project: HPX-Thrust Integration
Completed Milestones
Phase 1: Foundation Architecture
thrust_policy- Host execution withthrust::hostthrust_device_policy- Device execution withthrust::devicethrust_task_policy- Asynchronous GPU execution with HPX futuresPhase 2: Algorithm Integration
tag_invokeoverload supporting all algorithmsPhase 3: Asynchronous Execution
hpx::future<T>hpx::cuda::experimental::targetthrust::cuda::par_nosyncfor async operationsPhase 4: Testing & Validation
thrust::device_vectorusage patternsPhase 5: Documentation & Examples
Technical Architecture
Core Components
Usage Examples
Files Added
Any background context you want to provide?
Implementation for HPX-Thrust integration. This provides the foundation for Thrust GPU-accelerated parallel algorithms through HPX. This project was part of Google Summer of Code'25
Checklist