Skip to content

Commit d77c73a

Browse files
authored
Fix resource import so generate_groundtruth works (#774)
`generate_groundtruth/__main__.py` was importing DeviceResources directly from pylibraft. However generate_groundtruth attempts to call cuvs brute_force build which expects to get `cuvs.common.Resources`. This mismatch was causing the groundtruth generation script to crash. This PR fixes this and imports `cuvs.common.Resources` Authors: - Rohan Varma (https://github.com/nvrohanv) Approvers: - Divye Gala (https://github.com/divyegala) - Tamas Bela Feher (https://github.com/tfeher) URL: #774
1 parent 61a714b commit d77c73a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • python/cuvs_bench/cuvs_bench/generate_groundtruth

python/cuvs_bench/cuvs_bench/generate_groundtruth/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ def force_fallback_to_numpy():
8484
if rmm is not None:
8585
gpu_system = True
8686
try:
87-
from pylibraft.common import DeviceResources
8887
from rmm.allocators.cupy import rmm_cupy_allocator
8988

89+
from cuvs.common import Resources
9090
from cuvs.neighbors.brute_force import build, search
9191
except ImportError:
9292
# RMM is available, cupy is available, but cuVS is not
@@ -188,7 +188,7 @@ def calc_truth(dataset, queries, k, metric="sqeuclidean"):
188188
queries = xp.asarray(queries, dtype=xp.float32)
189189

190190
if gpu_system:
191-
resources = DeviceResources()
191+
resources = Resources()
192192

193193
while i < n_samples:
194194
print("Step {0}/{1}:".format(i // n, n_samples // n))

0 commit comments

Comments
 (0)