-
Notifications
You must be signed in to change notification settings - Fork 54
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
Replace max tensor with max cut #1295
Conversation
Replace ActivationMaxCutUtilization with a function. Some fixes.
model_compression_toolkit/core/common/graph/memory_graph/memory_graph.py
Outdated
Show resolved
Hide resolved
model_compression_toolkit/core/common/mixed_precision/mixed_precision_search_manager.py
Outdated
Show resolved
Hide resolved
model_compression_toolkit/core/common/mixed_precision/mixed_precision_search_manager.py
Outdated
Show resolved
Hide resolved
model_compression_toolkit/core/common/mixed_precision/mixed_precision_search_manager.py
Outdated
Show resolved
Hide resolved
model_compression_toolkit/core/common/mixed_precision/mixed_precision_search_manager.py
Outdated
Show resolved
Hide resolved
tests/pytorch_tests/model_tests/feature_models/mixed_precision_activation_test.py
Show resolved
Hide resolved
tests/pytorch_tests/model_tests/feature_models/mixed_precision_activation_test.py
Show resolved
Hide resolved
tests/keras_tests/feature_networks_tests/feature_networks/activation_16bit_test.py
Outdated
Show resolved
Hide resolved
model_compression_toolkit/core/common/mixed_precision/resource_utilization_tools/ru_methods.py
Outdated
Show resolved
Hide resolved
model_compression_toolkit/core/common/mixed_precision/resource_utilization_tools/ru_methods.py
Outdated
Show resolved
Hide resolved
..._toolkit/core/common/mixed_precision/resource_utilization_tools/resource_utilization_data.py
Outdated
Show resolved
Hide resolved
..._toolkit/core/common/mixed_precision/resource_utilization_tools/resource_utilization_data.py
Outdated
Show resolved
Hide resolved
..._toolkit/core/common/mixed_precision/resource_utilization_tools/resource_utilization_data.py
Outdated
Show resolved
Hide resolved
..._toolkit/core/common/mixed_precision/resource_utilization_tools/resource_utilization_data.py
Show resolved
Hide resolved
..._toolkit/core/common/mixed_precision/resource_utilization_tools/resource_utilization_data.py
Outdated
Show resolved
Hide resolved
..._toolkit/core/common/mixed_precision/resource_utilization_tools/resource_utilization_data.py
Outdated
Show resolved
Hide resolved
Fix PR comments.
Fix test name typo.
Add TODO for future PR.
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.
Mostly comments regarding TODOs that can be handled in the next PR.
Two other things:
- Most of the "TODOs" for non-cover code lines need to be covered
- We need to remember to insert an "experimental" message (or even as part of the RU target API?) for using the mp with max cut feature (also in the next PR)
@@ -154,6 +154,9 @@ def solve(self, estimate_factor: float, iter_limit: int = 500) -> Tuple[List[Bas | |||
cut_route = routes[next_cut] | |||
|
|||
if next_cut == self.target_cut: | |||
# TODO maxcut: Why do we filter the cuts (cut_route) but not the max cut size (cut_sost). | |||
# This is a mismatch between max_cut and max(cuts). | |||
# Also, unfiltered cut_route seems perfect, including input and output tensor sizes of current op. |
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.
regarding the first question - seems like a bug, the max cut size should match the size of the remained memory elements in the cut.
regarding the filtering - it is possible that there is an issue here, but basically, it is not that we are removing input tensor sizes is that we remove memory elements of operations that have no other operations that are dependent on them that hasn't been computed yet. So we need to look further into it before just removing the filtering
@@ -71,6 +82,7 @@ def __init__(self, model_graph: Graph): | |||
inputs_tensors_memory = [sum([t.total_size for t in self.operation_node_children(n)]) | |||
for n in nodes if n in model_graph.get_inputs()] | |||
|
|||
# TODO maxcut: why both inputs and outputs of each nodes, while the A* solves for node outputs only??? |
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.
We need to deeply get into the algorithm to understand this.
If it is not giving you trouble then leave it for now.
Or, create some unittest that you for sure know what the result should be and see if changing this code according to what you think it should be changes the result.
Pull Request Description:
Replace max tensor with max cut in resource utilization.
Checklist before requesting a review: