Skip to content

Add as_strided metadata views - #37

Merged
voltjia merged 2 commits into
masterfrom
metadata/as-strided
Jul 28, 2026
Merged

Add as_strided metadata views#37
voltjia merged 2 commits into
masterfrom
metadata/as-strided

Conversation

@voltjia

@voltjia voltjia commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

This change registers aten::as_strided for the PrivateUse1 backend so PyTorch composite view operations such as matrix transpose can create Infini tensors that share their source storage.

The kernel follows PyTorch's native TensorImpl::VIEW construction and uses at::native::setStrided for symbolic metadata validation, negative-stride rejection, storage-offset handling, and storage-bound checks. It performs no data copy and provides no CPU fallback.

The conformance coverage compares matrix transpose against the CPU numerical oracle and verifies explicit and inherited storage offsets, storage aliasing, invalid metadata behavior, and source-storage lifetime. This PR is stacked on #36 because the lifetime behavior depends on the storage ownership established there.

Testing

  • Ruff 0.15.21 and clang-format 19.1.4 checks passed.
  • An installed wheel built against PyTorch 2.12.0+cpu passed the 8 focused tests and the full suite with 170 passed, 42 skipped, and 2 xfailed.
  • An installed wheel built against PyTorch 2.13.0+cpu passed the 8 focused tests and the full suite with 170 passed, 42 skipped, and 2 xfailed.
  • An installed wheel built against PyTorch 2.13.0+cu130 passed all 8 focused tests on an NVIDIA A100-SXM4-80GB with driver 580.105.08 and CUDA toolkit 13.1.80.
  • The NVIDIA InfiniRT and InfiniOps dependencies were rebuilt at commits 95c70080f9551e61241110497d163dfcdf9dc7e7 and 296271487beb594a248fd463e5fff14f7ab74293 with CUDA architecture 80.

@voltjia voltjia mentioned this pull request Jul 27, 2026
Base automatically changed from runtime/operator-storage-lifetime to master July 28, 2026 02:21
@voltjia
voltjia merged commit 8ca0d27 into master Jul 28, 2026
8 checks passed
@voltjia
voltjia deleted the metadata/as-strided branch July 28, 2026 02:22
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.

1 participant