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

Enhancement on uniform random sampling of indices near zero. #2153

Merged
merged 22 commits into from
Mar 24, 2022

Conversation

aschaffer
Copy link
Collaborator

@aschaffer aschaffer commented Mar 23, 2022

This is a partial fix for #1979.

Specifically, given N = out-deg(v) and a random number r ∈ [0,1], one must obtain the equivalent discrete
index ∈ {0,1,...,N-1}. Previous implementation used an upper bound ubound = N-1 and a linear interpolation. As the issue above mentioned that approach creates problems near the (lower) boundary.

The fix uses a better bound, namely ubound = N and the discrete transformation: index = floor(r >= 1.0 ? N-1 : r*N).

Attached Mathematica plots show the graphs for, say, N = 13 and N=17.

N=13_cropped

N=17_uniform_sampling

This fix is not high priority for release 22-04, and can be included in the 22-06 release. Also, not all of the concerns formulated in the issue above are addressed by this PR. For example a uniform random generator callable from device is not yet available, but there are plans to perhaps expose something like that in raft.

aschaffer and others added 22 commits November 30, 2020 15:00
Update forked branch-0.18 from release
Update branch-0.19 from release
update forked from release branch-0.19
Merge from release branch-0.19
Merge latest rapidsai:branch-0.19 into aschaffer:branch-0.19
merge latest release branch-0.20
Merge latest rapidsai/branch-0.20 into forked branch-0.20
aschaffer/21.08 <- rapidsai/21.08
@aschaffer aschaffer requested a review from a team as a code owner March 23, 2022 18:58
@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2022

Codecov Report

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

@@               Coverage Diff               @@
##             branch-22.04    #2153   +/-   ##
===============================================
  Coverage                ?   73.99%           
===============================================
  Files                   ?      157           
  Lines                   ?    10496           
  Branches                ?        0           
===============================================
  Hits                    ?     7767           
  Misses                  ?     2729           
  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 e9acb27...15193fc. Read the comment docs.

@BradReesWork BradReesWork added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 24, 2022
@BradReesWork BradReesWork added this to the 22.04 milestone Mar 24, 2022
@ChuckHastings
Copy link
Collaborator

@gpucibot merge

@rapids-bot rapids-bot bot merged commit f1636a8 into rapidsai:branch-22.04 Mar 24, 2022
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
Development

Successfully merging this pull request may close these issues.

4 participants