openvinotoolkit / openvinotoolkit/nncf

[TorchFX][Optimization] Run eliminate dead code once for constant correction commands

Open
#2,929 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.2k
Forks
305
Avg merge
1d 9h
Merged PRs (30d)
27

Description

🚀 Feature request

https://github.com/openvinotoolkit/nncf/pull/2882/files#r1735077003

  • Look like eliminate_dead_code should be run ones after apply all bias_update transormation.
    Or maybe will be better to use something like self.erase_node(old_constant_node) to remove only old constant node to avoid loops for all nodes.
    As i understand eliminate_dead_code here removes only old constant node. And it's actual for all usage eliminate_dead_code in transformation.py.

  • We can do it, but we should give up on transformations and move to commands for that. Leaf insertion transformation not expecting eliminate_dead_code call yet model transformer could not split bias correction and leaf insertion commands apart

Feature Use Case

No response

Are you going to submit a PR?
  • Yes I'd like to help by submitting a PR!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in transformation.py and trace the TorchFX bias_update transformations and their uses of eliminate_dead_code. Compare the proposed single cleanup after all bias corrections with removing the old constant node or moving to commands; done means the selected approach handles constant correction without unnecessary repeated cleanup or missed node removal.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.