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 NVBench and linestring distance benchmark #577

Merged

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented Jun 22, 2022

This PR adds NVBench to cuspatial and introduces benchmarks for pairwise_linestring_distance.

@github-actions github-actions bot added cmake Related to CMake code or build configuration libcuspatial Relates to the cuSpatial C++ library labels Jun 22, 2022
@isVoid isVoid marked this pull request as ready for review June 22, 2022 19:21
@isVoid isVoid requested review from a team as code owners June 22, 2022 19:21
@isVoid isVoid added feature request New feature or request 3 - Ready for Review Ready for review by team labels Jun 22, 2022
@isVoid isVoid added non-breaking Non-breaking change benchmarks Related to benchmarks labels Jun 22, 2022
@isVoid isVoid requested a review from vyasr June 22, 2022 19:26
@isVoid
Copy link
Contributor Author

isVoid commented Jun 22, 2022

Tagging @vyasr for cmake related changes, thanks!

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

One minor comment, otherwise the CMake LGTM.

cpp/benchmarks/CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

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

Suggest some simplification by dropping the cudf dependency.

cpp/benchmarks/CMakeLists.txt Show resolved Hide resolved
cpp/benchmarks/pairwise_linestring_distance.cu Outdated Show resolved Hide resolved
thrust::make_counting_iterator(static_cast<cudf::size_type>(num_points)),
offsets.begin(),
[num_segments_per_string] __device__(auto i) { return i * num_segments_per_string; });
auto points_x = cudf::make_fixed_width_column(
Copy link
Member

Choose a reason for hiding this comment

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

Why deal with columns at all? This forces you to deal with x and y separately when you could do them both with the same functor and reduce the number of Thrust calls nearly in half. That would make this code much more readable without comments and also more maintainable.

Copy link
Contributor Author

@isVoid isVoid Jun 23, 2022

Choose a reason for hiding this comment

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

Hmm, now that you mention, you are right about that. The code is adapted from an earlier version that uses the cudf column API. With header only API in place, we can bypass using columns in all.

Copy link
Contributor

@thomcom thomcom left a comment

Choose a reason for hiding this comment

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

Great

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 changes LGTM

Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

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

I approve. Just one question.


#include <memory>

namespace cuspatial {
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why these functions are being added to the cuSpatial namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. The benchmarks shouldn't be counted in the library namespace because they are considered external code that treats the target API as a black box. I think it would be helpful to mention this in https://github.com/rapidsai/cudf/blob/branch-22.08/cpp/docs/BENCHMARKING.md

Copy link
Member

Choose a reason for hiding this comment

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

Did you open an issue for adding a namespace mention to BENCHMARKING.md?

@isVoid
Copy link
Contributor Author

isVoid commented Jul 5, 2022

rerun tests

1 similar comment
@isVoid
Copy link
Contributor Author

isVoid commented Jul 5, 2022

rerun tests

@isVoid
Copy link
Contributor Author

isVoid commented Jul 5, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 2f71eb1 into rapidsai:branch-22.08 Jul 5, 2022
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 benchmarks Related to benchmarks cmake Related to CMake code or build configuration feature request New feature or request libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants