fix: support InfiniRT metadata views - #828
Draft
voltjia wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tensor::ShapeandTensor::Strides, and allow the ATen bridge to consume generic ranges.scripts/generate_torch_ops.pyand extend installed C++ consumer regression coverage.Motivation
InfiniTensor/InfiniRT#38 changes lvalue
TensorView::shape()andstrides()accessors to borrowed metadata views and replaces exactstd::vectoraliases with inline-capacity owning containers. Existing InfiniOps assumptions about exactstd::vectortypes fail at mutable, conditional-expression, pybind, and ATen boundaries. This PR keeps transient paths borrowed and makes ownership explicit only where required.Type of Change
feat- new feature / new operator / new platformfix- bug fixperf- performance improvement (no behavioral change)refactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Smoke Test Result
Test Results on Supported Platforms
Benchmark / Performance Impact
N/A - compatibility fix. Borrowed views remain borrowed on transient paths, explicit copies are limited to owned or mutable metadata, and the Python conversion avoids an intermediate
std::vector.Notes for Reviewers
masterand the metadata-view implementation from InfiniRT refactor: make data type mappings and shared CUDA headers device-aware #38.TensorViewlayout, so matching InfiniRT headers andlibinfinirt.somust be rebuilt and deployed together.std::optional<const at::Tensor>assignment error insrc/torch/ops/flash_attn_with_kvcache/flash_attn.cc. The successful generated ATen build excludes only that handwritten implementation while still compiling all 492 generated ops; this PR does not modify the unrelated failure.tests/test_cpp_api.pyrequires an installed prefix. The reported five tests were run withINFINI_OPS_INSTALL_PREFIXset for each InfiniRT revision.scripts/generate_torch_ops.pyshould be reviewed together.