Skip to content

[REVIEW] Fix padded dataset creation for aligned device tensors - #2501

Open
Sharon05564 wants to merge 1 commit into
NVIDIA:mainfrom
Sharon05564:fix/cuvs-2482-padded-dataset
Open

[REVIEW] Fix padded dataset creation for aligned device tensors#2501
Sharon05564 wants to merge 1 commit into
NVIDIA:mainfrom
Sharon05564:fix/cuvs-2482-padded-dataset

Conversation

@Sharon05564

Copy link
Copy Markdown

Description

Fixes cuvsDatasetMakePadded() rejecting device tensors whose row stride already satisfies the required padding alignment.

Previously, an already-aligned device tensor caused the padded-dataset helper to return an error and the Python binding worked around this by inspecting the error message and falling back to a non-owning padded view.

This change:

  • adds an opt-in force_copy path to the padded-dataset helpers
  • makes the C API use that path so cuvsDatasetMakePadded() always returns an owning copy
  • preserves the existing default behavior for C++ callers
  • removes the Python error-string fallback
  • adds regression coverage for already-aligned device tensors
  • verifies that cuvsDatasetMakePaddedView() remains a non-owning alias

Testing

Added/updated C++ and Python regression tests covering the aligned-device case and padded-view behavior.

Local static, Cython, formatting, and Python checks passed. CUDA/C++ runtime tests could not be run locally because the development environment does not have a CUDA toolkit or GPU, so those checks are left to project CI.

Fixes #2482

@Sharon05564
Sharon05564 requested review from a team as code owners August 25, 2026 02:13
@copy-pr-bot

copy-pr-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Sharon05564

Copy link
Copy Markdown
Author

Hi! The label checker is currently failing because the PR is missing the required category and breaking-change labels. Could a maintainer please add the appropriate labels? This is a bug fix and is intended to be non-breaking. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] cuvsDatasetMakePadded rejects an already-aligned device tensor

1 participant