Skip to content

[executorch][native] Add Value + index-arena ids to the in-memory IR - #22100

Open
SS-JIA wants to merge 1 commit into
gh/SS-JIA/589/basefrom
gh/SS-JIA/589/head
Open

[executorch][native] Add Value + index-arena ids to the in-memory IR#22100
SS-JIA wants to merge 1 commit into
gh/SS-JIA/589/basefrom
gh/SS-JIA/589/head

Conversation

@SS-JIA

@SS-JIA SS-JIA commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Next in-memory IR types for the native runtime, under
backends/native/runtime/graph/:

  • Ids.hNodeRef / ValueRef, plain int32_t index-arena aliases (ET-VK
    vkapi style) plus kInvalid and a valid() helper. NodeRef indexes
    Graph.nodes; ValueRef indexes Graph.values.
  • Value (Value.{h,cpp}) — one SSA value (dataflow edge): a tagged union
    (ValueKind = None / Tensor / Scalar / List) over per-kind members, plus
    def-use wiring (producer / consumers), a storage alias_of, and an open
    attrs (std::any) scratch map. Construct via the tensor / scalar /
    list / none factories; read via typed accessors that throw on a kind
    mismatch. A List holds ValueRefs to its element values (an arena
    grouping), so nesting is via the arena and there is no recursive value type;
    the AOT deserializer builds only Tensor / Scalar / None.

Pure std — no ExecuTorch and no flatbuffers dependency. Mirrored into both the
fbcode/ and xplat/ trees to match the native backend layout.

Authored with Claude Code.

Differential Revision: D114396769

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22100

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 195db91 with merge base 9a2d135 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant