-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrected condition for matching recurrent nodes (#1998)
### Changes The node is considered within iteration scope if the correspondent module name fully matches the registered names of registered recurrent modules (LSTM, GRU cells). Previously, there was a less strict rule: the name of the iteration module should include the name of the considered module. ### Reason for changes The problem appeared with `RecurrentDecoder` with a customer model: https://github.com/PeterL1n/RobustVideoMatting/blob/master/model/model.py#L26C28-L26C44 FQ should be propagated up through `concat` and `strided slice`, but it was mistakenly considered within iteration scope and added to ignored scope for quantization. The concat's scope is `205 MattingNetwork/RecurrentDecoder[decoder2]/OutputBlock[decode0]/cat_0` It matched with one of the registered iteration scopes – `Recurrent`. With a corrected condition, it's not matched. ![image](https://github.com/openvinotoolkit/nncf/assets/4014476/84d1a79a-45ad-4713-8064-20fa9f0fa9fa) ![image](https://github.com/openvinotoolkit/nncf/assets/4014476/b0108a68-ed3f-4554-b55a-eed8a4a95259) ### Related tickets 112934 ### Tests synthetic tests for model with Recurrent in the name
- Loading branch information
1 parent
459e724
commit 5179553
Showing
6 changed files
with
64 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...orch/data/reference_graphs/quantized/synthetic_model/OrdinaryModelWithRecurrentInName.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
strict digraph { | ||
"0 /nncf_model_input_0" [id=0, type=nncf_model_input]; | ||
"1 SymmetricQuantizer/symmetric_quantize_0" [id=1, type=symmetric_quantize]; | ||
"2 OrdinaryModelWithRecurrentInName/__getitem___0" [id=2, type=__getitem__]; | ||
"3 OrdinaryModelWithRecurrentInName/NNCFConv2d[conv]/ModuleDict[pre_ops]/UpdateWeight[0]/SymmetricQuantizer[op]/symmetric_quantize_0" [id=3, type=symmetric_quantize]; | ||
"4 OrdinaryModelWithRecurrentInName/NNCFConv2d[conv]/conv2d_0" [id=4, type=conv2d]; | ||
"5 /nncf_model_output_0" [id=5, type=nncf_model_output]; | ||
"0 /nncf_model_input_0" -> "1 SymmetricQuantizer/symmetric_quantize_0"; | ||
"1 SymmetricQuantizer/symmetric_quantize_0" -> "2 OrdinaryModelWithRecurrentInName/__getitem___0"; | ||
"2 OrdinaryModelWithRecurrentInName/__getitem___0" -> "4 OrdinaryModelWithRecurrentInName/NNCFConv2d[conv]/conv2d_0"; | ||
"3 OrdinaryModelWithRecurrentInName/NNCFConv2d[conv]/ModuleDict[pre_ops]/UpdateWeight[0]/SymmetricQuantizer[op]/symmetric_quantize_0" -> "4 OrdinaryModelWithRecurrentInName/NNCFConv2d[conv]/conv2d_0"; | ||
"4 OrdinaryModelWithRecurrentInName/NNCFConv2d[conv]/conv2d_0" -> "5 /nncf_model_output_0"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters