[executorch][native] Add Value + index-arena ids to the in-memory IR - #22221
[executorch][native] Add Value + index-arena ids to the in-memory IR#22221SS-JIA wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22221
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 441f497 with merge base cf9bcd8 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
digantdesai
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Stack from ghstack (oldest at bottom):
Next in-memory IR types for the native runtime, under
backends/native/runtime/graph/:Ids.h—NodeRef/ValueRef, plainint32_tindex-arena aliases pluskInvalid, avalid()helper, and anin_bounds(ref, size)helper that pairs the validity check with a range checkvia
std::cmp_less, so neither side has to be cast to the other's signedness.NodeRefindexesGraph.nodes;ValueRefindexesGraph.values.Value(Value.{h,cpp}) — one SSA value (dataflow edge): astd::variantover
std::monostate/TensorMeta/Scalar/std::vector<ValueRef>, withthe alternatives declared in
ValueKindorder sokind()is the variant'sindex. Plus def-use wiring (
producer_ref/consumer_refs), a storagealias_ref, and an openattrs(std::any) scratch map. Construct via theper-kind constructors; read via typed accessors that throw on a kind mismatch.
A
ListholdsValueRefs to its element values (an arena grouping), sonesting 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/andxplat/trees to match the native backend layout.Authored with Claude Code.
Differential Revision: D114396769