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

[TorchFX]: Test Fast Bias Correction algorithm #2812

Merged
merged 12 commits into from
Jul 30, 2024
Merged

[TorchFX]: Test Fast Bias Correction algorithm #2812

merged 12 commits into from
Jul 30, 2024

Conversation

anzr299
Copy link
Collaborator

@anzr299 anzr299 commented Jul 15, 2024

Changes

Add Fast BC test in tests/torch/fx.

Related tickets

#2809

Tests

The implemented test class inherits from the template for Fast bias correction.

@anzr299 anzr299 requested a review from a team as a code owner July 15, 2024 09:41
@github-actions github-actions bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF Common Pull request that updates NNCF Common experimental NNCF PTQ Pull requests that updates NNCF PTQ labels Jul 15, 2024
@anzr299 anzr299 marked this pull request as draft July 15, 2024 11:10
@anzr299 anzr299 marked this pull request as ready for review July 22, 2024 10:43
@daniil-lyakhov
Copy link
Collaborator

@anzr299, Nice work!

@anzr299 anzr299 requested a review from daniil-lyakhov July 22, 2024 14:44
nncf/experimental/torch/fx/helpers.py Outdated Show resolved Hide resolved
from nncf.torch.model_graph_manager import find_const_node_in_constant_subgraph


def is_node_with_bias(node: NNCFNode, nncf_graph: NNCFGraph) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anzr299, @daniil-lyakhov, it looks like, this is general functions and can be used in the fast bias correction. Please consider possible refactoring to use functions in the NNCF algorithms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed it for this PR for now. We can add it back in a follow up PR when refactoring

@daniil-lyakhov
Copy link
Collaborator

@anzr299, please rebase your changes

@anzr299 anzr299 closed this Jul 26, 2024
@anzr299 anzr299 reopened this Jul 26, 2024
@github-actions github-actions bot removed NNCF Common Pull request that updates NNCF Common NNCF PTQ Pull requests that updates NNCF PTQ labels Jul 26, 2024
@anzr299
Copy link
Collaborator Author

anzr299 commented Jul 26, 2024

@anzr299, please rebase your changes

Done

nncf/experimental/torch/fx/transformations.py Outdated Show resolved Hide resolved
nncf/experimental/torch/fx/transformations.py Outdated Show resolved Hide resolved
nncf/experimental/torch/fx/transformations.py Outdated Show resolved Hide resolved
tests/torch/fx/test_fast_bias_correction.py Outdated Show resolved Hide resolved
tests/torch/fx/test_fast_bias_correction.py Outdated Show resolved Hide resolved

@staticmethod
def backend_specific_model(model: torch.nn.Module, tmp_dir: str):
fx_model = TestTorchFXFBCAlgorithm._get_fx_model(model)
Copy link
Collaborator

@daniil-lyakhov daniil-lyakhov Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move code from _get_fx_model to the backend_specific_model` function

@daniil-lyakhov daniil-lyakhov requested a review from alexsu52 July 29, 2024 13:43
Copy link
Contributor

@alexsu52 alexsu52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexsu52 alexsu52 merged commit 2a0a93e into openvinotoolkit:develop Jul 30, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental NNCF PT Pull requests that updates NNCF PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants