Replies: 5 comments 4 replies
-
It seems wrong to me that resource requirements should be separated from the rest of the type signature, but there are certainly more compact encodings if that's the concern here. Resource requirements are metadata only required for type checking, which is true of the types specified for all arguments in the type signature. N.B. resources can only be inferred when the graph is available, which is not always the case! I can imagine a couple of use cases for specifying resource requirements in the type signature (in YAML, from the plugin developer's perspective):
The latter utility might not be necessary, if we can guarantee that the type the plugin developer specifies is the one from the resource that they imported before defining their operations. So if we drop the latter two options, we could represent resource requirements as a field |
Beta Was this translation helpful? Give feedback.
-
There are ramifications here on serializing Opaque ops, too. Here we want to save the signature as part of serializing the OpType. Which would be OK if every OpType was parameterized by the input ResourceSet! The delta also works, as does storing the computed Signature in the node (for every node). However if we pass input resources into OpType::signature() then we kind of want Serde to do the same when serializing the OpType, which looks difficult. |
Beta Was this translation helpful? Give feedback.
-
I'm also moving to reject my earlier argument that the representation should be able to support all the type signatures that we might get by lowering to a Hugr (which would allow, say, one output to be given a nullary Resource even if all the inputs had some resource associated - e.g. if that output were a constant). This is a form of rewrite; and rewrites do change the graph: specifically,
|
Beta Was this translation helpful? Give feedback.
-
One more thought in favour of |
Beta Was this translation helpful? Give feedback.
-
I think this resolved, although additional thoughts in #285 |
Beta Was this translation helpful? Give feedback.
-
Each node's Signature contains two ResourceSets - input and output. Since the Signature is computed by the OpType, we then need every OpType to be parameterized with at least one ResourceSet....right?
That seems annoying, so possible solutions include:
Beta Was this translation helpful? Give feedback.
All reactions