We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c4c16f7 + 3835a37 commit 2281a77Copy full SHA for 2281a77
src/qonnx/transformation/base.py
@@ -107,8 +107,12 @@ def apply(self, model):
107
old_nodes.append(model.graph.node.pop())
108
109
# Execute transformation in parallel
110
- with mp.Pool(self._num_workers) as p:
111
- new_nodes_and_bool = p.map(self.applyNodeLocal, old_nodes, chunksize=1)
+ if self._num_workers > 1:
+ with mp.Pool(self._num_workers) as p:
112
+ new_nodes_and_bool = p.map(self.applyNodeLocal, old_nodes, chunksize=1)
113
+ # execute without mp.Pool in case of 1 worker to simplify debugging
114
+ else:
115
+ new_nodes_and_bool = [self.applyNodeLocal(node) for node in old_nodes]
116
117
# extract nodes and check if the transformation needs to run again
118
# Note: .pop() had initially reversed the node order
0 commit comments