-
Notifications
You must be signed in to change notification settings - Fork 280
nncf.build_graph #3817
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
nncf.build_graph #3817
Conversation
8aa44b4 to
93b52ed
Compare
|
|
||
| from nncf.common.factory import NNCFGraphFactory | ||
| from nncf.common.factory import StatisticsAggregatorFactory | ||
| from nncf.common.factory import build_graph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about testing short import since it's API now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, use nncf.build_graph instead of direct import
| :param current_id: Current graph id. | ||
| """ | ||
| graphs[current_id] = NNCFGraphFactory.create(model) | ||
| graphs[current_id] = build_graph(model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is to directly import the build_graph() method in the remaining code, and avoid using nncf.build_graph() in internal modules. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've missed the comment from @ljaljushkin. Anyway, in my opinion, it's better to use a direct import and test the API call somewhere in the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, updated
7a5636b to
8640b45
Compare
commit 7438f86 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Wed Jan 7 15:43:50 2026 +0400 [PT] merge tests folders (openvinotoolkit#3821) Merge `tests/torch2` to `tests/torch` Removed unused code and data commit b7ba152 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Wed Jan 7 14:17:02 2026 +0400 [CI] notebooks (openvinotoolkit#3813) - Format notebooks by pre-commit - Update profiller.py according [PyGuide.md](https://github.com/openvinotoolkit/nncf/blob/develop/docs/styleguide/PyGuide.md) - Set strict version in tools/requirements.txt commit 1bb59cf Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Wed Jan 7 14:13:55 2026 +0400 [doc] Ignored scope (openvinotoolkit#3818) Add documentation about using ignored scope. CVS-177621 commit 0c1054b Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Jan 7 14:10:19 2026 +0400 Bump astral-sh/setup-uv from 7.1.6 to 7.2.0 (openvinotoolkit#3831) Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 7.1.6 to 7.2.0. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 7ca2ad6 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Tue Jan 6 14:16:02 2026 +0400 Copyrights 2026 (openvinotoolkit#3830) commit cdc19f8 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Mon Jan 5 19:39:34 2026 +0400 Rework HWConfig (openvinotoolkit#3793) Replace JSON-based configuration loading with a Python-style HW Config. Simplifies modification and maintenance by keeping configuration logic in Python code instead of external JSON files. https://github.com/openvinotoolkit/nncf/actions/runs/20596514331 manual/job/post_training_quantization/767/ https://github.com/openvinotoolkit/nncf/actions/runs/20596794339 commit 2c4aaae Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Mon Jan 5 19:38:26 2026 +0400 [PT] prune + quantize (openvinotoolkit#3811) - Support quantization after pruning - Renamed `apply_magnitude_sparsity_binary_mask` to `apply_magnitude_binary_mask` - `wrap_model` don not raise error if model already wrapped - `find_const_node_in_constant_subgraph` can find weight after pruning operations CVS-171577 commit f1c33f8 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Mon Jan 5 19:25:56 2026 +0400 nncf.build_graph (openvinotoolkit#3817) Replace `NNCFGraphFactory` to `nncf.build_graph` Suggestion of new api function `nncf.build_graph` to provide a simple way to get NNCFGraph for users. commit 1dc3d48 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Mon Jan 5 19:16:38 2026 +0400 [PT] Build graph for unwrapped model (openvinotoolkit#3822) Add support of unwrapped model to build graph commit 89f4a53 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Mon Jan 5 19:16:23 2026 +0400 Add test to validate version of package (openvinotoolkit#3825) To avoid merge auto-generated version. commit 9ee5c14 Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Mon Jan 5 15:56:25 2026 +0400 [CI] nightly tests on ubuntu (openvinotoolkit#3826) Run tests on ubuntu in nightly jobs Tests currently run on Ubuntu for pull requests and on a weekly schedule. This change ensures the develop branch is also continuously validated and remains stable. https://github.com/openvinotoolkit/nncf/actions/runs/20711605556 commit 329892c Author: Daniil Lyakhov <daniil.lyakhov@intel.com> Date: Mon Jan 5 12:07:48 2026 +0100 [Collectors] Experimental collectors to common (openvinotoolkit#3761) * Redundant legacy tensor collectors are removed * Experimental tensor collectors moved to common * MyPy fixed for the collector classes * Some reducres/aggregators tests are extended * hash functions for some aggregators are fixed Reduce amount of redundant code, move common tensor collectors to common directory 150471 175176 openvinotoolkit#3041 commit bfe1095 Author: ruro <ruro.ruro@ya.ru> Date: Mon Jan 5 12:45:57 2026 +0300 Fix onnx Attention and torch SDPA quantization handling (openvinotoolkit#3751) - added `ONNXAttentionMetatype` for the opset 23 `Attention` ONNX node - fixed `scaled_dot_product_attention` quantization in `torch2` for the case when `Q`, `K` and `V` are parallel edges coming from the same input node See openvinotoolkit#3750 Fixes openvinotoolkit#3750 - `tests/onnx/quantization/test_graphs.py::test_synthetic_models_graph[AttentionModel]`  - `tests/torch2/function_hook/quantization/test_quantized_graphs.py::test_quantized_graphs[unbind_scaled_dot_product_attention_model]`  commit d21bbdd Author: Alexander Dokuchaev <alexander.dokuchaev@intel.com> Date: Mon Jan 5 11:52:51 2026 +0400 [PT] Add usage documentation about pruning (openvinotoolkit#3809) Add Usage.md Add api markers for relative function CVS-171577 --------- Co-authored-by: Lyalyushkin Nikolay <nikolay.lyalyushkin@intel.com> commit abf1dcd Author: Mostafa <mostafas.main.email@gmail.com> Date: Mon Jan 5 09:34:44 2026 +0200 [NNCF] Add support for element-wise sign operation in tensor functions (openvinotoolkit#3824) Implemented `sign` function support in `src/nncf/tensor/functions/numeric.py`, `src/nncf/tensor/functions/numpy_numeric.py`, and `src/nncf/tensor/functions/torch_numeric.py`. The `sign` function is a fundamental element-wise operation required for various arithmetic manipulations within compression algorithms, including Half Quadratic Quantization. N/A The correctness of the changes was verified by adding a new test case `test_fn_sign` to `TemplateTestNNCFTensorOperators`. Fixes openvinotoolkit#3823 commit 0352237 Author: Daniil Lyakhov <daniil.lyakhov@intel.com> Date: Mon Jan 5 08:01:30 2026 +0100 Happy New Copyright Year 2026🎉🎉🎉 (openvinotoolkit#3820) Copyrights are updated on 2026 year Year number incremented Alles gute in neuer Jahr!
Changes
Replace
NNCFGraphFactorytonncf.build_graphReason for changes
Suggestion of new api function
nncf.build_graphto provide a simple way to get NNCFGraph for users.