Skip to content

Migrate from thrust::tuple to cuda::std::tuple#5226

Merged
rapids-bot[bot] merged 3 commits into
rapidsai:branch-25.10from
ChuckHastings:migrate_thrust_tuple_to_cuda_std_tuple
Aug 14, 2025
Merged

Migrate from thrust::tuple to cuda::std::tuple#5226
rapids-bot[bot] merged 3 commits into
rapidsai:branch-25.10from
ChuckHastings:migrate_thrust_tuple_to_cuda_std_tuple

Conversation

@ChuckHastings
Copy link
Copy Markdown
Collaborator

CCCL has deprecated use of thrust::tuple, this PR eliminates references to thrust::tuple and thrust::make_tuple. It also eliminates the use of make_tuple with thrust::make_zip_iterator, as this is no longer required.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Aug 13, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ChuckHastings ChuckHastings marked this pull request as ready for review August 13, 2025 05:21
@ChuckHastings ChuckHastings requested a review from a team as a code owner August 13, 2025 05:21
@ChuckHastings ChuckHastings self-assigned this Aug 13, 2025
@ChuckHastings ChuckHastings added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 13, 2025
if (group_lasts[i] - group_firsts[i] == 2) {
auto kv_pair_first =
thrust::make_zip_iterator(thrust::make_tuple(key_firsts[i], value_firsts[i]));
thrust::make_zip_iterator(cuda::std::make_tuple(key_firsts[i], value_firsts[i]));
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.

cuda::std::make_tuple here is unnecessary.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Guess I missed a few... will fix.

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.

Just for curiosity, is this you missing a few or cursor missing a few?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Cursor missed these, although I think it didn't check the include directory. I asked it to list all cases where thrust::make_zip_iterator and either thrust::make_tuple or cuda::std::make_tuple together. It offered a list that only contained things in src and test directory.

auto kv_pair_first = thrust::make_zip_iterator(thrust::make_tuple(key_first, value_first));
auto output_chunk_first = thrust::make_zip_iterator(thrust::make_tuple(
auto kv_pair_first = thrust::make_zip_iterator(cuda::std::make_tuple(key_first, value_first));
auto output_chunk_first = thrust::make_zip_iterator(cuda::std::make_tuple(
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.

cuda::std::make_tuple here is unnecessary.

auto num_chunks = (num_elements + max_elements_per_iteration - 1) / max_elements_per_iteration;
auto kv_pair_first = thrust::make_zip_iterator(thrust::make_tuple(key_first, value_first));
auto output_chunk_first = thrust::make_zip_iterator(thrust::make_tuple(
auto kv_pair_first = thrust::make_zip_iterator(cuda::std::make_tuple(key_first, value_first));
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.

cuda::std::make_tuple here is unnecessary.

rmm::device_uvector<size_t> d_tx_value_counts(d_tx_dst_ranks.size(), stream_view);
auto rank_count_pair_first = thrust::make_zip_iterator(
thrust::make_tuple(d_tx_dst_ranks.begin(), d_tx_value_counts.begin()));
cuda::std::make_tuple(d_tx_dst_ranks.begin(), d_tx_value_counts.begin()));
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.

cuda::std::make_tuple here is unnecessary.

rmm::device_uvector<size_t> d_tx_value_counts(d_tx_dst_ranks.size(), stream_view);
auto rank_count_pair_first = thrust::make_zip_iterator(
thrust::make_tuple(d_tx_dst_ranks.begin(), d_tx_value_counts.begin()));
cuda::std::make_tuple(d_tx_dst_ranks.begin(), d_tx_value_counts.begin()));
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.

cuda::std::make_tuple here is unnecessary.

// a temporary function to emulate thrust::tuple_cat (should retire once thrust::tuple is replaced
// with cuda::std::tuple)
// a temporary function to emulate cuda::std::tuple_cat (should retire once cuda::std::tuple is
// replaced with cuda::std::tuple)
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.

This comment is now a bit weird. Does cuda::std::tuple_cat work? If yes, we may update this to a FIXME statement saying we need to replace this with cuda::std::tuple_cat.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated to a FIXME to test/use cuda::std::tuple_cat

Copy link
Copy Markdown
Contributor

@seunghwak seunghwak left a comment

Choose a reason for hiding this comment

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

LGTM except for the above issues.

@ChuckHastings
Copy link
Copy Markdown
Collaborator Author

/merge

@rapids-bot rapids-bot Bot merged commit 7462471 into rapidsai:branch-25.10 Aug 14, 2025
63 checks passed
rapids-bot Bot pushed a commit that referenced this pull request Aug 22, 2025
…:tuple (#5235)

Graph 500 BFS updates

and

replace thrust::tuple, thrust::make_tuple, thrust::get with cuda::std::tuple, cuda::std::make_tuple, cuda::std::get (#5226 did this migration but there were multiple remaining ones).

Authors:
  - Seunghwa Kang (https://github.com/seunghwak)

Approvers:
  - Chuck Hastings (https://github.com/ChuckHastings)

URL: #5235
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants