Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Nondeterministic #168

Open
ju-w opened this issue Nov 10, 2023 · 0 comments
Open

[BUG] Nondeterministic #168

ju-w opened this issue Nov 10, 2023 · 0 comments

Comments

@ju-w
Copy link
Contributor

ju-w commented Nov 10, 2023

Hello,

Problem

Consider the example below. Sometimes the graph is created differently and the naming changes. This is especially problematic when saving and loading the state_dict, as the names might not match anymore and loading will fail.

The underlying issue is from topological_order function, as a result of unstable iteration over dictionary.

def topological_order(all_nodes: List[AbstractNode], in_nodes: List[InputNode],

Example
def do():
    nodes =     [       Ff.InputNode(3, 64, 64)]
    nodes.append(       Ff.Node(nodes[-1], Fm.Split, {'section_sizes':[2,1]}))
    split =     [       Ff.Node(nodes[-1].out1, Fm.Flatten, {})]
    nodes.append(       Ff.Node(nodes[-1], Fm.Flatten, {}))
    nodes.append(       Ff.Node(nodes[-1], Fm.PermuteRandom))
    nodes.append(       Ff.Node([nodes[-1].out0]+[split[0].out0], Fm.Concat, {'dim':0}))
    nodes.append(       Ff.OutputNode(nodes[-1]))
    inn = Ff.GraphINN(split+nodes, verbose=1)
    [print(x) for x in inn.state_dict().keys() if "perm_inv" in x]

do()
do()
do()
do()
do()
...
GraphINN(
  (module_list): ModuleList(
    (0): Split()
    (1-2): 2 x Flatten()
    (3): PermuteRandom()
    (4): Concat()
  )
)
module_list.3.perm_inv

GraphINN(
  (module_list): ModuleList(
    (0): Split()
    (1): Flatten()
    (2): PermuteRandom()
    (3): Flatten()
    (4): Concat()
  )
)
module_list.2.perm_inv
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant