Comments (3)
This issue can be solved by setting the max_queries
parameter in cagra.SearchParams()
.
distances, neighbors = cagra.search(cagra.SearchParams(max_queries=10000),
index, query,
k, handle=handle)
According to the documentation, max_queries
is in auto select mode when 0 but it is not bounded (see here). A check should be added.
from raft.
A more easier demo to reproduce this bug
batch_size = 1024
n_samples = 200
n_features = 64
# n_queries = 1000
k = 3
dataset = torch.randn(batch_size * n_samples, n_features, dtype=torch.float32).cuda()
handle = DeviceResources()
build_params = cagra.IndexParams(metric="sqeuclidean")
index = cagra.build(build_params, dataset, handle=handle)
distances, neighbors = cagra.search(cagra.SearchParams(),
index, dataset,
k, handle=handle)
from raft.
Provide more test example.
This example does computation successfully:
n_features = 64
k = 3
dataset = torch.randn(500000, n_features, dtype=torch.float32).cuda()
query = torch.randn(60000, n_features, dtype=torch.float32).cuda()
handle = DeviceResources()
build_params = cagra.IndexParams(metric="sqeuclidean")
index = cagra.build(build_params, dataset, handle=handle)
distances, neighbors = cagra.search(cagra.SearchParams(),
index, query,
k, handle=handle)
This example fails:
n_features = 64
k = 3
dataset = torch.randn(500000, n_features, dtype=torch.float32).cuda()
query = torch.randn(70000, n_features, dtype=torch.float32).cuda()
handle = DeviceResources()
build_params = cagra.IndexParams(metric="sqeuclidean")
index = cagra.build(build_params, dataset, handle=handle)
distances, neighbors = cagra.search(cagra.SearchParams(),
index, query,
k, handle=handle)
from raft.
Related Issues (20)
- [BUG] Kmeans balanced test fails when n_cols<=4
- [FEA] Precompute lookup tables for IVF-PQ search HOT 3
- [FEA] Enable direct cosine distance computation in nearest neighbors algorithms
- [QST] How to build raft with a -arch=sm_75? HOT 1
- [FEA] Replace temporary_device_buffer with mdbuffer-based copyback_buffer
- [FEA] Create a helper function for generating an mdbuffer from a pointer of unknown memory type
- [Task] Review performance impact of `std::visit` in mdbuffer
- [FEA] Improve refine_host performance when batch size is small
- [FEA] how to align rmm stream usage with raft handle
- [FEA] Consistently use the same convention for `hpp` files and their usage of device APIs
- [BUG] Crash in CAGRA optimize from invalid neighbor indices (produced by nn-descent)
- [FEA] Respect `workspace_resource` across ANN algorithms (initially) to allow the separation of memory resources in different `raft::resources` instance
- [FEA] Add filtering search support to `hnsw`
- [QST] How to avoid cuda resource warning when using cargra? HOT 4
- [BUG] Compile the `template` Fails with RTX 4090 HOT 4
- [BUG] CAGRA computation results will go wrong HOT 3
- [BUG]LIBRAFT cannot be built when RMM locally installed HOT 2
- [FEA] Make dataset ownership semantics consistent across ANN indexes
- [FEA] Allow building IVF PQ indexes from host mdspans
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raft.