-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fix bops calculation #1369
base: main
Are you sure you want to change the base?
Fix bops calculation #1369
Conversation
da666e8
to
8bb1c3d
Compare
@irenaby |
reuse=weights_node.reuse, | ||
reuse_group=weights_node.reuse_group, | ||
quantization_attr=weights_node.quantization_attr, | ||
has_activation=False) | ||
|
||
self.name = f"{VIRTUAL_ACTIVATION_WEIGHTS_NODE_PREFIX}_{act_node.name}_{weights_node.name}" |
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.
isn't this a duplicate? of line 152?
# Conflicts: # tests_pytest/common_tests/unit_tests/core/mixed_precision/resource_utilization_tools/test_resource_utilization_calculator.py # tests_pytest/pytorch_tests/torch_test_util/torch_test_mixin.py
|
||
self.original_activation_node = act_node | ||
self.original_weights_node = weights_node | ||
|
||
v_candidates = [] | ||
kernel_attr = fw_info.get_kernel_op_attributes(weights_node.type)[0] |
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.
Why restrict only to kernel attr? In theory all attr may have candidates.
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.
Not supported, added check that no other atrrs are configurable.
# we don't need the original node (and cannot use it for custom configuration anyway) | ||
a_node = n | ||
else: | ||
a_node = get_input_activation_if_composable(self.graph, n, warn=False) |
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.
In what case will we get here? shouldn't activation nodes followed by kernel nodes be already fused into VirtualActivationWeightsNode
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.
In case we run on the original graph, added comment.
outputs = Dense(10)(x) | ||
return keras.Model(inputs=inputs, outputs=outputs) | ||
|
||
def _build_mult_output_activation_model(self): |
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.
mult input?
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.
its input activation with mult output
|
||
return Model() | ||
|
||
def _build_mult_output_activation_model(self): |
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.
mult input?
Pull Request Description:
Support for bops computation on virtual nodes in RU calculator.
Updated virtual graph substitutions to fix activation & weights RU calculation on virtual graph.
Use RU calculator for bops in mixed precision search.
Added integration tests for RU calculator (framework -> graph preparation -> RU calculator, original vs virtual graph).
Added verification that target RU is satisfied by final RU in MP tests.
Checklist before requesting a review: