Repository navigation
Conversation
Signed-off-by: Frank Lai <frlai@nvidia.com>
Signed-off-by: Frank Lai <frlai@nvidia.com>
Signed-off-by: Frank Lai <frlai@nvidia.com>
Signed-off-by: Frank Lai <frlai@nvidia.com>
frlai
force-pushed
the
feature/view-mutation-functionalization
branch
2 times, most recently
from
October 21, 2026 23:37
d704152 to
f6a0581
Compare
malwan-nv
requested changes
Oct 21, 2026
Comment on lines
+92
to
+94
| if old.node is not new.node: | ||
| mutation = old.tracer.create_proxy( | ||
| "call_method", "copy_", (old, new), {} |
Collaborator
There was a problem hiding this comment.
The existing full-replacement path in _handle_plain_assignment() assigns dest_proxy = value.proxy, and _record_assignment() then skips the copy. Consequently, buf.copy_(x) gives two independent tensors the same FX proxy. With this new setter, a subsequent buf += 5 records a write into that shared proxy, so returning (x, buf) produces (x + 5, x + 5) instead of (x, x + 5). Previously, updating the destination's proxy only rebound its reference.
Signed-off-by: Frank Lai <frlai@nvidia.com>
Signed-off-by: Frank Lai <frlai@nvidia.com>
frlai
commented
Oct 22, 2026
Signed-off-by: Frank Lai <frlai@nvidia.com>
This was referenced Oct 22, 2026
* fix: normalize slice bounds after view functionalization Signed-off-by: Frank Lai <frlai@nvidia.com> * refactor: separate ATen rewrites from traced node Signed-off-by: Frank Lai <frlai@nvidia.com> * refactor: group functionalization with ATen rewrites Signed-off-by: Frank Lai <frlai@nvidia.com> * refactor: separate ATen matching from graph edits Signed-off-by: Frank Lai <frlai@nvidia.com> --------- Signed-off-by: Frank Lai <frlai@nvidia.com>
This branch has not been deployed
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.
Mutating a separately held slice or reshaped view previously updated eager storage but could disappear from the exported graph, leaving base and sibling outputs incorrect. Preserve these relationships for Torch and NumPy, including supported Torch-view/Warp boundaries.
Record ordered updates on stable tensor handles, then use PyTorch export functionalization before pruning output dependencies. Import only user outputs from the export signature so artifacts return updated values without copying mutations into caller inputs. Preserve independent copies across NumPy dtype conversion and Torch/NumPy/Warp conversions, distinguish new Warp allocations from writes, and recompute runner output masks after graph normalization.
Keep FX/TorchScript support for tensor-valued slice bounds when an exporter cannot functionalize them: retain native mutations on per-call copies rather than freezing runtime indices. PT2/ONNX retain their exporter restrictions. Torch-backed partial Warp/APIC views now bind the full traced allocation in both directions; arbitrary Warp-native views remain outside this support.
For Warp versions exposing allocation-wide Torch storage bounds, record weak allocation identity and layout on existing FX nodes, resolve partial views through their graph ancestors, and deduplicate segment input and output bindings. Keep original kernel offsets/strides in APIC and use the existing mutation functionalization to propagate writes. This handles offset, nested, strided and compound views, including sibling mutations and real Warp writes, without per-view storage-root attributes or retained tensor samples. Reject missing covering graph values and dtype reinterpretation. Keep two representative functional tests in the existing shared-array test file: NumPy view mutation with state feedback, and Torch/Warp sliced-allocation replay through ONNX/PT2. The broader view/copy matrix remains in unit tests.
Keep explicit NumPy casts before the same-dtype copy when integrating the ATen adapter: imported graph intermediates can have different dtype metadata from native NumPy samples. Preserve both the requested dtype and independent storage.
Raise the minimum PyTorch version from 2.6.0 to 2.7.0, with matching dependency metadata, lockfile, README, and installation documentation. The broad version matrix exposed two existing boolean-mask ONNX export regressions only on 2.6; all tested 2.7+ releases pass without a compatibility workaround. Add Torch/NumPy coverage for differing copy layouts and ONNX replay with boolean-mask cardinalities 0, 1, 2, and 4.
Current test-consolidation validation:
Validation before the functional-test consolidation, on rebased develop
1a749d30409d3196f95558063f200f373fa9aab6(includes the NumPy ATen adapter):Earlier verification before the NumPy-adapter rebase (retained as historical results, not rerun matrices):
GPU validation used isolated runtime adapters matched to each Warp release and the installed Torch 2.14 stack (C++20 locally for current Torch headers). Runtime build sources are unchanged by this PR. Negative NumPy slicing remains excluded because it is handled by a separate PR.