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

Fixing bad host->device copy #375

Merged

Conversation

cjnolet
Copy link
Member

@cjnolet cjnolet commented Nov 15, 2021

A host vector in haversine knn test was being resized to n rather n*d before n*d elements were copied from it to a device vector. Not sure if this is causing the following issue in the test, but it's not correct nonetheless:

[----------] 1 test from HaversineKNNTestF
[ RUN      ] HaversineKNNTestF.Fit
unknown file: Failure
C++ exception with description "std::bad_alloc: CUDA error at: _deps/rmm-src/include/rmm/mr/device/cuda_memory_resource.hpp:70: cudaErrorMemoryAllocation out of memory" thrown in the test fixture's constructor.
[  FAILED  ] HaversineKNNTestF.Fit (0 ms)
[----------] 1 test from HaversineKNNTestF (0 ms total)

Since it was happening on host, the only thing I can think of is that somehow there is some host memory being used to determine the amount of device memory to allocate, which is grabbing a garbage value from somewhere.

@cjnolet cjnolet requested review from a team as code owners November 15, 2021 16:54
@github-actions github-actions bot added the cpp label Nov 15, 2021
@cjnolet cjnolet added bug Something isn't working non-breaking Non-breaking change improvement Improvement / enhancement to an existing function and removed improvement Improvement / enhancement to an existing function labels Nov 15, 2021
@cjnolet
Copy link
Member Author

cjnolet commented Nov 15, 2021

rerun tests

@achirkin
Copy link
Contributor

Not exactly related to these changes, but still, can we also get rid of these two lines?

std::vector<value_t *> input_vec = {d_train_inputs.data()};
std::vector<value_idx> sizes_vec = {n};

Copy link
Member

@divyegala divyegala left a comment

Choose a reason for hiding this comment

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

LGTM

@cjnolet
Copy link
Member Author

cjnolet commented Nov 15, 2021

@achirkin, absolutely I can remove those 2 lines. I'm actually surprised it wasn't tripping an error since those two variables are never used. Might be an indication that a flag needs to be enabled during compile.

@cjnolet
Copy link
Member Author

cjnolet commented Nov 15, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 224e16e into rapidsai:branch-21.12 Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cpp non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants