[executorch][native] Add Node to the in-memory IR - #22279
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22279
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 f1cdf75 with merge base a5f15b5 ( 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):
Adds
ptn::Node, the central IR element: one fx node = one op invocation(
CallFunction) or a graph-boundary marker (Placeholder/Output). It pullstogether the value layer landed so far --
NamedArgument/Argumentforoperands,
ValueIdfor produced values -- and mirrors the schemaNode.Nodeis a plain struct (name,OpKind, target fqn,inputs,outputs, and atransient
attrsscratch map, the fxnode.metaanalog). Two satellite typesland with it:
OpKind(CallFunction / Placeholder / Output), pinned to the schema ids.Output+OutputValueKind(Tensor / TensorList / Int / Bool / Float). Thereturn-ABI grouping is preserved so a later engine-translation stage can tell
a single result from a tuple / list:
topkemits twoTensoroutputs,splitemits oneTensorListoutput,sym_sizeemits anIntoutput.OutputValueKinddeliberately matches the schema's node-level enum name toavoid colliding with the graph-level
OutputKind(user output vs buffermutation) that lands with
Method. The storage-alias fact stays on theproduced
Value, not onOutput..cppholds the one non-trivial member:input_value_ids()walks theArgumentvariants and collects every consumedValueId(tensor args,tensor-list / optional-list elements, and symbolic scalar ids;
kInvalidskipped) for (re)building def-use wiring. The IR printer gains
to_string(const Node&), which renders a single compact line for debugging.Pure std only (no ExecuTorch, no flatbuffers), consistent with the rest of the
standalone
ptnruntime.Differential Revision: D114396763