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

Fea hungarian expose precision #1673

Merged

Conversation

ChuckHastings
Copy link
Collaborator

@ChuckHastings ChuckHastings commented Jun 14, 2021

Closes #1645
Closes #1646

Expose the precision parameter (epsilon in the Date/Nagi implementation) of the Hungarian algorithm to be controllable by the user. Add support for rectangular matrices.

Will be enabled for CI after rapidsai/raft#275 is merged.

@ChuckHastings ChuckHastings requested a review from a team as a code owner June 14, 2021 22:32
@ChuckHastings ChuckHastings self-assigned this Jun 15, 2021
@ChuckHastings ChuckHastings added 3 - Ready for Review improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 15, 2021
@ChuckHastings ChuckHastings added this to the 21.08 milestone Jun 15, 2021
@ChuckHastings ChuckHastings changed the title [skip-ci] Fea hungarian expose precision Fea hungarian expose precision Jun 15, 2021
@ChuckHastings
Copy link
Collaborator Author

rerun tests

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.08@27444ed). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 7decd9d differs from pull request most recent head fa8b435. Consider uploading reports for the commit fa8b435 to get more accurate results
Impacted file tree graph

@@              Coverage Diff               @@
##             branch-21.08   #1673   +/-   ##
==============================================
  Coverage                ?   0.22%           
==============================================
  Files                   ?      80           
  Lines                   ?    3542           
  Branches                ?       0           
==============================================
  Hits                    ?       8           
  Misses                  ?    3534           
  Partials                ?       0           

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 27444ed...fa8b435. Read the comment docs.

@ChuckHastings
Copy link
Collaborator Author

rerun tests

Copy link
Contributor

@seunghwak seunghwak 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 some minor comments about variable naming, but besides theses complaints, looks good to me.

vertex_t num_rows,
vertex_t num_columns,
vertex_t *assignment,
weight_t precision);
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, we used epsilon in raft and we're using precision here, I got they are two different functions, but both epsilon and precision are used to evaluate equality.... so better be consistent?

weight_t const *costs,
vertex_t num_rows,
vertex_t num_columns,
vertex_t *assignment,
Copy link
Contributor

Choose a reason for hiding this comment

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

assignment"s"? (as this is an array of values and we're using cost"s", without "s", one may think cost"s" is an array and assignment is a single value).

weight_t{0},
thrust::maximum<weight_t>());

rmm::device_uvector<weight_t> tmp_cost(n * n, handle.get_stream_view());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use _v for tmp_row_assignment_v and tmp_col_assignment_v but no _v for tmp_cost? IIRC, you use _v for vectors and better be consistent at least within a code block.

@BradReesWork
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 1030a49 into rapidsai:branch-21.08 Jun 16, 2021
rapids-bot bot pushed a commit that referenced this pull request Jun 18, 2021
Completes the work of exposing the precision parameter to the caller in python as requested by #1645 

Fixes a few PR comments from PR #1673 that were deferred as that PR required merging to fix the build.

Authors:
  - Chuck Hastings (https://github.com/ChuckHastings)

Approvers:
  - Seunghwa Kang (https://github.com/seunghwak)
  - Brad Rees (https://github.com/BradReesWork)

URL: #1674
@ChuckHastings ChuckHastings deleted the fea_hungarian_expose_precision branch July 29, 2021 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
6 participants