Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev committed Mar 7, 2025
1 parent 54d7858 commit 9cb503d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions nncf/experimental/torch2/function_hook/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from nncf.experimental.torch2.function_hook.wrapper import get_hook_storage
from nncf.experimental.torch2.function_hook.wrapper import wrap_model
from nncf.torch.layer_utils import COMPRESSION_MODULES
from nncf.torch.layer_utils import StatefullModuleInterface
from nncf.torch.layer_utils import StatefulModuleInterface

COMPRESSION_STATE_ATTR = "compression_state"
TModel = TypeVar("TModel", bound=nn.Module)
Expand Down Expand Up @@ -61,8 +61,8 @@ def get_config(model: nn.Module) -> Dict[str, Any]:
"Please register your module in the COMPRESSION_MODULES registry."
)
raise nncf.InternalError(msg)
if not isinstance(module, StatefullModuleInterface):
msg = "Support only StatefullModuleInterface modules"
if not isinstance(module, StatefulModuleInterface):
msg = "Support only StatefulModuleInterface modules"
raise nncf.InternalError(msg)

serialized_transformations.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def filter_func(point: StatisticPoint) -> bool:
):
nncf_logger.debug(
f"Skipping channel alignment for pairs {conv_in.node_name}, {conv_out.node_name} "
"because one of the nodes is 1D MatMul, 1D MatMuls is not supported by CA algorithm yet."
"because one of the nodes is 1D MatMul, 1D MatMuls are not supported by CA algorithm yet."
)
continue

Expand Down
4 changes: 2 additions & 2 deletions tests/torch2/function_hook/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from nncf.experimental.torch2.function_hook.wrapper import register_post_function_hook
from nncf.experimental.torch2.function_hook.wrapper import wrap_model
from nncf.torch.layer_utils import COMPRESSION_MODULES
from nncf.torch.layer_utils import StatefullModuleInterface
from nncf.torch.layer_utils import StatefulModuleInterface


class CallCount(torch.nn.Module):
Expand Down Expand Up @@ -165,7 +165,7 @@ def forward(self, x):


@COMPRESSION_MODULES.register()
class HookWithState(torch.nn.Module, StatefullModuleInterface):
class HookWithState(torch.nn.Module, StatefulModuleInterface):
def __init__(self, state: str):
super().__init__()
self._state = state
Expand Down

0 comments on commit 9cb503d

Please sign in to comment.