openvinotoolkit / openvinotoolkit/nncf
[TorchFX] Do not propagate quantizers through `__get_item__` when input/output has different numel
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 305
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 27
Description
🚀 Feature request
Some TorchFX operations are returning a tuple instead of a torch.Tesnor. In case an algorithm requests a statistic from such node nncf will raise an error like tuple has not is_empty method. This affects the yolon11 model, current workaround is the ignored scope with the type of operation which returns a tuple:
nncf.IgnoredScope(types=["__getitem__"])
Solver debug illustration:
The task is to:
- Find a way to automatically detect
__getitem__which have a tuple as an input (or__getitem__which gets a piece of the input tenor, not the whole tensor) and do not propagate quantizers up through such operations.__getitem__which inputnumelis the same as outputnumelshould be marked as quantize-agnostic
Feature Use Case
No response
Are you going to submit a PR?
- Yes I'd like to help by submitting a PR!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the TorchFX getitem quantizer-propagation path and inspect how input and output numel are determined, including tuple-valued inputs. Done means partial or tuple-producing slices no longer propagate quantizers, while operations preserving numel remain quantize-agnostic; add or update focused coverage if the relevant tests are found.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100