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

Add device create_sequence_table for benchmarks #10300

Merged

Conversation

karthikeyann
Copy link
Contributor

@karthikeyann karthikeyann commented Feb 15, 2022

addresses parts of #5773

  • Add create_sequence_table which creates sequences in device (only numeric types supported) with/without nulls.
  • Add create_random_null_mask to create random null mask with given probability. (0.0-1.0 null probability)
    - add gnu++17 to generate_input.cu (temporarily for int128 STL support).
  • renamed repeat_dtypes to cycle_dtypes and moved out of create_* methods
  • updated ast bench, search, scatter , binary ops bench

Splitting PR #10109 for review

@karthikeyann karthikeyann added feature request New feature or request 3 - Ready for Review Ready for review by team tests Unit testing for project libcudf Affects libcudf (C++/CUDA) code. 4 - Needs Review Waiting for reviewer to review or respond Performance Performance related issue non-breaking Non-breaking change labels Feb 15, 2022
@karthikeyann karthikeyann requested a review from a team as a code owner February 15, 2022 18:04
@karthikeyann karthikeyann self-assigned this Feb 15, 2022
@github-actions github-actions bot added the CMake CMake build issue label Feb 15, 2022
@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #10300 (788b859) into branch-22.04 (c163886) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head 788b859 differs from pull request most recent head fbd5708. Consider uploading reports for the commit fbd5708 to get more accurate results

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-22.04   #10300      +/-   ##
================================================
- Coverage         10.62%   10.62%   -0.01%     
================================================
  Files               122      122              
  Lines             20961    20973      +12     
================================================
  Hits               2228     2228              
- Misses            18733    18745      +12     
Impacted Files Coverage Δ
python/cudf/cudf/core/_base_index.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/_internals/where.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/categorical.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/column.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/decimal.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/lists.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/string.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/dataframe.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/df_protocol.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c163886...fbd5708. Read the comment docs.

@karthikeyann
Copy link
Contributor Author

rerun tests

cpp/benchmarks/CMakeLists.txt Outdated Show resolved Hide resolved
cpp/benchmarks/common/generate_input.cu Outdated Show resolved Hide resolved
cpp/benchmarks/common/generate_input.hpp Outdated Show resolved Hide resolved
cpp/benchmarks/common/generate_input.hpp Outdated Show resolved Hide resolved
cpp/benchmarks/common/generate_input.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

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

CMake and refactoring to avoid build flag changes looks great. Thank you

#include <thrust/random.h>

/**
* @brief valid bit generator with given probability [0.0 - 1.0]
Copy link
Contributor

@bdice bdice Feb 23, 2022

Choose a reason for hiding this comment

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

I'd change the docs / naming here. There's no such thing as a "valid" bit -- only set (1) or unset (0) bits. This is layered with our interpretation of a set of bits as a null mask, but this function as written only deals with generating bools. (Moreover, this generates a byte-size bool and not a "bit".)

This mixing of semantics was a large part of what I untangled in #9588. In particular, there were issues with how that interpretation of valid/set and null/unset results in higher-order semantics when a null mask is nullptr. It's not possible to count "set" bits in the data pointed to by nullptr, but we have a specific interpretation of that in the context of validity / cudf null masks.

I want to emphasize this distinction and keep our lowest-level primitives (such as random generators) free of the valid/null interpretations of bits/bools. Including those semantics in functions like create_random_null_mask is fine, because the interpretation is explicitly intended and communicated in the function name / docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

I have a few comments above - requesting changes for those. (I would have submitted them as a proper review rather than individual comments, but I didn't expect to add more than 1-2 small comments. Sorry about that.)

@karthikeyann karthikeyann requested a review from bdice February 24, 2022 18:38
@karthikeyann
Copy link
Contributor Author

karthikeyann commented Feb 24, 2022

all review comments addressed.
number of files changed are high due to cycle_dtypes change.

cpp/benchmarks/common/generate_nullmask.cu Outdated Show resolved Hide resolved
cpp/benchmarks/common/generate_nullmask.cu Outdated Show resolved Hide resolved
@karthikeyann
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit eaae94b into rapidsai:branch-22.04 Feb 25, 2022
rapids-bot bot pushed a commit that referenced this pull request Mar 9, 2022
Fixes `BINARYOP_BENCH` which is throwing an error for non-numeric types:
```
terminate called after throwing an instance of 'cudf::logic_error'
  what():  cuDF failure at: /cudf/cpp/src/filling/sequence.cu:139: init scalar type must be numeric
```

The `compiled_binaryop.cpp` was recently changed in #10300 to create test columns using the benchmark utility `create_sequence_table` which internally calls `cudf::sequence` API. Unfortunately, [only `numeric` types can be used with this API](https://github.com/rapidsai/cudf/blob/a9b6cb113bcacecd0752d2957971c0d417cf719e/cpp/src/filling/sequence.cu#L139) which throws an error for types like `timestamp, duration, and decimal` which are being measured in this file. https://docs.rapids.ai/api/libcudf/stable/group__transformation__fill.html#gaeda630c9dcdd152eeecf0a1b636244ac

The fix replaces the `create_sequence_table` call with `create_random_table` to generate the source columns instead.

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Karthikeyan (https://github.com/karthikeyann)
  - Nghia Truong (https://github.com/ttnghia)

URL: #10398
rapids-bot bot pushed a commit that referenced this pull request Mar 22, 2022
To speedup generate benchmark input generation, move all data generation to device.
To address #5773 (comment)
This PR moves the random input generation to device.

Rest all of the original work in this PR was split to multiple PRs and merged.
#10277
#10278
#10279
#10280
#10281
#10300

With all of these changes, single iteration of all benchmark runs in <1000 seconds. (from 3067s to 964s).
Running more iterations would see higher benefit too because the benchmark is restarted several times during run which again calls benchmark input generation code.

closes #9857

Authors:
  - Karthikeyan (https://github.com/karthikeyann)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Vukasin Milovanovic (https://github.com/vuule)
  - David Wendt (https://github.com/davidwendt)

URL: #10109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team 4 - Needs Review Waiting for reviewer to review or respond CMake CMake build issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Performance Performance related issue tests Unit testing for project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants