However, the order of RGNode.inputs still needs a clear definition, especially to guarantee that dump and load give a deterministic result. Otherwise saving and loading weights may cause mismatch.
My guess is that preserving the insertion order (which is currently implemented) is enough, but I haven't had a proof.
(PS: how should we tag an open question that requires further investigation like this?)
lo-pri unless we're running into problems with this
We'd better have a total ordering of
RGNode
so that the order of nodes is always static.A partial ordering that's newly introduced already helps a lot with maintaining RG structure and doing topo sorting. https://github.com/april-tools/cirkit/blob/085d95a408884652c72e5b9be3eb25a1380022e1/cirkit/new/region_graph/rg_node.py#L41-L70
However, the order of
RGNode.inputs
still needs a clear definition, especially to guarantee that dump and load give a deterministic result. Otherwise saving and loading weights may cause mismatch.My guess is that preserving the insertion order (which is currently implemented) is enough, but I haven't had a proof.
(PS: how should we tag an open question that requires further investigation like this?)