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

Fix a critical issue with parallel_search functor. #405

Merged
merged 17 commits into from
Jun 16, 2021

Conversation

thomcom
Copy link
Contributor

@thomcom thomcom commented May 21, 2021

parallel_search was producing the wrong indexes for deciding which coefficients to use for interpolation. This was hidden by the test cases, but exposed via python as I was researching another bug.

This PR resolves the issue with parallel_search so that it produces the correct indexes for interpolation.

I'm improving the testing a bit more before asking for reviews.

@thomcom thomcom added bug Something isn't working ! - Hotfix Hotfix is a bug that affects the majority of users for which there is no reasonable workaround 2 - In Progress Currenty a work in progress non-breaking Non-breaking change labels May 21, 2021
@thomcom thomcom requested review from a team as code owners May 21, 2021 15:19
@thomcom thomcom requested review from harrism and zhangjianting May 21, 2021 15:19
@github-actions github-actions bot added libcuspatial Relates to the cuSpatial C++ library Python Related to Python code labels May 21, 2021
@kkraus14 kkraus14 removed the ! - Hotfix Hotfix is a bug that affects the majority of users for which there is no reasonable workaround label May 24, 2021
@kkraus14
Copy link
Contributor

Removed the hotfix label as we're not applying this to 0.19. We're not in burndown yet for 21.06 in cuSpatial 😄

Copy link
Contributor

@trxcllnt trxcllnt left a comment

Choose a reason for hiding this comment

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

Made some suggestions. Copyright years in the source and test files also need to be updated. Probably also good to update the other functions in this file with more descriptive variable names and remove the dead code.

Didn't compile for me, but changing t.size() to search_coords.size() made it compile. Doesn't pass the new test locally (error below). Am I missing something?

[ RUN      ] CubicSplineTest.test_interpolate_between_control_points
Splines
0.5	-0.5	-0.5	0.5	0.5	-0.5	-0.5	0.5	0.5	-0.5	-0.5	0.5
New coords
0	0.5	1	1.5	2	2.5	3	3.5	4	0	0.5	1	1.5	2	2.5	3	3.5	4	0	0.5	11.5	2	2.5	3	3.5	4
New results
3	2.3125	2	2.3125	3	3.6875	4	3.6875	3	3	2.3125	2	2.3125	3	3.6875	12	19.1875	29	3	2.31252	2.4375	4	7.0625	12	19.1875	29
../../../../tests/utilities/column_utilities.cu:68: Failure
Expected equality of these values:
  lhs.size()
    Which is: 27
  rhs.size()
    Which is: 15

@thomcom
Copy link
Contributor Author

thomcom commented Jun 1, 2021

@trxcllnt what do you say?

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.

If we have time before code freeze this week, I have a few more changes to suggest.

Comment on lines 91 to 92
* @brief Finds the lower interpolant position of query_points from a set of
* interpolation independent variables.
Copy link
Member

Choose a reason for hiding this comment

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

What does the lower interpolant position mean? Perhaps more explanation after the @brief.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made another pass at describing this function now in detail/cubic_spline.hpp let me know what you think. Otherwise all your other requests are complete.

@thomcom thomcom requested a review from a team as a code owner June 2, 2021 22:14
@github-actions github-actions bot added the conda Related to conda and conda configuration label Jun 2, 2021
@@ -0,0 +1,74 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this header is needed at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put find_coefficient_indices into detail, as a private function, so I can write tests for it.

{0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2}};
cudf::test::fixed_width_column_wrapper<int> prefix_column{{0, 5}};

auto indexes = cuspatial::detail::find_coefficient_indices(long_triple,
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to test detail APIs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a private function, but it had a bug, so I wrote tests for it.

Copy link
Contributor

@trxcllnt trxcllnt left a comment

Choose a reason for hiding this comment

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

Question on conda dev envs.

@ajschmidt8 ajschmidt8 changed the base branch from branch-21.06 to branch-21.08 June 7, 2021 17:33
@ajschmidt8
Copy link
Member

ajschmidt8 commented Jun 7, 2021

Updated the base branch to 21.08. Removing ops-codeowners from the required reviews since it doesn't seem that we have any files that we're responsible here for any longer.

@ajschmidt8 ajschmidt8 removed the request for review from a team June 7, 2021 17:34
@trxcllnt trxcllnt self-requested a review June 7, 2021 19:03
@github-actions github-actions bot removed the conda Related to conda and conda configuration label Jun 7, 2021
@thomcom
Copy link
Contributor Author

thomcom commented Jun 16, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 43aa3da into rapidsai:branch-21.08 Jun 16, 2021
@thomcom thomcom deleted the bug-spline-fit-error branch July 29, 2022 19:28
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 bug Something isn't working libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change Python Related to Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants