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
marked this pull request as ready for review
October 22, 2026 09:36
frlai
merged commit Oct 22, 2026
914d27a
into
feature/view-mutation-functionalization
5 checks passed
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.
After mutation functionalization, Python slices become ATen slices and enter LEAPP's slice-to-narrow rewrite. The rewrite currently uses raw bounds: on six elements,
x[-3:],x[2:100], andx[4:2]produce invalid narrow lengths instead of the expected suffix, clipped slice, and empty result.Normalize unit-step bounds against the runtime dimension size before calling
torch.narrow: translate negative bounds, clip to[0, size], and make the length nonnegative. Preserveslice_copyallocation independence, including whole-axis copies. A scripted helper retains runtime size arithmetic under legacy tracing. Functionalization, the slice helpers, and the ATen rewrite pass live inleapp/leapp_graph/aten_rewrites.py;TracedTensorNodecontrols when the passes run. The separatefunctionalization.pymodule is removed.rewrite_aten_opsowns traversal, operator identification, applicability checks, and dispatch; module-level helpers perform the selected graph edits. Adding a rewrite means adding its helper and an explicit dispatch branch.This is a stacked draft targeting
feature/view-mutation-functionalization(PR #33), addressing #33 (comment). The independent-buffercopy_aliasing issue remains separate.Validation:
git diff --checkpassed.