Skip to content
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

Improve performance in JSON reader when mixed_types_as_string option is enabled #15236

Merged
merged 4 commits into from
Mar 8, 2024

Conversation

shrshi
Copy link
Contributor

@shrshi shrshi commented Mar 5, 2024

Description

Addresses #15196 by applying a patch from @karthikeyann to skip the infer_column_type_kernel by forcing the mixed types column to be a string.
With this optimization, we see a significant improvement in performance. Please refer to the comment for a visualization of the results before and after applying this optimization as obtained from the JSON lines benchmarking exercise.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@shrshi shrshi added libcudf Affects libcudf (C++/CUDA) code. Performance Performance related issue non-breaking Non-breaking change labels Mar 5, 2024
Copy link

copy-pr-bot bot commented Mar 5, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@shrshi shrshi added the improvement Improvement / enhancement to an existing function label Mar 5, 2024
@shrshi
Copy link
Contributor Author

shrshi commented Mar 5, 2024

Benchmarks were run on A100 80GB GPU, with all combinations of normalize_single_quotes, row_selection, recovery_mode, mixed_type_as_string options being enabled/disabled.

mixed_type
mixed_type_patch

@shrshi shrshi marked this pull request as ready for review March 5, 2024 22:58
@shrshi shrshi requested a review from a team as a code owner March 5, 2024 22:58
@vuule
Copy link
Contributor

vuule commented Mar 5, 2024

The entire 30x slowdown was in the type inference?

@shrshi
Copy link
Contributor Author

shrshi commented Mar 6, 2024

Yes, the slowdown seems to be due to long string sizes when mixed types is enabled. If we enforce the column to be a string in the JSON tree parser, we can skip the type inference kernel.

@shrshi
Copy link
Contributor Author

shrshi commented Mar 6, 2024

/ok to test

@GregoryKimball GregoryKimball changed the title Performance improvement in JSON lines reader when mixed_types_as_string option is enabled Improve performance in JSON reader when mixed_types_as_string option is enabled Mar 7, 2024
@shrshi shrshi added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Mar 8, 2024
@shrshi
Copy link
Contributor Author

shrshi commented Mar 8, 2024

/ok to test

cpp/src/io/json/json_column.cu Show resolved Hide resolved
cpp/src/io/json/json_column.cu Outdated Show resolved Hide resolved
@shrshi
Copy link
Contributor Author

shrshi commented Mar 8, 2024

/ok to test

@shrshi
Copy link
Contributor Author

shrshi commented Mar 8, 2024

/merge

@rapids-bot rapids-bot bot merged commit c9e54cf into rapidsai:branch-24.04 Mar 8, 2024
73 checks passed
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 improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Performance Performance related issue
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants