[BUG] Rust DatasetView::new fails on padded rows: cuvsDatasetMakePaddedView only accepts packed rows
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with is_cagra_padded_layout in rust/cuvs/src/dataset.rs, which decides when DatasetView::new calls cuvsDatasetMakePaddedView, then read the packed-row check in c/src/core/detail/interop.hpp around line 99. Reproduce with a 3-column f32 tensor whose strides are [4, 1]. Done means either the padded path accepts that layout, matching the C++ make_device_padded_dataset_view, or DatasetView::new rejects it with a clear error and the docs say so. Pick the direction first, since it decides whether the change is in C or in Rust.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
DatasetView::new decides whether a tensor is padded by reading its row stride (is_cagra_padded_layout). A padded tensor goes to cuvsDatasetMakePaddedView. But that function only accepts packed rows, so a tensor with padded rows always fails:
| Tensor | DatasetView::new picks |
Result |
|---|---|---|
4 f32 columns, packed |
padded view | ✓ |
3 f32 columns, packed |
standard view | ✓ |
3 f32 columns, rows padded to 4 (strides [4, 1]) |
padded view | ✗ Expected a row-major matrix |
Steps/Code to reproduce bug
let res = Resources::new().unwrap();
let mut data = std::ptr::null_mut();
unsafe { cudaMalloc(&mut data, 8 * 4 * size_of::<f32>()) };
let device = DLDevice { device_type: DLDeviceType::kDLCUDA, device_id: 0 };
// 8 rows of 3 columns, each row padded to 4 values.
let view = unsafe {
DLTensorView::from_raw_parts(data, device, &[8, 3], Some(&[4, 1]), f32::dl_dtype())
}
.unwrap();
DatasetView::new(&res, &view).unwrap();
// RAFT failure at .../c/src/core/detail/interop.hpp line=99: Expected a row-major matrix
Expected behavior
Either cuvsDatasetMakePaddedView accepts padded rows, as the C++ make_device_padded_dataset_view does, or DatasetView::new rejects a strided tensor with a clear error and its docs say so.
Environment details
- Bare-metal, RTX 1000 Ada
- conda
libcuvs 26.10.00a61(CUDA 13.3); the code is unchanged at24b0b170
Additional context
Might be related: #2482, #2394 (tracker #2402).
- 主要语言
- Cuda
- 星标
- 902
- 派生
- 267
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 57
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/cuvs 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
[BUG] CAGRA multi-CTA and multi-kernel search over-allocate the hashmap they use可能已有人在做 @mc8max 于 12 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
[BUG] cuVS Bench Faiss CAGRA b_ratio reads the wrong JSON key可能已有人在做 @arcusbuilds 于 55 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
doc
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Upgrade faiss to v1.16.0可能已有人在做 @aamijar 于 8 天前认领。 未关闭faiss improvement
难度 1/5 1 小时以内 新手友好度 86/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
vllm-project/vllm#70030 ·
维护者通常 1 天内回复
-
help wanted small extra
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
t: bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
Retry an empty final answer when Gemini reports MALFORMED_RESPONSE (gemini-4-hydrogen)可能已有人在做 @waleedkadous 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复