Skip to content

[Common] Decouple Ignored Scope and Introduce Scope Class - #4236

Merged
andrey-churkin merged 10 commits into
openvinotoolkit:developfrom
anzr299:an/custom_annotation_scope_generalization
Oct 12, 2026
Merged

andrey-churkin merged 10 commits into
openvinotoolkit:developfrom
anzr299:an/custom_annotation_scope_generalization

Conversation

@anzr299

@anzr299 anzr299 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

Generalize the Ignored scope class and also the util functions for ignored scope.

Reason for changes

To support custom annotation

Related tickets

180366
#4171

Tests

Weight compression - success

Test examples - success

@anzr299
anzr299 requested a review from a team as a code owner September 24, 2026 14:37
@anzr299
anzr299 requested review from AlexanderDokuchaev and a lite review from Copilot September 24, 2026 14:37
@github-actions github-actions Bot added the NNCF Common Pull request that updates NNCF Common label Sep 24, 2026
@github-actions github-actions Bot added the API Public API-impacting changes label Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

This PR introduces a shared BaseScope to generalize scope handling and support custom annotations while preserving ignored-scope behavior.

Changes:

  • Generalizes scope matching, validation, and difference utilities.
  • Updates quantization, pruning, OpenVINO, and sparsification callers.
  • Updates related scope tests.
File Description
tests/​common/​test_scopes.py Updates scope difference tests.
tests/​common/​test_ignored_scope.py Updates scope matching tests.
src/​nncf/​torch/​function_hook/​pruning/​prune_model.py Uses generalized node matching.
src/​nncf/​scopes.py Adds BaseScope and generalized utilities.
src/​nncf/​quantization/​algorithms/​weight_compression/​algorithm.py Uses generalized scope matching.
src/​nncf/​quantization/​algorithms/​min_max/​algorithm.py Uses generalized scope matching.
src/​nncf/​openvino/​quantization/​quantize_model.py Uses generalized scope validation.
src/​nncf/​experimental/​torch/​sparsify_activations/​target_scope.py Uses generalized scope utilities.
src/​nncf/​experimental/​torch/​sparsify_activations/​sparsify_activations_impl.py Uses generalized node matching.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/nncf/scopes.py Resolved
Comment thread src/nncf/scopes.py Resolved
@anzr299 anzr299 changed the title [Common] Decouple Ignored Scope and Introduce BaseScope Class [Common] Decouple Ignored Scope and Introduce Scope Class Sep 29, 2026
…lls of ignored scope to scope so deprecation warning is not shown
@andrey-churkin
andrey-churkin self-requested a review October 1, 2026 11:04
Comment thread src/nncf/common/scopes.py Resolved
@andrey-churkin
andrey-churkin merged commit c3e9b33 into openvinotoolkit:develop Oct 12, 2026
18 checks passed
AlexanderDokuchaev pushed a commit to AlexanderDokuchaev/nncf that referenced this pull request Oct 12, 2026
…olkit#4236)

### Changes

Generalize the Ignored scope class and also the util functions for
ignored scope.

### Reason for changes

To support custom annotation

### Related tickets

180366
openvinotoolkit#4171

### Tests

<!--- How was the correctness of changes tested and whether new tests
were added -->

[Weight
compression](https://github.com/openvinotoolkit/nncf/actions/runs/38215194704)
- success

[Test
examples](https://github.com/openvinotoolkit/nncf/actions/runs/38219209741)
- queued
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Public API-impacting changes NNCF Common Pull request that updates NNCF Common

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants