[executorch][native] Add Value + index-arena ids to the in-memory IR - #22277
[executorch][native] Add Value + index-arena ids to the in-memory IR#22277SS-JIA wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22277
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 693d4ba with merge base a5f15b5 ( NEW FAILURE - The following job has failed:
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. |
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—NodeId/ValueId, plainint32_tindex-arena aliases pluskInvalid, avalid()helper, and anin_bounds(id, 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.NodeIdindexesGraph.nodes;ValueIdindexesGraph.values.Value(Value.{h,cpp}) — one SSA value (dataflow edge): astd::variantover
std::monostate/TensorMeta/Scalar/std::vector<ValueId>, withthe alternatives declared in
ValueKindorder sokind()is the variant'sindex. Plus def-use wiring (
producer_id/consumer_ids), a storagealias_id, and an openattrs(std::any) scratch map. Construct via theper-kind constructors; read via typed accessors that throw on a kind mismatch.
A
ListholdsValueIds 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