Skip to content

Commit af70615

Browse files
authored
Fix hanging pytests (#1924)
This PR attempts to fix the hanging pytest issues we are seeing in CI. From my investigations there are two issues. One is the `test_cagra_ace_tiny_memory_limit_triggers_disk_mode` and `test_hnsw_ace_tiny_memory_limit_triggers_disk_mode` tests which I have seen locally to hang. ~~At the moment, I am skipping these pytests in CI.~~ **Update**: After testing here 20 times https://github.com/rapidsai/cuvs/actions/runs/23182916436?pr=1893, I don't think we need to skip these tests. Second is a memory out of bounds error in `device_matrix_view_from_host` , first revealed by compute-sanitizer. This is likely a HMM issue. I have added more specific checks in the constructor so a copy is used when necessary. See this CI run from my test PR where I run 10 times to ensure that CI works with these fixes. https://github.com/rapidsai/cuvs/actions/runs/23131230353 I also reran CI on that test PR again. So all the pytests were run 20 times. Authors: - Anupam (https://github.com/aamijar) Approvers: - Tarang Jain (https://github.com/tarang-jain) URL: #1924
1 parent 2687c99 commit af70615

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cpp/src/neighbors/detail/cagra/utils.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ class device_matrix_view_from_host {
174174
{
175175
cudaPointerAttributes attr;
176176
RAFT_CUDA_TRY(cudaPointerGetAttributes(&attr, host_view.data_handle()));
177-
device_ptr = reinterpret_cast<T*>(attr.devicePointer);
178-
if (device_ptr == NULL) {
177+
device_ptr = reinterpret_cast<T*>(attr.devicePointer);
178+
bool needs_copy = (device_ptr == NULL) ||
179+
(attr.type != cudaMemoryTypeDevice && attr.type != cudaMemoryTypeManaged);
180+
if (needs_copy) {
179181
// allocate memory and copy over
180182
// NB: We use the temporary "large" workspace resource here; this structure is supposed to
181183
// live on stack and not returned to a user.

0 commit comments

Comments
 (0)