Skip to content

Asynchronously fetch byte ranges from multiple sources - #22586

Merged
rapids-bot[bot] merged 22 commits into
NVIDIA:mainfrom
mhaseeb123:fea/multi-source-parquet-io-utils
Jun 3, 2026
Merged

Asynchronously fetch byte ranges from multiple sources#22586
rapids-bot[bot] merged 22 commits into
NVIDIA:mainfrom
mhaseeb123:fea/multi-source-parquet-io-utils

Conversation

@mhaseeb123

@mhaseeb123 mhaseeb123 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Contributes to #22583. Follow up #22550

This PR adds a new overload of fetch_byte_ranges_to_device_async Parquet IO utility that enables asynchronously fetching byte ranges across multiple sources.

This new API is now being used to read column chunk data by both Parquet and Hybrid scan readers enabling common (pipelining) behavior for multithreaded reads.

Checklist

@copy-pr-bot

copy-pr-bot Bot commented May 19, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label May 19, 2026
@mhaseeb123 mhaseeb123 added 2 - In Progress Currently a work in progress cuIO cuIO issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 19, 2026
@mhaseeb123
mhaseeb123 marked this pull request as ready for review May 25, 2026 23:08
@mhaseeb123
mhaseeb123 requested a review from a team as a code owner May 25, 2026 23:08
@mhaseeb123
mhaseeb123 requested a review from PointKernel May 25, 2026 23:08
@mhaseeb123
mhaseeb123 requested a review from davidwendt May 25, 2026 23:08
@mhaseeb123 mhaseeb123 added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels May 25, 2026

} // namespace detail

std::tuple<std::vector<rmm::device_buffer>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved impl in detail vectorized API. Public APIs just call that wrapped with a CUDF_FUNC_RANGE() like every other libcudf API

Comment thread cpp/src/io/parquet/io_utils/parquet_io_utils.cpp
Comment thread cpp/src/io/parquet/io_utils/parquet_io_utils.cpp Outdated
Comment thread cpp/src/io/parquet/reader_impl_preprocess_utils.cu
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@mhaseeb123
mhaseeb123 requested a review from vuule May 26, 2026 22:49
@mhaseeb123

Copy link
Copy Markdown
Contributor Author

@vuule added you as reviewer as you just reviewed its predecessor PR (same thing here except vectorized and using another mutex to serialize host reads too across threads)

// Schedule host reads holding the `host_read_mutex` so that all reads for a caller thread
// are scheduled without interleaving with reads from other threads yielding better pipelining
{
std::scoped_lock<std::mutex> lock(host_read_mutex);

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.

if I'm reading this right, we now have a mutex around read_parquet IO as well? Have you checked the impact on the multithreaded benchmark?

@mhaseeb123 mhaseeb123 May 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Your understanding is correct. I measured performance of Parquet multithreaded benchmark and saw no difference (See #22586 (comment)). I was expecting a speed improvement though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I also ran this experiment #22529 (comment) again with this PR and compared the profiles and saw no difference

@mhaseeb123

mhaseeb123 commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Performance Impact to PARQUET_MULTITHREAD_READER_NVBENCH

Summary: No impact. Everything within noise threshold.

parquet_multithreaded_read_decode_fixed_width

cardinality io_type num_cols num_iterations num_threads run_length total_data_size main (ms) PR (ms) Δ noise(main/PR)
1000 PINNED_BUFFER 4 1 1 8 1073741824 14.334 14.603 +1.88% 0.41%/1.03%
1000 PINNED_BUFFER 4 1 2 8 1073741824 14.002 14.246 +1.74% 1.68%/1.79%
1000 PINNED_BUFFER 4 1 4 8 1073741824 14.734 15.033 +2.03% 5.11%/4.68%
1000 PINNED_BUFFER 4 1 8 8 1073741824 16.532 16.676 +0.87% 7.18%/6.57%

parquet_multithreaded_read_decode_list

cardinality io_type num_cols num_iterations num_threads run_length total_data_size main (ms) PR (ms) Δ noise(main/PR)
1000 PINNED_BUFFER 4 1 1 8 1073741824 29.630 29.837 +0.70% 0.87%/0.81%
1000 PINNED_BUFFER 4 1 2 8 1073741824 28.109 28.047 -0.22% 2.70%/4.85%
1000 PINNED_BUFFER 4 1 4 8 1073741824 27.215 27.480 +0.97% 7.30%/9.90%
1000 PINNED_BUFFER 4 1 8 8 1073741824 35.343 35.172 -0.49% 14.16%/13.49%

parquet_multithreaded_read_decode_mixed

cardinality io_type num_cols num_iterations num_threads run_length total_data_size main (ms) PR (ms) Δ noise(main/PR)
1000 PINNED_BUFFER 4 1 1 8 1073741824 12.903 13.042 +1.07% 0.67%/1.61%
1000 PINNED_BUFFER 4 1 2 8 1073741824 13.045 13.376 +2.53% 6.03%/6.13%
1000 PINNED_BUFFER 4 1 4 8 1073741824 14.900 15.040 +0.94% 6.66%/8.13%
1000 PINNED_BUFFER 4 1 8 8 1073741824 18.373 18.664 +1.58% 10.06%/9.21%

parquet_multithreaded_read_decode_string

cardinality io_type num_cols num_iterations num_threads run_length total_data_size main (ms) PR (ms) Δ noise(main/PR)
1000 PINNED_BUFFER 4 1 1 8 1073741824 13.568 13.789 +1.64% 0.50%/1.22%
1000 PINNED_BUFFER 4 1 2 8 1073741824 14.126 14.149 +0.17% 6.52%/5.48%
1000 PINNED_BUFFER 4 1 4 8 1073741824 15.821 15.937 +0.73% 14.11%/14.23%
1000 PINNED_BUFFER 4 1 8 8 1073741824 20.153 20.702 +2.72% 8.61%/8.47%

@mhaseeb123
mhaseeb123 requested review from qbacpey and vuule May 28, 2026 23:09
Comment thread cpp/src/io/parquet/io_utils/parquet_io_utils.cpp Outdated
Comment thread cpp/src/io/parquet/io_utils/parquet_io_utils.cpp Outdated
Comment thread cpp/src/io/parquet/reader_impl_preprocess_utils.cu
Co-authored-by: Yunsong Wang <12716979+PointKernel@users.noreply.github.com>
@mhaseeb123
mhaseeb123 requested a review from PointKernel June 1, 2026 23:22

@PointKernel PointKernel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One last comment but non blocking.

Comment thread cpp/src/io/parquet/io_utils/parquet_io_utils.cpp Outdated
rapids-bot Bot pushed a commit that referenced this pull request Jun 2, 2026
…e sources (#22613)

Contributes to #22583. Follow up #22586

This PR adds new overloads of remaining Parquet IO utility to fetch parquet footers and page index bytes from multiple sources.

Authors:
  - Muhammad Haseeb (https://github.com/mhaseeb123)

Approvers:
  - Qi Chen (https://github.com/qbacpey)
  - Yunsong Wang (https://github.com/PointKernel)

URL: #22613
@mhaseeb123 mhaseeb123 added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Jun 2, 2026
@mhaseeb123

Copy link
Copy Markdown
Contributor Author

/merge

@vyasr vyasr 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.

Wow I'm sorry I started reviewing here and then completely forgot to submit. Looks like almost all of my requests have already been addressed so please proceed with merging. I'll just leave the question.

{
static std::mutex mutex;
static std::mutex host_read_mutex;
static std::mutex device_read_mutex;

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 is implementing what we discussed in #22550, right?

@rapids-bot
rapids-bot Bot merged commit d612f5c into NVIDIA:main Jun 3, 2026
215 of 219 checks passed
@mhaseeb123

Copy link
Copy Markdown
Contributor Author

This is implementing what we discussed in #22550, right?

Yes :)

@mhaseeb123
mhaseeb123 deleted the fea/multi-source-parquet-io-utils branch June 3, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to Merge Testing and reviews complete, ready to merge cuIO cuIO issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants