-
Notifications
You must be signed in to change notification settings - Fork 338
[REVIEW] Pagerank fix #919
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
Conversation
|
Please update the changelog in order to start CI tests. View the gpuCI docs here. |
seunghwak
left a comment
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.
If we are passing non-owning pointers, they should be marked as const (mark the pointer itself is const, not the values pointed by the pointer, or we can use iterators instead to be more generic as well) to be safe.
Better establish this convention in our codebase, but hope we can retire this code sooner than later.
| number: {{ git_revision_count }} | ||
| string: cuda{{ cuda_version }}_{{ git_revision_count }} | ||
| number: {{ GIT_DESCRIBE_NUMBER }} | ||
| string: cuda{{ cuda_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} |
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.
Something is wrong with how you branched or you're targeting the wrong branch. These are v0.15 changes.
| // A thrust::swap would probably be more efficent if the vectors were passed everywhere | ||
| // instead of pointers. std::swap is unsafe though. Just copying for now, as this may soon be | ||
| // replaced by the pattern accelerator. | ||
| copy(n, pr, tmp); |
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.
and just FYI, what you could do instead is something like
pagerank(value_t* pr, ...) {
rmm::device_uvector<value_t> tmp{};
value_t* p_new = pr;
value_t* p_old = tmp.data().get();
...
// at the end of iteration
if (iter % 2 == 0) {
p_new = tmp.data().get();
p_old = pr;
}
else {
p_new = pr;
p_old = tmp.data().get();
}
}
|
#923 made it to 0.15 as well |
double-free bug found by @rlratzel
pagerankandtmpthrust vectors are both scope managed now, but raw pointers to their device memory are std::swapped inside the solver. By the time the scope ends forpagerankits device pointer may be pointing to the data that was freed bytmp.Just doing a cpy for now as a fix since this may soon be replaced by the pattern accelerator.
A thrust::swap would probably be ideal if the vectors were passed to this section of the code instead of raw pointers.