[BUG] Rust DatasetView::new fails on padded rows: cuvsDatasetMakePaddedView only accepts packed rows

Đang mở
#2,806 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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, rust
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 at 24b0b170

Additional context

Might be related: #2482, #2394 (tracker #2402).

Generated with Claude Code Reviewed by Human

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/cuvs

Tất cả issue của NVIDIA/cuvs

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.