-
Notifications
You must be signed in to change notification settings - Fork 917
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
[REVIEW] disallow SUM and MEAN of timestamp types #5319
Merged
karthikeyann
merged 20 commits into
rapidsai:branch-0.15
from
karthikeyann:bug-disallow-sum-timestamp
Jul 28, 2020
Merged
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
a5067bd
disable DeviceSum for timestamp
karthikeyann 3e72ab0
add transformer_mean for column MEAN reduction - enables timestamp MEAN
karthikeyann afb4f34
specialize rolling MEAN for timestamp
karthikeyann fe2e54c
specialize unit test for rolling MEAN of timestamp
karthikeyann c80de81
specialize grouped rolling MEAN of timestamp
karthikeyann 008d201
to get rid of warning in rolling.cu compilation
karthikeyann e90efd0
disable SUM for timestamp in device atomic tests
karthikeyann be9ddff
changelog entry for PR #5319
karthikeyann b1313a8
Merge branch 'branch-0.15' into bug-disallow-sum-timestamp
karthikeyann 5b856c4
Merge branch 'branch-0.15' into bug-disallow-sum-timestamp
karthikeyann b7dd0df
Revert "specialize rolling MEAN for timestamp"
karthikeyann fab057f
Revert "add transformer_mean for column MEAN reduction - enables time…
karthikeyann 234a63b
Revert "specialize grouped rolling MEAN of timestamp"
karthikeyann f2cdefe
Revert "specialize unit test for rolling MEAN of timestamp"
karthikeyann 9601911
remove MEAN support for timestamp
karthikeyann 34c2dc1
remove product operator of timestamp
karthikeyann de1b643
Merge branch 'branch-0.15' into bug-disallow-sum-timestamp
karthikeyann eccf0c9
Merge branch 'branch-0.15' into bug-disallow-sum-timestamp
karthikeyann 2026363
Merge branch 'branch-0.15' into bug-disallow-sum-timestamp
karthikeyann 53f427a
Merge branch 'branch-0.15' into bug-disallow-sum-timestamp
karthikeyann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,6 +332,23 @@ class GroupedRollingTest : public cudf::test::BaseFixture { | |
return col.release(); | ||
} | ||
|
||
template <typename OutputType, | ||
typename agg_op, | ||
bool is_mean_of_timestamp, | ||
std::enable_if_t<!is_mean_of_timestamp>* = nullptr> | ||
auto run_op(OutputType& val, OutputType const& in) | ||
{ | ||
val = agg_op{}(in, val); | ||
} | ||
template <typename OutputType, | ||
typename agg_op, | ||
bool is_mean_of_timestamp, | ||
std::enable_if_t<is_mean_of_timestamp>* = nullptr> | ||
auto run_op(OutputType& val, OutputType const& in) | ||
{ | ||
val = static_cast<OutputType>(agg_op{}(in.time_since_epoch(), val.time_since_epoch())); | ||
} | ||
|
||
template <typename agg_op, | ||
cudf::aggregation::Kind k, | ||
typename OutputType, | ||
|
@@ -374,7 +391,8 @@ class GroupedRollingTest : public cudf::test::BaseFixture { | |
size_type count = 0; | ||
for (size_type j = start_index; j < end_index; j++) { | ||
if (!input.nullable() || cudf::bit_is_set(valid_mask, j)) { | ||
val = op(static_cast<OutputType>(in_col[j]), val); | ||
run_op<OutputType, agg_op, (is_mean and cudf::is_timestamp<OutputType>())>( | ||
val, static_cast<OutputType>(in_col[j])); | ||
count++; | ||
} | ||
} | ||
|
@@ -941,6 +959,23 @@ class GroupedTimeRangeRollingTest : public cudf::test::BaseFixture { | |
return col.release(); | ||
} | ||
|
||
template <typename OutputType, | ||
typename agg_op, | ||
bool is_mean_of_timestamp, | ||
std::enable_if_t<!is_mean_of_timestamp>* = nullptr> | ||
auto run_op(OutputType& val, OutputType const& in) | ||
{ | ||
val = agg_op{}(in, val); | ||
} | ||
template <typename OutputType, | ||
typename agg_op, | ||
bool is_mean_of_timestamp, | ||
std::enable_if_t<is_mean_of_timestamp>* = nullptr> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
auto run_op(OutputType& val, OutputType const& in) | ||
{ | ||
val = static_cast<OutputType>(agg_op{}(in.time_since_epoch(), val.time_since_epoch())); | ||
} | ||
|
||
template <typename agg_op, | ||
cudf::aggregation::Kind k, | ||
typename OutputType, | ||
|
@@ -1010,7 +1045,8 @@ class GroupedTimeRangeRollingTest : public cudf::test::BaseFixture { | |
size_type count = 0; | ||
for (size_type j = start_index; j < end_index; j++) { | ||
if (!input.nullable() || cudf::bit_is_set(valid_mask, j)) { | ||
val = op(static_cast<OutputType>(in_col[j]), val); | ||
run_op<OutputType, agg_op, (is_mean and cudf::is_timestamp<OutputType>())>( | ||
val, static_cast<OutputType>(in_col[j])); | ||
count++; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,23 @@ class RollingTest : public cudf::test::BaseFixture { | |
return col.release(); | ||
} | ||
|
||
template <typename OutputType, | ||
typename agg_op, | ||
bool is_mean_of_timestamp, | ||
std::enable_if_t<!is_mean_of_timestamp>* = nullptr> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as comment from grouped_rolling_test.cpp |
||
auto run_op(OutputType& val, OutputType const& in) | ||
{ | ||
val = agg_op{}(in, val); | ||
} | ||
template <typename OutputType, | ||
typename agg_op, | ||
bool is_mean_of_timestamp, | ||
std::enable_if_t<is_mean_of_timestamp>* = nullptr> | ||
auto run_op(OutputType& val, OutputType const& in) | ||
{ | ||
val = static_cast<OutputType>(agg_op{}(in.time_since_epoch(), val.time_since_epoch())); | ||
} | ||
|
||
template <typename agg_op, | ||
cudf::aggregation::Kind k, | ||
typename OutputType, | ||
|
@@ -297,7 +314,8 @@ class RollingTest : public cudf::test::BaseFixture { | |
size_type count = 0; | ||
for (size_type j = start_index; j < end_index; j++) { | ||
if (!input.nullable() || cudf::bit_is_set(valid_mask, j)) { | ||
val = op(static_cast<OutputType>(in_col[j]), val); | ||
run_op<OutputType, agg_op, (is_mean and cudf::is_timestamp<OutputType>())>( | ||
val, static_cast<OutputType>(in_col[j])); | ||
count++; | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've always found this explicit "is_mean" bool that gets passed around a little strange (the actual rolling code did it too). The logic for this can be inferred from the other parameters, ie
Then this could be bubbled up further so that is_mean can be removed from the template params for create_reference_output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue #5466 is created to track this.