[BUG] CAGRA normal-hash sizing narrows visited-node count to uint32_t
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- ai-infra-agents, backend, machine-learning
Hướng nghiên cứu
The bug is in search_plan_impl::calc_hashmap_params() in the cuVS codebase, likely in a file like neighbors/detail/cagra/search_plan.cuh. Start by locating the function and the line where max_visited_nodes is computed. Understand the hash-sizing logic and the overflow issue. The provided reproducer can be compiled and run to verify the bug. Done looks like fixing the narrowing to use a wider type (e.g., uint64_t) and ensuring the capacity check rejects estimates above the normal-hash limit (2^20 entries).
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The normal-hash path in search_plan_impl::calc_hashmap_params() narrows the visited-node estimate to uint32_t before sizing the hash table:
uint32_t max_visited_nodes = itopk_size + (search_width * graph_degree * max_iterations);
A large estimate can wrap to a small value, so the planner accepts a table that does not satisfy its configured fill-rate bound instead of rejecting the oversized request.
This predates #2533. That PR bounds the hash-sizing loops but does not change this conversion. Tracking it separately following the review there.
Steps/Code to reproduce bug
Use MULTI_KERNEL, hash mode AUTO, itopk_size=3872, search_width=8, graph degree 32, max_iterations=16777216, and the default fill rate 0.5. The small-hash requirement is 3872 + 8*32 = 4128, above the small table's effective capacity of 4096, so AUTO falls back to the normal-hash path.
This planner-only reproducer uses the real internal planner. It does not launch a search or allocate a large dataset. Build it as a CUDA C++20 translation unit with the normal cuVS source/generated-header include paths and RAFT/RMM dependencies:
#include <neighbors/detail/cagra/search_plan.cuh>
#include <iostream>
int main()
{
namespace cagra = cuvs::neighbors::cagra;
raft::resources res;
cagra::search_params params;
params.algo = cagra::search_algo::MULTI_KERNEL;
params.hashmap_mode = cagra::hash_mode::AUTO;
params.itopk_size = 3872;
params.search_width = 8;
params.max_queries = 0; // Planner-only inspection, no query allocation.
params.max_iterations = 16777216;
using plan_type = cagra::detail::search_plan_impl<
float, uint32_t, float, cuvs::neighbors::filtering::none_sample_filter>;
cagra::detail::dataset_descriptor_host<float, uint32_t, float> descriptor{};
plan_type plan(res, params, descriptor, 32, 1000, 32, 10);
const uint64_t requested = params.itopk_size + uint64_t{8} * 32 * params.max_iterations;
std::cout << "requested=" << requested
<< " narrowed=" << static_cast<uint32_t>(requested)
<< " small_hash_bitlen=" << plan.small_hash_bitlen
<< " hash_bitlen=" << plan.hash_bitlen << '\n';
}
Observed output
requested=4294971168 narrowed=3872 small_hash_bitlen=0 hash_bitlen=13
The full estimate is 2^32 + 3872; narrowing discards 2^32. The selected table has 8192 entries. Changing only max_iterations to 1000000 produces a non-wrapping estimate of 256003872 and correctly throws the existing hash-size error.
Expected behavior
Reject estimates that exceed the supported normal-hash capacity, including estimates above UINT32_MAX. Preserve checked, sufficiently wide arithmetic through the capacity check rather than narrowing before it. The normal-hash limit is 2^20 entries, with an effective capacity of 2^19 at the default fill rate.
Environment details (please complete the following information):
- Bare-metal Linux x86_64, NVIDIA RTX PRO 6000 Blackwell server.
- Source inspection of main at
0396eb462c3dd9dafb04759688ac72c1d049b71fconfirms the same narrowing conversion. - Planner reproduction compiled against #2533's source at
5dcf228649333c96dbb37d2e2facfeb143cbbf4dplus main's unrelated wheel-size update, using the existing local CUDA/RAFT/RMM development environment.
Additional context
The planner acceptance and selected hash size were reproduced directly. No end-to-end search with these extreme parameters was run, so downstream hangs, memory safety problems, or result errors are not established by this report. The issue is the wrapped sizing estimate and missing rejection, not evidence that an ordinary search visits that many nodes.
- Ngôn ngữ chính
- Cuda
- Star
- 902
- Fork
- 267
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 57
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/cuvs
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] CAGRA multi-CTA and multi-kernel search over-allocate the hashmap they useCó thể đã có người làm @mc8max đã nhận 12 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NVIDIA/cuvs#2856 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] cuVS Bench Faiss CAGRA b_ratio reads the wrong JSON keyCó thể đã có người làm @arcusbuilds đã nhận 55 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
doc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Upgrade faiss to v1.16.0Có thể đã có người làm @aamijar đã nhận 8 ngày trước. Đang mởfaiss improvement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openclaw/openclaw#205598 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
awslabs/social-messaging-agent-runtime-toolkit#257 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
agents bug workspace
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG][Agent.interactive][The input typed after the last loop is recorded but never answered]Có thể đã có người làm @ayaangazali đã nhận hôm nay. Đang mởai-generated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày