Skip to content

Feature/task bench support#6876

Merged
hkaiser merged 18 commits into
TheHPXProject:masterfrom
guptapratykshh:feature/task_bench_support
Jul 12, 2026
Merged

Feature/task bench support#6876
hkaiser merged 18 commits into
TheHPXProject:masterfrom
guptapratykshh:feature/task_bench_support

Conversation

@guptapratykshh

@guptapratykshh guptapratykshh commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #4274

Proposed Changes

  • Added a new example examples/task_bench/ that builds the HPX task-bench drivers from the upstream task-bench repository (StanfordLegion/task-bench) via CMake FetchContent. No task-bench source files are vendored in this PR — everything is fetched from upstream.
  • Two binaries are built:
    • hpx_fork_join — fork-join executor for intra-node parallelism (no MPI required)
    • hpx_distributed — default parallel executor + MPI for inter-node parallelism (built only when MPI is found)
  • Added a new option HPX_WITH_EXAMPLES_TASKBENCH (default OFF) that gates the example. Users must explicitly enable it (-DHPX_WITH_EXAMPLES_TASKBENCH=ON) to build task-bench alongside HPX.
  • The example is automatically skipped on Windows (POSIX-only dependency in task-bench's core/ library) and when HPX_WITH_DISTRIBUTED_RUNTIME=OFF.

Any background context you want to provide?

Checklist

Not all points below apply to all pull requests.

  • I have added a new feature and have added tests to go along with it.
  • I have fixed a bug and have added a regression test.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

@StellarBot

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch 9 times, most recently from 8b98668 to 76253cb Compare February 4, 2026 11:04

@hkaiser hkaiser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@guptapratykshh Did you implement the HPX version of task_bench?

@guptapratykshh

Copy link
Copy Markdown
Contributor Author

Yes, i am working on HPX implementation, utilizing hpx::execution::experimental::fork_join_executor to efficiently handle intra node parallelism for task graph

@hkaiser

hkaiser commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Yes, i am working on HPX implementation, utilizing hpx::execution::experimental::fork_join_executor to efficiently handle intra node parallelism for task graph

Thanks! The only thing I'm unsure of is whether we really should add the whole task_bench code base to our repository. Wouldn't it be better to upstream your changes to them?

@guptapratykshh

Copy link
Copy Markdown
Contributor Author

@hkaiser, you are right, i have upstreamed the implementation to task bench - StanfordLegion/task-bench#101
once that is merged, i will update this pr to remove duplicated task bench code from HPX and add minimal example that uses task bench as an external dependency

@hkaiser hkaiser added this to the 2.0.0 milestone Mar 28, 2026
@hkaiser

hkaiser commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

@guptapratykshh I'm going to close this without merging. Please re-open if you feel that we will pursue this PR any further.

@hkaiser hkaiser closed this Mar 28, 2026
@guptapratykshh

Copy link
Copy Markdown
Contributor Author

@hkaiser now we should re-open this PR as this StanfordLegion/task-bench#101 is merged as well as the race condition(StanfordLegion/task-bench#94 (comment)) has also been fixed in that PR

@hkaiser hkaiser reopened this Apr 14, 2026
@hkaiser

hkaiser commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

@guptapratykshh when pushing to this PR, please remove the task-bench code by force-pushing to remove it completely from the git history.

@codacy-production

codacy-production Bot commented Apr 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch from e014ade to 464f5de Compare April 14, 2026 16:45
@guptapratykshh guptapratykshh changed the title [Draft] [WIP] Feature/task bench support Feature/task bench support Apr 14, 2026
@guptapratykshh guptapratykshh marked this pull request as ready for review April 14, 2026 16:50
Copilot AI review requested due to automatic review settings April 14, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds TaskBench benchmark support to the HPX examples by integrating an external TaskBench checkout and building HPX TaskBench driver executables as part of the examples build.

Changes:

  • Introduces examples/task_bench CMake logic that fetches TaskBench and builds the core library + HPX driver executables.
  • Adds task_bench to the top-level examples subdirectory list so it is built when examples are enabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
examples/task_bench/CMakeLists.txt Fetches upstream TaskBench and defines build targets for TaskBench core + HPX drivers.
examples/CMakeLists.txt Registers task_bench as an examples subdirectory.

Comment thread examples/task_bench/CMakeLists.txt Outdated
Comment thread examples/task_bench/CMakeLists.txt Outdated
Comment thread examples/task_bench/CMakeLists.txt Outdated
Comment thread examples/task_bench/CMakeLists.txt
Comment thread examples/CMakeLists.txt
Comment thread examples/task_bench/CMakeLists.txt
Comment thread examples/task_bench/CMakeLists.txt Outdated
Comment thread examples/task_bench/CMakeLists.txt Outdated
Copilot AI review requested due to automatic review settings April 14, 2026 17:37
@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch from 20c5f35 to 302334a Compare April 14, 2026 17:37
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
Copilot AI review requested due to automatic review settings July 9, 2026 18:03
@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch from da55791 to beb2d61 Compare July 9, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@guptapratykshh guptapratykshh requested a review from Copilot July 9, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp (1)

142-165: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

F/post_impl/async_impl are effectively restricted to raw function pointers, not arbitrary callables.

The public post/async_execute templates are generic over F&&, but post_impl/async_impl only accept R (*)(Params...) function pointers (needed for detail::dispatch_helper). Passing a lambda or std::function will fail template deduction with a generic "no matching function" error rather than a clear diagnostic. This is pre-existing behavior carried over from the previous naming, not a regression, but worth a doc note if callers outside this refactor start passing non-pointer callables.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp` around lines
142 - 165, The generic public templates `post` and `async_execute` currently
forward to `post_impl` and `async_impl`, which only accept raw function pointers
via `detail::dispatch_helper`, so non-pointer callables like lambdas or
`std::function` will fail with an unclear deduction error. Add an explicit note
or constraint near `post_impl`/`async_impl` (and the public wrappers if needed)
that these paths only support plain CUDA function pointers, and prefer a clear
compile-time diagnostic or documentation to steer callers toward the supported
signature.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp`:
- Around line 142-165: The generic public templates `post` and `async_execute`
currently forward to `post_impl` and `async_impl`, which only accept raw
function pointers via `detail::dispatch_helper`, so non-pointer callables like
lambdas or `std::function` will fail with an unclear deduction error. Add an
explicit note or constraint near `post_impl`/`async_impl` (and the public
wrappers if needed) that these paths only support plain CUDA function pointers,
and prefer a clear compile-time diagnostic or documentation to steer callers
toward the supported signature.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55ff7c32-765c-444b-8e72-bceaf7b618e3

📥 Commits

Reviewing files that changed from the base of the PR and between 4f369cf and da55791.

📒 Files selected for processing (7)
  • CMakeLists.txt
  • examples/CMakeLists.txt
  • examples/task_bench/CMakeLists.txt
  • libs/core/async_cuda/include/hpx/async_cuda/cublas_executor.hpp
  • libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp
  • libs/core/async_cuda/include/hpx/async_cuda/transform_stream.hpp
  • libs/core/async_cuda/tests/unit/transform_stream.cu
✅ Files skipped from review due to trivial changes (1)
  • examples/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (2)
  • CMakeLists.txt
  • examples/task_bench/CMakeLists.txt

@guptapratykshh

Copy link
Copy Markdown
Contributor Author

@hkaiser I ran a configure sanity check for the example. After enabling HPX_WITH_EXAMPLES_TASKBENCH and allowing HPX to fetch its missing dependencies, examples/task_bench configured cleanly, and hpx_fork_join built successfully against local TaskBench checkout

@hkaiser

hkaiser commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Should we add building and running this example to one of the CIs?

@guptapratykshh

Copy link
Copy Markdown
Contributor Author

yes,i think build coverage in CI would be a good idea. for the default matrix,i did start with taskbench build job plus a small hpx_fork_join smoke test. i will keep distributed hpx_distributed run in a separate or nightly CI job

@hkaiser

hkaiser commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

@hkaiser I ran a configure sanity check for the example. After enabling HPX_WITH_EXAMPLES_TASKBENCH and allowing HPX to fetch its missing dependencies, examples/task_bench configured cleanly, and hpx_fork_join built successfully against local TaskBench checkout

I think you could add it to one of the existing github CIs.

Copilot AI review requested due to automatic review settings July 11, 2026 19:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/linux_debug_fetch_boost.yml (1)

26-37: 🧹 Nitpick | 🔵 Trivial

Note: additional network dependency on external task-bench fetch.

This job now fetches Boost, Asio, and (via HPX_WITH_EXAMPLES_TASKBENCH=ON) upstream StanfordLegion/task-bench sources during configure, all over the network in CI. Consider whether the upstream FetchContent call pins a specific tag/commit (reviewed in another layer) and whether retry/caching is warranted here to reduce CI flakiness from an additional external fetch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/linux_debug_fetch_boost.yml around lines 26 - 37, Review
the CMake configuration enabled by HPX_WITH_EXAMPLES_TASKBENCH=ON and pin the
task-bench FetchContent dependency to a reviewed tag or commit rather than an
unversioned upstream source. Add appropriate retry or caching support for this
additional network fetch while preserving the existing task-bench example build.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/linux_debug_fetch_boost.yml:
- Around line 26-37: Review the CMake configuration enabled by
HPX_WITH_EXAMPLES_TASKBENCH=ON and pin the task-bench FetchContent dependency to
a reviewed tag or commit rather than an unversioned upstream source. Add
appropriate retry or caching support for this additional network fetch while
preserving the existing task-bench example build.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0bb99ee1-76bf-4ef3-b225-d1143a80fc39

📥 Commits

Reviewing files that changed from the base of the PR and between beb2d61 and 3ef23ff.

📒 Files selected for processing (2)
  • .github/workflows/linux_debug_fetch_boost.yml
  • examples/task_bench/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/task_bench/CMakeLists.txt

Copilot AI review requested due to automatic review settings July 11, 2026 20:12
@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch from 3ef23ff to c447060 Compare July 11, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
Copilot AI review requested due to automatic review settings July 11, 2026 20:30
@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch from c447060 to 3f66cb8 Compare July 11, 2026 20:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 12, 2026 06:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch from 767e3cf to 29b9176 Compare July 12, 2026 06:16
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
Copilot AI review requested due to automatic review settings July 12, 2026 06:38
@guptapratykshh guptapratykshh force-pushed the feature/task_bench_support branch from 29b9176 to 3ad67cd Compare July 12, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hkaiser hkaiser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

You may want to consider to upstream changes that fix the deprecation warnings on their end.

@hkaiser hkaiser merged commit f2ded23 into TheHPXProject:master Jul 12, 2026
93 of 101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Task-Bench (potentially as a GSoC project)

4 participants