-
Notifications
You must be signed in to change notification settings - Fork 240
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
Dynamic OV model builder #3137
base: develop
Are you sure you want to change the base?
Dynamic OV model builder #3137
Conversation
This reverts commit abf07e9.
# We have to have args as the inputs since all of them are nodes and are required to be as input. | ||
args = [clone_nodes.popleft() for _ in graph_node.inputs()] | ||
|
||
clone_node = self._node_factory.create(node_type, args, attrs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, NodeFactory
will create nodes without names since naming is done using a decorator (see https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/src/openvino/utils/decorators.py#L25-L34).
It shouldn't be a problem, since the FastBC algorithm utilizes Parameter
and Result
nodes for statistics. But for BiasCorrection algorithm utilizes the names.
The current approach may be changed by adding the corresponding constructor calls into metatypes, for example, for each layer.
if node_mapping is None: | ||
node_mapping = {op.get_friendly_name(): op for op in model.get_ops()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to avoid failures for the algorithms that utilize get_bias_value
, but without mapping for now.
def extract_submodel(self, model_transformer, input_id, output_id): | ||
|
||
return self._model_builder.build( | ||
input_ids=[input_id], | ||
output_ids=[output_id], | ||
node_mapping=self._node_mapping, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep the original behaviour of the other backends and reduce code changing, the overloading approach was used here.
@alexsu52, @andrey-churkin, could you please review not PR (need to discuss a number of questions), but the proposal of the new graph-building approach (for FastBiasCorrection and as the possible extension of the BiasCorrection)? Thanks. |
Changes
ModelBuilder
class.Reason for changes
Related tickets
Tests