Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
daniil-lyakhov committed Oct 17, 2024
1 parent 52352f8 commit ccbe0f6
Show file tree
Hide file tree
Showing 4 changed files with 7,521 additions and 8,915 deletions.
2 changes: 2 additions & 0 deletions nncf/experimental/torch/fx/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import nncf
from nncf.common.graph.graph import NNCFNode
from nncf.common.graph.transformations.commands import TargetType
from nncf.experimental.torch.fx.constant_folding import constant_fold
from nncf.experimental.torch.fx.node_utils import get_graph_node_by_name
from nncf.experimental.torch.fx.node_utils import get_tensor_constant_from_node
from nncf.torch.graph.transformations.commands import PTTargetPoint
Expand Down Expand Up @@ -538,6 +539,7 @@ def apply_quantization_transformations(model: torch.fx.GraphModule) -> None:
# to make it easier for algorithms to work
# with the target graph BatchNorm operations
# are being fused
constant_fold(model)
fuse_conv_bn(model)
separate_conv_and_bias(model)
separate_linear_and_bias(model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from torch._export import capture_pre_autograd_graph
from torchvision import models

from nncf.experimental.torch.fx.constant_folding import constant_fold
from nncf.torch import disable_patching
from tests.post_training.pipelines.base import PT_BACKENDS
from tests.post_training.pipelines.base import BackendType
Expand Down Expand Up @@ -80,7 +79,6 @@ def prepare_model(self) -> None:
with torch.no_grad():
with disable_patching():
self.model = self.model_params.export_fn(model, (self.dummy_tensor,))
constant_fold(self.model)

elif self.backend in PT_BACKENDS:
self.model = model
Expand Down
Loading

0 comments on commit ccbe0f6

Please sign in to comment.