-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ignored RoPE for ONNX/PT (#3059)
On top of #3049 ### Changes - As stated in the title. - Added Sin and Cos ONNX/PT operations. ### Reason for changes - Accuracy improvement for models with ModelType.TRANSFORMERS type. ### Related tickets - 155511 ### Tests - Added graph test for ONNX/PT.
- Loading branch information
Showing
12 changed files
with
267 additions
and
2 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
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
23 changes: 23 additions & 0 deletions
23
tests/onnx/data/reference_graphs/quantization/synthetic/rope_model.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,23 @@ | ||
strict digraph { | ||
"0 unsqueeze" [id=0, type=Unsqueeze]; | ||
"1 cast" [id=1, type=Cast]; | ||
"2 reshape" [id=2, type=Reshape]; | ||
"3 matmul" [id=3, type=MatMul]; | ||
"4 transpose" [id=4, type=Transpose]; | ||
"5 concat" [id=5, type=Concat]; | ||
"6 sin" [id=6, type=Sin]; | ||
"7 cos" [id=7, type=Cos]; | ||
"8 nncf_model_input_0" [id=8, type=nncf_model_input]; | ||
"9 nncf_model_output_0" [id=9, type=nncf_model_output]; | ||
"10 nncf_model_output_1" [id=10, type=nncf_model_output]; | ||
"0 unsqueeze" -> "1 cast" [label="[1, 10, 1]", style=dashed]; | ||
"1 cast" -> "3 matmul" [label="[1, 10, 1]", style=solid]; | ||
"2 reshape" -> "3 matmul" [label="[1, 5]", style=solid]; | ||
"3 matmul" -> "4 transpose" [label="[1, 10, 5]", style=solid]; | ||
"4 transpose" -> "5 concat" [label="[1, 5, 10]", style=solid]; | ||
"5 concat" -> "6 sin" [label="[1, 5, 10]", style=solid]; | ||
"5 concat" -> "7 cos" [label="[1, 5, 10]", style=solid]; | ||
"6 sin" -> "9 nncf_model_output_0" [label="[1, 5, 10]", style=solid]; | ||
"7 cos" -> "10 nncf_model_output_1" [label="[1, 5, 10]", style=solid]; | ||
"8 nncf_model_input_0" -> "0 unsqueeze" [label="[1, 10]", style=dashed]; | ||
} |
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
21 changes: 21 additions & 0 deletions
21
tests/torch/data/reference_graphs/quantized/ptq/symmetric/rope_model.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,21 @@ | ||
strict digraph { | ||
"0 /nncf_model_input_0" [id=0, type=nncf_model_input]; | ||
"1 RoPEModel/unsqueeze_0" [id=1, type=unsqueeze]; | ||
"2 RoPEModel/reshape_0" [id=2, type=reshape]; | ||
"3 RoPEModel/matmul_0" [id=3, type=matmul]; | ||
"4 RoPEModel/transpose_0" [id=4, type=transpose]; | ||
"5 RoPEModel/cat_0" [id=5, type=cat]; | ||
"6 RoPEModel/sin_0" [id=6, type=sin]; | ||
"7 RoPEModel/cos_0" [id=7, type=cos]; | ||
"8 /nncf_model_output_0" [id=8, type=nncf_model_output]; | ||
"9 /nncf_model_output_1" [id=9, type=nncf_model_output]; | ||
"0 /nncf_model_input_0" -> "1 RoPEModel/unsqueeze_0"; | ||
"1 RoPEModel/unsqueeze_0" -> "3 RoPEModel/matmul_0"; | ||
"2 RoPEModel/reshape_0" -> "3 RoPEModel/matmul_0"; | ||
"3 RoPEModel/matmul_0" -> "4 RoPEModel/transpose_0"; | ||
"4 RoPEModel/transpose_0" -> "5 RoPEModel/cat_0"; | ||
"5 RoPEModel/cat_0" -> "6 RoPEModel/sin_0"; | ||
"5 RoPEModel/cat_0" -> "7 RoPEModel/cos_0"; | ||
"6 RoPEModel/sin_0" -> "8 /nncf_model_output_0"; | ||
"7 RoPEModel/cos_0" -> "9 /nncf_model_output_1"; | ||
} |
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