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

changing required_mp check to enable mp whenever any target but weights is restricted and moving 16bit experimental message #1332

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def compute_resource_utilization(self,
w_total, *_ = self.compute_weights_utilization(target_criterion, bitwidth_mode, w_qcs)

if {RUTarget.ACTIVATION, RUTarget.TOTAL}.intersection(ru_targets):
Logger.warning("Using an experimental feature max-cut for activation memory utilization estimation.")
a_total = self.compute_activations_utilization(target_criterion, bitwidth_mode, act_qcs)

ru = ResourceUtilization()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from model_compression_toolkit.core.common.mixed_precision.resource_utilization_tools.resource_utilization_calculator import \
ResourceUtilizationCalculator, BitwidthMode, TargetInclusionCriterion
from model_compression_toolkit.core.graph_prep_runner import graph_preparation_runner
from model_compression_toolkit.logger import Logger
from model_compression_toolkit.target_platform_capabilities import FrameworkQuantizationCapabilities


Expand Down Expand Up @@ -104,6 +105,13 @@ def requires_mixed_precision(in_model: Any,

Returns: A boolean indicating if mixed precision is needed.
"""

if target_resource_utilization.activation_restricted() or target_resource_utilization.total_mem_restricted():
Logger.warning("Using an experimental feature max-cut for activation memory utilization estimation.")
return True
if target_resource_utilization.bops_restricted():
return True

core_config = _create_core_config_for_ru(core_config)

transformed_graph = graph_preparation_runner(in_model,
Expand Down
Loading