-
Notifications
You must be signed in to change notification settings - Fork 237
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
question about insert point #650
Comments
Greetings, @jylansesuifeng! NNCF currently does not provide a user-facing interface to put fake quantizers into arbitrary locations. The reasoning for this is that the best-performing model actually has to have all inputs of all of its low-precision compatible nodes quantized, and an arbitrary fake quantizer setup may actually end up quantizing only half of an operation's inputs due to non-locality of the fake quantizer's effect on downstream ops. We therefore primarily concern ourselves with quantizing all inputs of the required operations when preparing a quantizer setup, and not the outputs. This is done in the following manner - all operations that must have their inputs quantized have FQs placed directly at their inputs first, and then all such FQs are propagated upwards in the model's control flow graph. You may set up "ignored_scopes" in the quantization algo's config parameters; adding an op to "ignored_scopes" will mean that a) if the op is inputs-quantizable, then no FQs will actually be added to the op's inputs to propagate upwards, and b) if the op is input-agnostic, such as maxpool or concat, then the downstream FQs will not propagate upwards through the associated operation. If you craft the "ignored_scopes" correctly, you may achieve the control you desire over the resulting FQ setup. Alternatively, you may try to use |
I put fake quantizers into arbitrary locations via pattern-based quantization, however, which has been removed in the last NNCF. I would be appreciated it if nncf could provide some flexible APIs to add custom FQ for the propagation-based quantization. |
@vshampor It's been a long while since the last comment; Has the suggested API been implemented? If not, can we make an issue that requires someone to make an API for creating custom Fake Quantizers? |
Ref. 138688 |
Hello, I use NNCF recently and I am wondering, if it is possible to insert a fake quantizer in a self-defined position, for example:
looking forward to your reply, many thanks!
The text was updated successfully, but these errors were encountered: