Compare commits
732 Commits
2022.1.0.d
...
dev-cpu/20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f39925343 | ||
|
|
997337c33d | ||
|
|
595523e6d3 | ||
|
|
0b21f70339 | ||
|
|
bb429a855a | ||
|
|
ff38537aea | ||
|
|
d570dc4e16 | ||
|
|
0f23ee9ad6 | ||
|
|
9f5e3c50b9 | ||
|
|
fa38c36b2f | ||
|
|
c533aa6b8b | ||
|
|
5b6827649c | ||
|
|
f037208b3f | ||
|
|
a1ccf115df | ||
|
|
8b7f7d6391 | ||
|
|
6a8b37fe4f | ||
|
|
f326f0b824 | ||
|
|
ecdda2c909 | ||
|
|
c9304c5c7f | ||
|
|
04ba093dca | ||
|
|
d81896502f | ||
|
|
26a20e5875 | ||
|
|
d7d4097418 | ||
|
|
91ec6b0806 | ||
|
|
841b2dc47a | ||
|
|
b53bc6bac5 | ||
|
|
f5af87f810 | ||
|
|
c4021f8e6e | ||
|
|
a1f21f3797 | ||
|
|
b08bf8a9de | ||
|
|
cecd11457e | ||
|
|
d9d934bf86 | ||
|
|
c302bc94da | ||
|
|
c20d762af8 | ||
|
|
f5ea549d97 | ||
|
|
b2ba3d5055 | ||
|
|
a9104e1a88 | ||
|
|
fbf241d9d8 | ||
|
|
63b283fe88 | ||
|
|
167f74a7bc | ||
|
|
36be40c7e9 | ||
|
|
543963bf8d | ||
|
|
901210fa6c | ||
|
|
eb87aacc49 | ||
|
|
a56e1a9c4b | ||
|
|
11238a504c | ||
|
|
6955c389d6 | ||
|
|
9e9e3dd01b | ||
|
|
3bfc042a35 | ||
|
|
4696b9e58a | ||
|
|
e17179d795 | ||
|
|
912f40e74d | ||
|
|
870455675c | ||
|
|
0a65f5f607 | ||
|
|
caccde6a82 | ||
|
|
1331eabbed | ||
|
|
50287625d7 | ||
|
|
2d0ffd8fe5 | ||
|
|
d560cf19a3 | ||
|
|
e68613a2fc | ||
|
|
68ef1555bc | ||
|
|
0babf20bd2 | ||
|
|
b92e10ff6e | ||
|
|
7dd8fbd47e | ||
|
|
1ed03bbe6b | ||
|
|
26aa197cb1 | ||
|
|
8d221d1e06 | ||
|
|
844fbde328 | ||
|
|
f5781b1255 | ||
|
|
bacc15c275 | ||
|
|
04fabe7b20 | ||
|
|
bd09a6a218 | ||
|
|
21f3555f59 | ||
|
|
eae4782284 | ||
|
|
af4731a1f1 | ||
|
|
cd4150c8ef | ||
|
|
5e1a5aef3e | ||
|
|
8ee5514629 | ||
|
|
7e4539f6df | ||
|
|
3bebf4a76d | ||
|
|
d5e16f7844 | ||
|
|
838f71eb9a | ||
|
|
81b1fbd5c1 | ||
|
|
54e5af95da | ||
|
|
e53f702f81 | ||
|
|
22398ac9cd | ||
|
|
1b5756a4d7 | ||
|
|
1e1735b022 | ||
|
|
9dffa706fb | ||
|
|
76610393a0 | ||
|
|
5bedbbe05d | ||
|
|
e1cd7bfc5b | ||
|
|
4da0941cd2 | ||
|
|
e72d32065c | ||
|
|
9f01380558 | ||
|
|
c2703c81f6 | ||
|
|
050e2e518d | ||
|
|
01f530d443 | ||
|
|
3f953b37c1 | ||
|
|
8e9fb18882 | ||
|
|
fca2595293 | ||
|
|
bff9769dd2 | ||
|
|
55497a12d8 | ||
|
|
86495ceb0f | ||
|
|
3a36d90c11 | ||
|
|
9c8a6aacb7 | ||
|
|
a018298023 | ||
|
|
4edf85c928 | ||
|
|
ed190374fd | ||
|
|
4ad20fb53f | ||
|
|
90366c2c60 | ||
|
|
d654071b51 | ||
|
|
74638251e8 | ||
|
|
c1dc71ce28 | ||
|
|
c75bc65b83 | ||
|
|
60f9f3dc92 | ||
|
|
500d36e1c0 | ||
|
|
417d75d80b | ||
|
|
787610b0db | ||
|
|
9b4e8f5b59 | ||
|
|
da8388e263 | ||
|
|
a52092deb0 | ||
|
|
542a374c40 | ||
|
|
b9ba0bb40c | ||
|
|
80e7857eca | ||
|
|
9dee25fa79 | ||
|
|
60521a92c9 | ||
|
|
65a182aaea | ||
|
|
afdaa7cf89 | ||
|
|
d879e34363 | ||
|
|
5d821453ae | ||
|
|
29fb8c79b1 | ||
|
|
4fcc18c00e | ||
|
|
1e4a1b2b4a | ||
|
|
1a288c2e99 | ||
|
|
6105ea3902 | ||
|
|
415daecc26 | ||
|
|
8ae7c9f2cc | ||
|
|
2388f3b976 | ||
|
|
a02b3f4995 | ||
|
|
56df3962e3 | ||
|
|
3d92c8c4c7 | ||
|
|
fca159293d | ||
|
|
cad355a03e | ||
|
|
7efc85063b | ||
|
|
dc55f8bb5a | ||
|
|
6eaa15745a | ||
|
|
701d75eafa | ||
|
|
80739700ff | ||
|
|
8ab5dbade0 | ||
|
|
070f27a089 | ||
|
|
4057e408d8 | ||
|
|
e52bd441e2 | ||
|
|
dd54cb9c17 | ||
|
|
d3060d4bcc | ||
|
|
1cb254307e | ||
|
|
3c724a1dee | ||
|
|
d99104cf55 | ||
|
|
dc83410cd7 | ||
|
|
15b4553eaf | ||
|
|
1efb0a034f | ||
|
|
1d247815be | ||
|
|
9185f03e77 | ||
|
|
a87e8f7880 | ||
|
|
16a5962698 | ||
|
|
763d522759 | ||
|
|
a9853d2790 | ||
|
|
3578ee9c3f | ||
|
|
79e3272237 | ||
|
|
f2af1ef88a | ||
|
|
23476c8eee | ||
|
|
f45ca99de6 | ||
|
|
7d0750fa2a | ||
|
|
c795382b1f | ||
|
|
fad66d8442 | ||
|
|
5c917cfaaa | ||
|
|
24a74672f6 | ||
|
|
f5f93cfbeb | ||
|
|
3e58ccbce7 | ||
|
|
78285f9db4 | ||
|
|
88e20199f0 | ||
|
|
d107cec39f | ||
|
|
4c7050f6a9 | ||
|
|
be6db5d69a | ||
|
|
c8720f122d | ||
|
|
7a0d85a067 | ||
|
|
a635150b9d | ||
|
|
1906c27c2d | ||
|
|
e507b630eb | ||
|
|
8317493e65 | ||
|
|
ee31b648d1 | ||
|
|
5dc3da926c | ||
|
|
4b4bd7399c | ||
|
|
9fa5150d71 | ||
|
|
932f8bf767 | ||
|
|
17f8f7ec25 | ||
|
|
fccd5d4445 | ||
|
|
1beb7158d5 | ||
|
|
cd703580b6 | ||
|
|
f13b6252e9 | ||
|
|
72f802f282 | ||
|
|
614a6a3457 | ||
|
|
e7b35c3b00 | ||
|
|
1386f52dd6 | ||
|
|
9f923ba39f | ||
|
|
f6e5ec9684 | ||
|
|
4145291e84 | ||
|
|
5d719cbc7b | ||
|
|
01b701349d | ||
|
|
458378e9e7 | ||
|
|
fb99fd1d2f | ||
|
|
4b0417018a | ||
|
|
d261da4820 | ||
|
|
ed030e113e | ||
|
|
5b0a1fe7bb | ||
|
|
070c47ec09 | ||
|
|
23732417c5 | ||
|
|
d764fe7d27 | ||
|
|
866f006a83 | ||
|
|
02c60c76ab | ||
|
|
8f88889876 | ||
|
|
bc9f140bb4 | ||
|
|
8aa98ce0d5 | ||
|
|
da9596bade | ||
|
|
30ec7366bb | ||
|
|
a925ec6a29 | ||
|
|
19d0e5ba52 | ||
|
|
8b591c141e | ||
|
|
27741d316e | ||
|
|
52937967bb | ||
|
|
76e2f2697f | ||
|
|
10698abc29 | ||
|
|
30884a8161 | ||
|
|
aded1a2c70 | ||
|
|
2d7f46b95a | ||
|
|
05f97f2bb5 | ||
|
|
4dc0d6e711 | ||
|
|
a2705b1fed | ||
|
|
3442e90144 | ||
|
|
200026f28b | ||
|
|
5e3e8d6084 | ||
|
|
8bfde58fd9 | ||
|
|
45a21bf902 | ||
|
|
fae1c27657 | ||
|
|
aa0ab0e995 | ||
|
|
5b18677f1b | ||
|
|
a883dc0b85 | ||
|
|
8118147a96 | ||
|
|
a8f9863f72 | ||
|
|
0c6c3b0d74 | ||
|
|
f156429b11 | ||
|
|
7dc1d0935c | ||
|
|
b5dbabe41d | ||
|
|
9d865a2133 | ||
|
|
0cc119cd86 | ||
|
|
5e6fd8c721 | ||
|
|
714d7a79c7 | ||
|
|
3a8800cbd2 | ||
|
|
001d098410 | ||
|
|
5847e3cb44 | ||
|
|
32886cf90f | ||
|
|
fe3270c232 | ||
|
|
1315cfaa64 | ||
|
|
75bbfe336d | ||
|
|
fc2a8eb1a6 | ||
|
|
3674ec403f | ||
|
|
a63e2080e1 | ||
|
|
066882579d | ||
|
|
b50079143f | ||
|
|
eb80b28624 | ||
|
|
3de9189d50 | ||
|
|
af874e7754 | ||
|
|
eb74afe417 | ||
|
|
99f0093615 | ||
|
|
cd361ecae1 | ||
|
|
9bc7ebda7b | ||
|
|
1ad4a99478 | ||
|
|
6710d78e63 | ||
|
|
ac58e8eaf1 | ||
|
|
e259548530 | ||
|
|
4a47c95c04 | ||
|
|
2693ff3e48 | ||
|
|
090799a362 | ||
|
|
3ae167b88e | ||
|
|
8cac305b8f | ||
|
|
eeea2de3eb | ||
|
|
2f46890444 | ||
|
|
5dcb6c2cee | ||
|
|
2ae7e45edb | ||
|
|
fb7249d496 | ||
|
|
37adb6d8a9 | ||
|
|
1b9fbf25fd | ||
|
|
46df794908 | ||
|
|
e782cd18b7 | ||
|
|
2a43c64336 | ||
|
|
7ccc48110d | ||
|
|
1b9c58125c | ||
|
|
dfac195ffe | ||
|
|
a7df1531db | ||
|
|
e8288eb31d | ||
|
|
d84d00e2d6 | ||
|
|
dacdf67c2c | ||
|
|
3ac6e95ead | ||
|
|
2f0620600f | ||
|
|
bdc89b1571 | ||
|
|
0b444ab2db | ||
|
|
332d27ca82 | ||
|
|
51ee3f81cb | ||
|
|
be9bbb676d | ||
|
|
782ef6b42e | ||
|
|
b480a49d66 | ||
|
|
a887b41db6 | ||
|
|
ad179980d9 | ||
|
|
d7005af4a5 | ||
|
|
c18030207c | ||
|
|
5390aa7ebc | ||
|
|
72e8661157 | ||
|
|
76fde1f7b0 | ||
|
|
b2110b352c | ||
|
|
3322b74bd9 | ||
|
|
e3098ece7e | ||
|
|
2f5cb43cba | ||
|
|
d539a04efb | ||
|
|
e5ad30f194 | ||
|
|
fe406d1606 | ||
|
|
a5362a4d58 | ||
|
|
c8f4f9b7db | ||
|
|
dfdbdb4601 | ||
|
|
a4d164eda4 | ||
|
|
931313c03b | ||
|
|
4cbdf9e737 | ||
|
|
967f056761 | ||
|
|
000723acd0 | ||
|
|
c4f5bce3b0 | ||
|
|
0be4bca954 | ||
|
|
73994d7c70 | ||
|
|
aedcf2cb9f | ||
|
|
4b3dd808df | ||
|
|
3a8fd7135e | ||
|
|
412f2190d1 | ||
|
|
f12ab5c182 | ||
|
|
857a1ad2af | ||
|
|
2b4ee3d937 | ||
|
|
0091d52c78 | ||
|
|
bfa0e3e1a4 | ||
|
|
cf80156fcc | ||
|
|
6f64de4c27 | ||
|
|
33d90c5c77 | ||
|
|
7cfd8698ce | ||
|
|
25e1f6ac97 | ||
|
|
ed8c9d6f9a | ||
|
|
f7b2e3a8ca | ||
|
|
f7875da083 | ||
|
|
097006d97a | ||
|
|
848a824260 | ||
|
|
3bb83b4ddd | ||
|
|
68452e97e2 | ||
|
|
49fb48e744 | ||
|
|
4d8adabcaa | ||
|
|
8a813d0da9 | ||
|
|
7cea7dd4e6 | ||
|
|
2687f6fb2e | ||
|
|
06f55bd8e8 | ||
|
|
50adb2240c | ||
|
|
8c9c592fcf | ||
|
|
4f6dcc1d32 | ||
|
|
ea8f1d0344 | ||
|
|
3c721b0f03 | ||
|
|
93722fe101 | ||
|
|
499ffcaa59 | ||
|
|
37e05afd12 | ||
|
|
e103af056e | ||
|
|
4e8e56e887 | ||
|
|
aed3b59796 | ||
|
|
13b6a3d86e | ||
|
|
2dbd60c1ae | ||
|
|
060a149322 | ||
|
|
660c6a3e84 | ||
|
|
29144d3a6b | ||
|
|
840e622da5 | ||
|
|
5f27c74d96 | ||
|
|
fc5356cd3b | ||
|
|
e341cdf541 | ||
|
|
e71a05d94d | ||
|
|
c58ef365b5 | ||
|
|
758d12b9cb | ||
|
|
4a2d0f39dd | ||
|
|
ef5ad90dd7 | ||
|
|
0a8f97f429 | ||
|
|
a9ff10b365 | ||
|
|
0b556fd7a9 | ||
|
|
3b2b055bfd | ||
|
|
ad1c4a24c3 | ||
|
|
575b2fad73 | ||
|
|
0d404633a9 | ||
|
|
23eaa80325 | ||
|
|
3aa525c003 | ||
|
|
4e27d936b5 | ||
|
|
72fe6082ea | ||
|
|
4c4581940a | ||
|
|
d0b4cae2f8 | ||
|
|
96f954c704 | ||
|
|
6ec8e53183 | ||
|
|
43cb3920fb | ||
|
|
ef00057c8e | ||
|
|
a6583965a5 | ||
|
|
0bc6196d96 | ||
|
|
4be227f5a1 | ||
|
|
45d34e7885 | ||
|
|
3b5f3d1957 | ||
|
|
de3088adce | ||
|
|
23604ca28c | ||
|
|
7790f2036f | ||
|
|
eebe8c70f9 | ||
|
|
86322c916b | ||
|
|
6fdd983750 | ||
|
|
caaacb2db4 | ||
|
|
d93ce1e246 | ||
|
|
f48b233629 | ||
|
|
9d74f5cd76 | ||
|
|
2940db0fb1 | ||
|
|
dd076264eb | ||
|
|
0dc2ab182b | ||
|
|
97efdb5020 | ||
|
|
4e0a740eb3 | ||
|
|
09246e2db8 | ||
|
|
a8a2640fb7 | ||
|
|
5566b67238 | ||
|
|
4746d0881b | ||
|
|
d7372d678c | ||
|
|
531fa9018d | ||
|
|
44ec4661a4 | ||
|
|
948347f3dd | ||
|
|
d9976332b0 | ||
|
|
702f8cf223 | ||
|
|
3e7e0d5651 | ||
|
|
de47a3b4a4 | ||
|
|
41818a377f | ||
|
|
3b8e960b10 | ||
|
|
3b8ca9f0af | ||
|
|
e87ea5d611 | ||
|
|
0f8c599ce7 | ||
|
|
0c20e7a3ca | ||
|
|
3b24ed032a | ||
|
|
cb9049076b | ||
|
|
c28cebb2a6 | ||
|
|
7e8bbf4968 | ||
|
|
69ad9e80e1 | ||
|
|
32edd596e3 | ||
|
|
ed702910bd | ||
|
|
082ebbcbf8 | ||
|
|
043a773f61 | ||
|
|
5cee51e9c4 | ||
|
|
8a2252b774 | ||
|
|
fd18632d89 | ||
|
|
78c9f5b0a2 | ||
|
|
1bbd92a8f8 | ||
|
|
554b50eb85 | ||
|
|
f8ce57319b | ||
|
|
f81f819ecd | ||
|
|
28889c4833 | ||
|
|
fdf12c9537 | ||
|
|
8121de731c | ||
|
|
d1630c9ac1 | ||
|
|
75f7bced65 | ||
|
|
59cfdce73b | ||
|
|
1fec99afa3 | ||
|
|
974ae136a6 | ||
|
|
1c5e76c4db | ||
|
|
7ba71f9c20 | ||
|
|
3318dd6c68 | ||
|
|
4f6ca1b85f | ||
|
|
d670e77d97 | ||
|
|
21185189d8 | ||
|
|
24a5aab501 | ||
|
|
4b55ef9911 | ||
|
|
bea352f272 | ||
|
|
180f15e84c | ||
|
|
42d3893833 | ||
|
|
7cd3c8e86e | ||
|
|
d3ded2fc36 | ||
|
|
40fc5334d8 | ||
|
|
cd52cc6767 | ||
|
|
c54926ecb8 | ||
|
|
969060c8db | ||
|
|
86b175534a | ||
|
|
d1bcb6d0fc | ||
|
|
9cd3bff7df | ||
|
|
e75ee60bec | ||
|
|
81cd9d86d1 | ||
|
|
5e023ebdd9 | ||
|
|
6b067bc0ed | ||
|
|
18035209a0 | ||
|
|
0f409ccea9 | ||
|
|
3f941e3c5f | ||
|
|
9eca8515b8 | ||
|
|
6c6aa8fa95 | ||
|
|
1d469a2b87 | ||
|
|
8e0978818c | ||
|
|
64fca57af4 | ||
|
|
5f40ba9a23 | ||
|
|
6c78715749 | ||
|
|
9da124544a | ||
|
|
4b29eed013 | ||
|
|
173f328c53 | ||
|
|
b319acc672 | ||
|
|
4a8b142fef | ||
|
|
33ad1b96d4 | ||
|
|
7d0d950b9a | ||
|
|
f6fbef1f66 | ||
|
|
bed0adf5ef | ||
|
|
1ceb9729e9 | ||
|
|
b9ef57112e | ||
|
|
d4f77f1d3e | ||
|
|
f55e69d656 | ||
|
|
5724c5ac44 | ||
|
|
52b450a5fb | ||
|
|
7b58f931b5 | ||
|
|
18ff8afe63 | ||
|
|
94cbbe063b | ||
|
|
e9e59cb954 | ||
|
|
54f39294de | ||
|
|
14d11a8998 | ||
|
|
bdee939fe0 | ||
|
|
38d87dd9de | ||
|
|
a32ed5a07a | ||
|
|
bacf597516 | ||
|
|
9e3610c028 | ||
|
|
6062e3d4b7 | ||
|
|
53d3ef8eab | ||
|
|
ffd63f9758 | ||
|
|
806ce96899 | ||
|
|
f2bbd5bbb8 | ||
|
|
e906b3581f | ||
|
|
163a79b232 | ||
|
|
1c18733ade | ||
|
|
a2f9963045 | ||
|
|
85707198b3 | ||
|
|
3de428c713 | ||
|
|
4c01d6c50c | ||
|
|
506303cc79 | ||
|
|
23b74840c1 | ||
|
|
e544f5e66f | ||
|
|
9dec8db964 | ||
|
|
c1919a0f1d | ||
|
|
7ff8ada805 | ||
|
|
75cca1e9e9 | ||
|
|
817550fa0a | ||
|
|
3f4e384d5d | ||
|
|
5b3b48aa17 | ||
|
|
37923a9183 | ||
|
|
14d31d59af | ||
|
|
b12c3389ee | ||
|
|
e2df6d149b | ||
|
|
dab1a34aa2 | ||
|
|
e59739ce88 | ||
|
|
71a0a6d261 | ||
|
|
bc0a84a1c1 | ||
|
|
aced89a655 | ||
|
|
5bb8f77c3f | ||
|
|
435584bb91 | ||
|
|
487bb67995 | ||
|
|
850f93f21b | ||
|
|
51ef938385 | ||
|
|
6dc8b8b047 | ||
|
|
c80a872f73 | ||
|
|
a3004e7d80 | ||
|
|
991c9db1c1 | ||
|
|
3f15afb926 | ||
|
|
3d223ebc2a | ||
|
|
efd3c119fa | ||
|
|
6500ec775d | ||
|
|
a3887f3328 | ||
|
|
b7ead46943 | ||
|
|
d57fb75ba6 | ||
|
|
171ad9536f | ||
|
|
3f56438d06 | ||
|
|
472ebc0cd9 | ||
|
|
5247fdfcaf | ||
|
|
100fff83bf | ||
|
|
4afd8667cf | ||
|
|
4075f8ed51 | ||
|
|
746b77c74a | ||
|
|
1891967ad3 | ||
|
|
33062bef7a | ||
|
|
aea0532d76 | ||
|
|
5be402750a | ||
|
|
d7ad1bd9cd | ||
|
|
e7145bd343 | ||
|
|
d26fd3aa22 | ||
|
|
f82533005b | ||
|
|
65d1575642 | ||
|
|
1d33c37970 | ||
|
|
b7fede89c8 | ||
|
|
6bb8701651 | ||
|
|
4decf16927 | ||
|
|
09379dca86 | ||
|
|
ae42bf1e86 | ||
|
|
f53f09f020 | ||
|
|
68e873c6c8 | ||
|
|
0ce255e56a | ||
|
|
11bf540018 | ||
|
|
5dbf2f7088 | ||
|
|
206442fb19 | ||
|
|
828d9d810a | ||
|
|
cd77b33f3a | ||
|
|
430e898c33 | ||
|
|
1fa5d44769 | ||
|
|
33ab7f9063 | ||
|
|
31f517a3b4 | ||
|
|
e5d6f18366 | ||
|
|
2cc6629624 | ||
|
|
f7a85c59fe | ||
|
|
e89c7ed8e5 | ||
|
|
73a6d50dbc | ||
|
|
0ee6959537 | ||
|
|
a7fff7447c | ||
|
|
575ded54a9 | ||
|
|
ea3bd087c4 | ||
|
|
7c93902dac | ||
|
|
a52c755d21 | ||
|
|
982942fa5d | ||
|
|
a312dd4a9f | ||
|
|
5c7be85435 | ||
|
|
5671ca2cf5 | ||
|
|
af62ff22b1 | ||
|
|
661002689f | ||
|
|
71fdcdf899 | ||
|
|
2e164b4ddc | ||
|
|
fb6359586d | ||
|
|
6b22d0d109 | ||
|
|
c9bfd3bf8b | ||
|
|
d2177cf177 | ||
|
|
b22585a696 | ||
|
|
7985c92095 | ||
|
|
d9b1f10074 | ||
|
|
f52f129ed8 | ||
|
|
ba9d18f181 | ||
|
|
a18c8076cc | ||
|
|
e8ff31f4fb | ||
|
|
20266dd0c3 | ||
|
|
7a82bb2acb | ||
|
|
dea35b8e6e | ||
|
|
03862e780f | ||
|
|
3a89c87f52 | ||
|
|
dcd6e3e961 | ||
|
|
2ac15eae3d | ||
|
|
17311c46b3 | ||
|
|
b8ac041da9 | ||
|
|
76ade7a7d0 | ||
|
|
9b36daf23b | ||
|
|
2d88e67616 | ||
|
|
10ac5b280b | ||
|
|
215db2dad8 | ||
|
|
b6a75d7d91 | ||
|
|
7fa9d07a1f | ||
|
|
f482f9765e | ||
|
|
ac880f601c | ||
|
|
b8bbe056b1 | ||
|
|
73caba0f67 | ||
|
|
a090abbc92 | ||
|
|
6e5eb87340 | ||
|
|
ade4c6c7f9 | ||
|
|
61f657795c | ||
|
|
198f44fdc7 | ||
|
|
306b7611d9 | ||
|
|
3144c5fab8 | ||
|
|
ccd7104108 | ||
|
|
fc1157cf68 | ||
|
|
8ae4bc95fd | ||
|
|
0882f863d6 | ||
|
|
7ce9801ec3 | ||
|
|
d1378d94b8 | ||
|
|
ff4e97ab09 | ||
|
|
e444715c8d | ||
|
|
83a8ac800c | ||
|
|
61f915b4f6 | ||
|
|
43784e2cec | ||
|
|
8abb949af9 | ||
|
|
5ace7bb96f | ||
|
|
a7b28953e2 | ||
|
|
8148921fa7 | ||
|
|
68f523010e | ||
|
|
ed323afc93 | ||
|
|
d35335193a | ||
|
|
861d43e06d | ||
|
|
be6a3c34f1 | ||
|
|
29883a152a | ||
|
|
ff293f5560 | ||
|
|
541627d319 | ||
|
|
3597ae61f9 | ||
|
|
926460e603 | ||
|
|
ab4a11b3bd | ||
|
|
1fc61299c8 | ||
|
|
90a100d5f6 | ||
|
|
00abcbacc4 | ||
|
|
5cadee20eb | ||
|
|
abeb910ce2 | ||
|
|
4f000b780d | ||
|
|
5bf9631073 | ||
|
|
05650551b7 | ||
|
|
434d7bbecc | ||
|
|
5b8b698f88 | ||
|
|
7a24f53b57 | ||
|
|
e2948a807c | ||
|
|
fc5a416423 | ||
|
|
2e71fccd82 | ||
|
|
483b3828ca | ||
|
|
ba69bae055 | ||
|
|
4d954d0c13 | ||
|
|
2a1d8d7e99 | ||
|
|
0c4d50239a | ||
|
|
709084888a | ||
|
|
0b27fb80b1 | ||
|
|
c8ce93290e | ||
|
|
e22a2b3076 | ||
|
|
0a056857c5 | ||
|
|
c0d54e48bb | ||
|
|
fa4246d531 | ||
|
|
cbb5dff9c1 | ||
|
|
06eb74b77f | ||
|
|
e71f23fc7e | ||
|
|
d14f1e54a5 | ||
|
|
eda4cbf30e | ||
|
|
317b956d2e | ||
|
|
d5e8e0fb88 | ||
|
|
dc905f972a | ||
|
|
fa6865d569 | ||
|
|
0793a56260 | ||
|
|
f150e2ad09 | ||
|
|
498d865ea6 | ||
|
|
b837b7e32c |
@@ -13,6 +13,7 @@ resources:
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
ref: master
|
||||
|
||||
jobs:
|
||||
- job: android_arm64
|
||||
|
||||
@@ -13,11 +13,13 @@ resources:
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
ref: master
|
||||
|
||||
- repository: testdata
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/testdata
|
||||
ref: master
|
||||
|
||||
jobs:
|
||||
- job: Lin
|
||||
@@ -109,7 +111,8 @@ jobs:
|
||||
set -e
|
||||
$(REPO_DIR)/install_build_dependencies.sh
|
||||
# Move jdk into contrib
|
||||
sudo apt --assume-yes install openjdk-11-jdk
|
||||
# 'clang' compiler is to check that samples can be built using it
|
||||
sudo apt --assume-yes install openjdk-11-jdk clang
|
||||
# For opencv-python: python3-setuptools and pip upgrade
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements.txt
|
||||
@@ -223,6 +226,14 @@ jobs:
|
||||
displayName: 'Build cpp samples'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
$(INSTALL_DIR)/samples/cpp/build_samples.sh -i $(INSTALL_DIR)
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build cpp samples - clang'
|
||||
continueOnError: false
|
||||
|
||||
- script: $(INSTALL_DIR)/samples/c/build_samples.sh -i $(INSTALL_DIR)
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build c samples'
|
||||
@@ -288,6 +299,10 @@ jobs:
|
||||
displayName: 'VPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/XLinkTests --gtest_output=xml:TEST-XLinkTests.xml
|
||||
displayName: 'XLink Tests'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:TEST-ieMultiPluginUnitTests.xml
|
||||
displayName: 'MULTI UT'
|
||||
continueOnError: false
|
||||
@@ -336,6 +351,7 @@ jobs:
|
||||
- script: |
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
export IE_APP_PATH=$(INSTALL_DIR)/samples_bin
|
||||
export LD_LIBRARY_PATH=$IE_APP_PATH:$LD_LIBRARY_PATH
|
||||
export IE_APP_PYTHON_PATH=$(INSTALL_DIR)/samples/python/
|
||||
export SHARE=$(INSTALL_DIR)/tests/smoke_tests/samples_smoke_tests_data/
|
||||
export WORKSPACE=$(INSTALL_DIR)
|
||||
|
||||
@@ -13,6 +13,7 @@ resources:
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
ref: master
|
||||
|
||||
jobs:
|
||||
- job: linux_arm64
|
||||
@@ -26,16 +27,28 @@ jobs:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
PYTHON_ARM_VERSION: "3.8.12"
|
||||
PYTHON_EXEC: "python3.8"
|
||||
OPENVINO_ARCH: 'aarch64'
|
||||
NUM_PROC: 1
|
||||
BUILD_TYPE: Release
|
||||
OPENVINO_REPO_DIR: $(Build.Repository.LocalPath)
|
||||
OPENVINO_CONTRIB_REPO_DIR: $(OPENVINO_REPO_DIR)/../openvino_contrib
|
||||
OPENCV_REPO_DIR: $(OPENVINO_REPO_DIR)/../opencv
|
||||
BUILD_PYTHON: $(WORK_DIR)/build_python
|
||||
BUILD_OPENCV: $(WORK_DIR)/build_opencv
|
||||
BUILD_OPENVINO: $(WORK_DIR)/build
|
||||
BUILD_OPENVINO_PYTHON: $(WORK_DIR)/build_python
|
||||
BUILD_OPEN_MODEL_ZOO: $(WORK_DIR)/build_open_model_zoo
|
||||
INSTALL_OPENVINO: $(WORK_DIR)/install_openvino
|
||||
INSTALL_PYTHON: $(INSTALL_OPENVINO)/extras/python
|
||||
INSTALL_OPENCV: $(INSTALL_OPENVINO)/extras/opencv
|
||||
INSTALL_OPEN_MODEL_ZOO: $(INSTALL_OPENVINO)/extras/open_model_zoo
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
BUILD_DIR_OPENCV: $(WORK_DIR)/build_opencv
|
||||
TMP_DIR: /mnt/tmp
|
||||
SHARE_DIR: /mount/cinfsshare/onnxtestdata
|
||||
CCACHE_DIR: $(SHARE_DIR)/ccache/master/linux_arm64
|
||||
TMP_DIR: /mnt/tmp
|
||||
OPENVINO_CCACHE_DIR: $(SHARE_DIR)/ccache/master/linux_arm64
|
||||
OPENCV_CCACHE_DIR: $(SHARE_DIR)/ccache/master/linux_arm64_opencv
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
@@ -56,17 +69,21 @@ jobs:
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
echo "##vso[task.setvariable variable=NUM_PROC]$(nproc --all)"
|
||||
echo "NUM_PROC=$(NUM_PROC)"
|
||||
displayName: 'System information'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
rm -rf $(BUILD_DIR) ; mkdir $(BUILD_DIR)
|
||||
mkdir -p $(BUILD_OPENCV) $(BUILD_OPENVINO) $(BUILD_OPENVINO_PYTHON) $(BUILD_PYTHON) $(BUILD_OPEN_MODEL_ZOO)
|
||||
mkdir -p $(INSTALL_OPENVINO) $(INSTALL_PYTHON) $(INSTALL_OPENCV) $(INSTALL_OPEN_MODEL_ZOO)
|
||||
sudo rm -rf $(TMP_DIR) ; sudo mkdir $(TMP_DIR) ; sudo chmod 777 -R $(TMP_DIR)
|
||||
sudo mkdir -p $(SHARE_DIR)
|
||||
sudo apt --assume-yes update && sudo apt --assume-yes install nfs-common
|
||||
sudo mount -vvv -t nfs cinfsshare.file.core.windows.net:/cinfsshare/onnxtestdata $(SHARE_DIR) -o vers=4,minorversion=1,sec=sys
|
||||
mkdir -p $(CCACHE_DIR)
|
||||
displayName: 'Make directory'
|
||||
mkdir -p $(OPENVINO_CCACHE_DIR)
|
||||
mkdir -p $(OPENCV_CCACHE_DIR)
|
||||
displayName: 'Make directories'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
@@ -83,16 +100,25 @@ jobs:
|
||||
- script: |
|
||||
set -e
|
||||
$(OPENVINO_REPO_DIR)/install_build_dependencies.sh
|
||||
# Move into contrib install_build_dependencies.sh
|
||||
sudo apt --assume-yes install scons crossbuild-essential-arm64 libprotoc-dev protobuf-compiler
|
||||
# OpenCV should provide install_build_dependencies.sh as well
|
||||
# Move into resources
|
||||
git clone https://github.com/opencv/opencv.git --depth 1 $(OPENCV_REPO_DIR)
|
||||
# Speed up build
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
workingDirectory: $(WORK_DIR)
|
||||
export CCACHE_DIR=$(OPENCV_CCACHE_DIR)
|
||||
export CCACHE_TEMPDIR=$(TMP_DIR)/ccache
|
||||
export CCACHE_BASEDIR=$(Pipeline.Workspace)
|
||||
export CCACHE_MAXSIZE=50G
|
||||
export USE_CCACHE=1
|
||||
export PYTHON_ARM_VERSION=$(PYTHON_ARM_VERSION)
|
||||
export NUM_PROC=$(NUM_PROC)
|
||||
export BUILD_PYTHON=$(BUILD_PYTHON)
|
||||
export WORK_DIR=$(WORK_DIR)
|
||||
export INSTALL_PYTHON=$(INSTALL_PYTHON)
|
||||
export BUILD_TYPE=$(BUILD_TYPE)
|
||||
export OPENVINO_REPO_DIR=$(OPENVINO_REPO_DIR)
|
||||
export INSTALL_OPENCV=$(INSTALL_OPENCV)
|
||||
export PYTHON_EXEC=$(PYTHON_EXEC)
|
||||
export OPENCV_REPO_DIR=$(OPENCV_REPO_DIR)
|
||||
export BUILD_OPENCV=$(BUILD_OPENCV)
|
||||
export INSTALL_OPENVINO=$(INSTALL_OPENVINO)
|
||||
$(OPENVINO_CONTRIB_REPO_DIR)/modules/arm_plugin/scripts/install_build_dependencies.sh
|
||||
workingDirectory: $(BUILD_OPENVINO)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- task: CMake@1
|
||||
@@ -100,30 +126,21 @@ jobs:
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DVERBOSE_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DBUILD_LIST=imgcodecs,videoio,highgui
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(OPENCV_REPO_DIR)/platforms/linux/aarch64-gnu.toolchain.cmake
|
||||
$(OPENCV_REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR_OPENCV)
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR_OPENCV)
|
||||
displayName: 'Build OpenCV Linux ARM64'
|
||||
|
||||
- script: ninja install
|
||||
workingDirectory: $(BUILD_DIR_OPENCV)
|
||||
displayName: 'Install OpenCV Linux ARM64'
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DVERBOSE_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(OPENVINO_REPO_DIR)/cmake/arm64.toolchain.cmake
|
||||
-DOpenCV_DIR=$(BUILD_DIR_OPENCV)/install/lib/cmake/opencv4
|
||||
-DOpenCV_DIR=$(INSTALL_OPENCV)/cmake
|
||||
-DENABLE_OPENCV=OFF
|
||||
-DPYTHON_INCLUDE_DIRS=$(INSTALL_PYTHON)/include/python3.8
|
||||
-DPYTHON_LIBRARY=$(INSTALL_PYTHON)/lib/libpython3.8.so
|
||||
-DENABLE_PYTHON=ON
|
||||
-DPYTHON_MODULE_EXTENSION=".so"
|
||||
-DENABLE_TESTS=ON
|
||||
-DENABLE_FUNCTIONAL_TESTS=ON
|
||||
-DENABLE_GAPI_TESTS=OFF
|
||||
-DENABLE_GAPI_PREPROCESSING=OFF
|
||||
-DENABLE_DATA=OFF
|
||||
-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath-link,$(INSTALL_OPENCV)/lib
|
||||
-DTHREADING=SEQ -DENABLE_LTO=ON
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(OPENVINO_REPO_DIR)/cmake/arm64.toolchain.cmake
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_SAMPLES=ON
|
||||
-DBUILD_java_api=OFF
|
||||
-DENABLE_INTEL_MYRIAD=OFF
|
||||
@@ -131,26 +148,102 @@ jobs:
|
||||
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||
-DARM_COMPUTE_SCONS_JOBS=$(NUM_PROC)
|
||||
-DOUTPUT_ROOT=$(INSTALL_OPENVINO)
|
||||
-DCMAKE_INSTALL_PREFIX=$(INSTALL_OPENVINO)
|
||||
$(OPENVINO_REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
- script: ls -alR $(OPENVINO_REPO_DIR)/temp/
|
||||
displayName: 'List temp SDKs'
|
||||
|
||||
- script: ccache --zero-stats --max-size=50G --show-config
|
||||
displayName: 'Clean ccache stats'
|
||||
workingDirectory: $(BUILD_OPENVINO)
|
||||
displayName: 'CMake OpenVINO ARM plugin'
|
||||
|
||||
- script: |
|
||||
export CCACHE_DIR=$(CCACHE_DIR)
|
||||
export CCACHE_DIR=$(OPENVINO_CCACHE_DIR)
|
||||
export CCACHE_TEMPDIR=$(TMP_DIR)/ccache
|
||||
export CCACHE_BASEDIR=$(Pipeline.Workspace)
|
||||
export CCACHE_MAXSIZE=50G
|
||||
export USE_CCACHE=1
|
||||
ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Linux ARM64'
|
||||
workingDirectory: $(BUILD_OPENVINO)
|
||||
displayName: 'Build OpenVINO ARM plugin'
|
||||
|
||||
- script: ccache --show-stats
|
||||
displayName: 'Show ccache stats'
|
||||
- script: ninja install
|
||||
workingDirectory: $(BUILD_OPENVINO)
|
||||
displayName: 'Install OpenVINO ARM plugin'
|
||||
|
||||
- script: ls -alR $(OPENVINO_REPO_DIR)/bin/
|
||||
displayName: 'List binary files'
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DInferenceEngineDeveloperPackage_DIR=$(BUILD_OPENVINO)
|
||||
-DENABLE_PYTHON=ON
|
||||
-DPYTHON_EXECUTABLE=$(INSTALL_PYTHON)/bin/python3.8
|
||||
-DPYTHON_INCLUDE_DIRS=$(INSTALL_PYTHON)/include/python3.8
|
||||
-DPYTHON_LIBRARIES=$(INSTALL_PYTHON)/lib
|
||||
-DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.8/site-packages/numpy/core/include
|
||||
-DPYTHON_MODULE_EXTENSION=".so"
|
||||
-DPYBIND11_FINDPYTHON=OFF
|
||||
-DPYBIND11_NOPYTHON=OFF
|
||||
-DPYTHONLIBS_FOUND=TRUE
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_DATA=OFF
|
||||
-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath-link,$(INSTALL_OPENCV)/lib
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(OPENVINO_REPO_DIR)/cmake/arm64.toolchain.cmake
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||
-DCMAKE_INSTALL_PREFIX=$(INSTALL_OPENVINO)
|
||||
$(OPENVINO_REPO_DIR)/src/bindings/python
|
||||
workingDirectory: $(BUILD_OPENVINO_PYTHON)
|
||||
displayName: 'CMake OpenVINO python binding'
|
||||
|
||||
- script: |
|
||||
export CCACHE_DIR=$(OPENVINO_CCACHE_DIR)
|
||||
export CCACHE_TEMPDIR=$(TMP_DIR)/ccache
|
||||
export CCACHE_BASEDIR=$(Pipeline.Workspace)
|
||||
export CCACHE_MAXSIZE=50G
|
||||
export USE_CCACHE=1
|
||||
ninja
|
||||
workingDirectory: $(BUILD_OPENVINO_PYTHON)
|
||||
displayName: 'Build OpenVINO python binding'
|
||||
|
||||
- script: ninja install
|
||||
workingDirectory: $(BUILD_OPENVINO_PYTHON)
|
||||
displayName: 'Install OpenVINO python binding'
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_PYTHON=ON
|
||||
-DPYTHON_EXECUTABLE=/usr/local/bin/python3.8
|
||||
-DPYTHON_INCLUDE_DIR=$(INSTALL_PYTHON)/include/python3.8
|
||||
-DPYTHON_LIBRARY=$(INSTALL_PYTHON)/lib
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(OPENVINO_REPO_DIR)/cmake/arm64.toolchain.cmake
|
||||
-DOpenVINO_DIR=$(BUILD_OPENVINO)
|
||||
-DInferenceEngine_DIR=$(BUILD_OPENVINO)
|
||||
-DOpenCV_DIR=$(INSTALL_OPENCV)/cmake
|
||||
-Dngraph_DIR=$(BUILD_OPENVINO)
|
||||
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
|
||||
-DCMAKE_INSTALL_PREFIX=$(INSTALL_OPEN_MODEL_ZOO)
|
||||
$(OPENVINO_REPO_DIR)/thirdparty/open_model_zoo/demos
|
||||
workingDirectory: $(BUILD_OPEN_MODEL_ZOO)
|
||||
displayName: 'CMake Open Model Zoo demos'
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_OPEN_MODEL_ZOO)
|
||||
displayName: 'Build Open Model Zoo demos'
|
||||
|
||||
- script: ninja install
|
||||
workingDirectory: $(BUILD_OPEN_MODEL_ZOO)
|
||||
displayName: 'Install Open Model Zoo demos'
|
||||
|
||||
- script: |
|
||||
cp -r $(BUILD_OPEN_MODEL_ZOO)/$(OPENVINO_ARCH)/$(BUILD_TYPE)/* $(INSTALL_OPEN_MODEL_ZOO)/
|
||||
zip -9 -r $(Build.ArtifactStagingDirectory)/openvino_$(OPENVINO_ARCH)_linux.zip ./*
|
||||
workingDirectory: $(INSTALL_OPENVINO)
|
||||
displayName: 'Create OpenVINO ARM64 linux package'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
pathToPublish: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: 'openvino_aarch64_linux'
|
||||
displayName: 'Publish OpenVINO AArch64 linux package'
|
||||
|
||||
@@ -4,6 +4,7 @@ resources:
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
ref: master
|
||||
|
||||
jobs:
|
||||
- job: Lin
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
# type: github
|
||||
# endpoint: openvinotoolkit
|
||||
# name: openvinotoolkit/testdata
|
||||
# ref: master
|
||||
|
||||
jobs:
|
||||
- job: Lin_lohika
|
||||
|
||||
@@ -13,11 +13,13 @@ resources:
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
ref: master
|
||||
|
||||
- repository: testdata
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/testdata
|
||||
ref: master
|
||||
|
||||
jobs:
|
||||
- job: Mac
|
||||
@@ -99,7 +101,7 @@ jobs:
|
||||
export PATH="/usr/local/opt/cython/bin:$PATH"
|
||||
export CC=gcc
|
||||
export CXX=g++
|
||||
cmake -GNinja -DVERBOSE_BUILD=ON -DENABLE_REQUIREMENTS_INSTALL=OFF -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache $(REPO_DIR)
|
||||
cmake -GNinja -DVERBOSE_BUILD=ON -DENABLE_REQUIREMENTS_INSTALL=OFF -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DENABLE_TESTS=OFF -DENABLE_STRICT_DEPENDENCIES=OFF -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'CMake'
|
||||
|
||||
@@ -159,30 +161,37 @@ jobs:
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_filter=-MKLDNNGraphStructureTests.TestNoRedundantReordersBeforeDWConvolution:TestConvolution/MKLDNNGraphConvolutionTests.TestsConvolution/0:TestConvolutionDefaultPrimitivesPriority/MKLDNNGraphConvolutionTests.TestsConvolution/0 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
|
||||
displayName: 'IE UT old'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
|
||||
displayName: 'IE UT'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
|
||||
displayName: 'CPU UT'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
|
||||
displayName: 'VPU UT'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
displayName: 'ONNX Importer UT'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:TEST-ieMultiPluginUnitTests.xml
|
||||
displayName: 'MULTI UT'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
|
||||
displayName: 'IE FuncTests'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke*:-smoke_LPT/ReduceMinTransformation.CompareWithRefImpl/f32_Shape* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
displayName: 'CPU FuncTests'
|
||||
@@ -195,6 +204,7 @@ jobs:
|
||||
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
|
||||
displayName: 'IE CAPITests'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: always()
|
||||
|
||||
@@ -13,11 +13,13 @@ resources:
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
ref: master
|
||||
|
||||
- repository: testdata
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/testdata
|
||||
ref: master
|
||||
|
||||
jobs:
|
||||
- job: Win
|
||||
@@ -30,7 +32,7 @@ jobs:
|
||||
maxParallel: 2
|
||||
|
||||
# About 150% of total time
|
||||
timeoutInMinutes: 150
|
||||
timeoutInMinutes: 180
|
||||
|
||||
pool:
|
||||
name: WIN_VMSS_VENV_D8S_WU2
|
||||
@@ -133,7 +135,7 @@ jobs:
|
||||
|
||||
- script: |
|
||||
set PATH=$(WORK_DIR)\ninja-win;%PATH%
|
||||
call "$(MSVS_VARS_PATH)" && $(CMAKE_CMD) -G "Ninja Multi-Config" -DENABLE_WHEEL=ON -DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_GAPI_PREPROCESSING=$(CMAKE_BUILD_SHARED_LIBS) -DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_REQUIREMENTS_INSTALL=OFF -DENABLE_FASTER_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.7.6\x64\python.exe" -DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.7.6\x64\include" -DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.7.6\x64\libs\python37.lib" -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
|
||||
call "$(MSVS_VARS_PATH)" && $(CMAKE_CMD) -G "Ninja Multi-Config" -DENABLE_WHEEL=ON -DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS) -DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_REQUIREMENTS_INSTALL=OFF -DENABLE_FASTER_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.7.6\x64\python.exe" -DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.7.6\x64\include" -DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.7.6\x64\libs\python37.lib" -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'CMake'
|
||||
|
||||
@@ -167,13 +169,6 @@ jobs:
|
||||
workingDirectory: $(BUILD_SAMPLES_TESTS_DIR)
|
||||
displayName: 'Install Samples Tests'
|
||||
|
||||
- script: $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake && xcopy $(REPO_DIR)\temp\opencv_4.5.2\opencv\* $(INSTALL_DIR)\opencv\ /e /h /y
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: dir $(INSTALL_DIR) /s
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: $(INSTALL_DIR)\samples\cpp\build_samples_msvc.bat -i $(INSTALL_DIR)
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build cpp samples'
|
||||
@@ -198,9 +193,15 @@ jobs:
|
||||
python -m pytest $(INSTALL_DIR)\tests\smoke_tests\ --env_conf $(INSTALL_DIR)\tests\smoke_tests\env_config.yml -s --junitxml=TEST-SamplesSmokeTests.xml
|
||||
workingDirectory: $(INSTALL_DIR)
|
||||
displayName: 'Samples Smoke Tests'
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
continueOnError: false
|
||||
|
||||
- script: $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake && xcopy $(REPO_DIR)\temp\opencv_4.5.2\opencv\* $(INSTALL_DIR)\opencv\ /e /h /y
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: dir $(INSTALL_DIR) /s
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: rd /Q /S $(BUILD_DIR)
|
||||
displayName: 'Clean build dir'
|
||||
continueOnError: false
|
||||
@@ -240,6 +241,10 @@ jobs:
|
||||
displayName: 'VPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\XLinkTests --gtest_output=xml:TEST-XLinkTests.xml
|
||||
displayName: 'XLink Tests'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
displayName: 'ONNX Importer UT'
|
||||
continueOnError: false
|
||||
|
||||
213
.ci/openvino-onnx/Jenkinsfile
vendored
213
.ci/openvino-onnx/Jenkinsfile
vendored
@@ -1,213 +0,0 @@
|
||||
// Copyright (C) 2018-2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
DOCKER_CONTAINER_NAME= "openvino-onnx-ci-container"
|
||||
DOCKER_IMAGE_TAG = "openvino-onnx-ci-image"
|
||||
ONNX_MODEL_ZOO_SHA = "d58213534f2a4d1c4b19ba62b3bb5f544353256e"
|
||||
|
||||
BACKEND_CONFIGURATIONS = [
|
||||
[ name: "Release", build_type: "Release" ],
|
||||
[ name: "Debug", build_type: "Debug" ],
|
||||
]
|
||||
|
||||
// workaround for aborting previous builds on PR update
|
||||
@NonCPS
|
||||
def stopPreviousRunningBuilds() {
|
||||
def jobname = env.JOB_NAME
|
||||
if (jobname.startsWith("onnx-ci/openvino onnx ci/openvino/PR")){
|
||||
def buildnum = env.BUILD_NUMBER.toInteger()
|
||||
def job = Jenkins.instance.getItemByFullName(jobname)
|
||||
def job_newest = job.builds.first()
|
||||
for (build in job.builds.reverse()[0..<-1]) {
|
||||
if (build.isBuilding()){
|
||||
echo "Stop task = ${build} because newest #${job_newest} is on the way"
|
||||
build.doStop();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def getGitPrInfo(String project, String workdir) {
|
||||
def gitPrInfo = [
|
||||
prAuthorEmail : "",
|
||||
commitAuthorEmail : "",
|
||||
commitHash : "",
|
||||
commitSubject : ""
|
||||
]
|
||||
try {
|
||||
dir ("${workdir}/${project}") {
|
||||
gitPrInfo.prAuthorEmail = sh (script: 'git log -1 --pretty="format:%ae" ', returnStdout: true).trim()
|
||||
gitPrInfo.commitAuthorEmail = sh (script: 'git log -1 --pretty="format:%ce" ', returnStdout: true).trim()
|
||||
gitPrInfo.commitSubject = sh (script: 'git log -1 --pretty="format:%H" ', returnStdout: true).trim()
|
||||
gitPrInfo.commitHash = sh (script: 'git log -1 --pretty="format:%s" ', returnStdout: true).trim()
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
echo "Failed to retrieve ${project} git repository information!"
|
||||
echo "ERROR: ${e}"
|
||||
}
|
||||
return gitPrInfo
|
||||
}
|
||||
|
||||
def notifyByEmail(def gitPrInfo) {
|
||||
stage('Notify') {
|
||||
String notifyPeople = "${gitPrInfo.prAuthorEmail}, ${gitPrInfo.commitAuthorEmail}"
|
||||
emailext (
|
||||
subject: "OpenVino CI: PR ${CHANGE_ID} ${currentBuild.result}!",
|
||||
body: """
|
||||
Status: ${currentBuild.result}
|
||||
Pull Request Title: ${CHANGE_TITLE}
|
||||
Pull Request: ${CHANGE_URL}
|
||||
Branch: ${CHANGE_BRANCH}
|
||||
Commit Hash: ${gitPrInfo.commitSubject}
|
||||
Commit Subject: ${gitPrInfo.commitHash}
|
||||
Jenkins Build: ${RUN_DISPLAY_URL}
|
||||
""",
|
||||
to: "${notifyPeople}"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
def gitSubmoduleUpdate(String repository_name, String workdir) {
|
||||
dir ("${workdir}/${repository_name}") {
|
||||
sh label: "Init ${repository_name} submodules",
|
||||
script:
|
||||
"""
|
||||
git submodule init && git submodule update \
|
||||
--init \
|
||||
--no-fetch \
|
||||
--recursive
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
def prepare_repository(String workdir) {
|
||||
dir("${workdir}") {
|
||||
println "Preparing repository in directory: ${workdir}"
|
||||
checkout scm
|
||||
gitSubmoduleUpdate(PROJECT_NAME, workdir)
|
||||
}
|
||||
}
|
||||
|
||||
def updateModels() {
|
||||
sh """
|
||||
./src/bindings/python/tests/test_onnx/model_zoo_preprocess.sh -d ${HOME}/ONNX_CI/models_data -o -s ${ONNX_MODEL_ZOO_SHA}
|
||||
"""
|
||||
}
|
||||
|
||||
def get_docker_container_name(Map configuration){
|
||||
println "RUN get_docker_container_name for ${configuration.name}"
|
||||
String docker_container_name = "${DOCKER_CONTAINER_NAME}_${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}"
|
||||
return docker_container_name
|
||||
}
|
||||
|
||||
def buildDockerImage(Map configuration, String workdir) {
|
||||
String docker_image_tag = "${DOCKER_IMAGE_TAG}_${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}".toLowerCase()
|
||||
println "docker_image_tag: ${docker_image_tag}"
|
||||
updateModels()
|
||||
sh """
|
||||
docker build --tag=${docker_image_tag} \
|
||||
--build-arg BUILD_TYPE=${configuration.build_type} \
|
||||
--file=.ci/openvino-onnx/Dockerfile \
|
||||
--build-arg http_proxy=${HTTP_PROXY} \
|
||||
--build-arg https_proxy=${HTTPS_PROXY} .
|
||||
"""
|
||||
}
|
||||
|
||||
def runTests(Map configuration, String workdir) {
|
||||
println "Run tests for ${configuration.name}"
|
||||
String docker_image_tag = "${DOCKER_IMAGE_TAG}_${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}".toLowerCase()
|
||||
|
||||
String docker_container_name = get_docker_container_name(configuration)
|
||||
|
||||
// Run only basic unit tests in Debug configuration
|
||||
if (configuration.build_type == "Debug") {
|
||||
sh """
|
||||
docker run --name ${docker_container_name} ${docker_image_tag}
|
||||
"""
|
||||
}
|
||||
|
||||
// Run unit-tests AND large model tests by default
|
||||
else {
|
||||
sh """
|
||||
docker run --name ${docker_container_name} \
|
||||
--volume ${HOME}/ONNX_CI/models_data/model_zoo/onnx_model_zoo_${ONNX_MODEL_ZOO_SHA}:/root/.onnx/model_zoo/onnx_model_zoo \
|
||||
--volume ${HOME}/ONNX_CI/data/model_zoo/MSFT:/root/.onnx/model_zoo/MSFT \
|
||||
${docker_image_tag} /bin/bash -c "tox && tox -e zoo_models"
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
def getConfigurationsMap() {
|
||||
def configurationsMap = [:]
|
||||
for (backend in BACKEND_CONFIGURATIONS) {
|
||||
def configuration = backend.clone()
|
||||
configurationsMap[configuration.name] = {
|
||||
stage(configuration.name) { CONFIGURATION_WORKFLOW(configuration) }
|
||||
}
|
||||
}
|
||||
return configurationsMap
|
||||
}
|
||||
|
||||
CONFIGURATION_WORKFLOW = { configuration ->
|
||||
node("OpenVINO") {
|
||||
String workdir = "${HOME}/workspace/${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}"
|
||||
try {
|
||||
PROJECT_NAME = "openvino"
|
||||
stage("Clone repository") {
|
||||
prepare_repository(workdir)
|
||||
}
|
||||
stage("Prepare Docker environment") {
|
||||
dir("${workdir}") {
|
||||
buildDockerImage(configuration, workdir)
|
||||
}
|
||||
}
|
||||
stage("Run tests") {
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
runTests(configuration, workdir)
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
// Set result to ABORTED if exception contains exit code of a process interrupted by SIGTERM
|
||||
if ("$e".contains("143")) {
|
||||
currentBuild.result = "ABORTED"
|
||||
} else {
|
||||
currentBuild.result = "FAILURE"
|
||||
}
|
||||
def gitPrInfo = getGitPrInfo(PROJECT_NAME, workdir)
|
||||
notifyByEmail(gitPrInfo)
|
||||
}
|
||||
finally {
|
||||
stage("Cleanup") {
|
||||
String docker_container_name = get_docker_container_name(configuration)
|
||||
sh """
|
||||
docker rm -f ${docker_container_name}
|
||||
rm -rf ${workdir}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
options {
|
||||
skipDefaultCheckout true
|
||||
timeout(activity: true, time: 120, unit: 'MINUTES')
|
||||
}
|
||||
stages {
|
||||
stage('Parallel CI') {
|
||||
steps {
|
||||
stopPreviousRunningBuilds()
|
||||
script {
|
||||
parallelStagesMap = getConfigurationsMap()
|
||||
parallel parallelStagesMap
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
65
.ci/openvino-onnx/watchdog/Jenkinsfile
vendored
65
.ci/openvino-onnx/watchdog/Jenkinsfile
vendored
@@ -1,65 +0,0 @@
|
||||
// Copyright (C) 2018-2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
timeout(30)
|
||||
{
|
||||
node(LABEL) {
|
||||
|
||||
BUILD_WORKSPACE = "$WORKSPACE/$BUILD_NUMBER"
|
||||
WATCHDOG_ROOT = "$BUILD_WORKSPACE/.ci/openvino-onnx/watchdog"
|
||||
VENV_PATH = "${BUILD_WORKSPACE}/.wdvenv"
|
||||
|
||||
try {
|
||||
stage("Clone repository") {
|
||||
dir ("$BUILD_WORKSPACE") {
|
||||
checkout([$class: 'GitSCM', branches: [[name: "*/$BRANCH"]],
|
||||
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', timeout: 30]], submoduleCfg: [],
|
||||
userRemoteConfigs: [[credentialsId: "${GITHUB_KEY}", url: "${OPEN_VINO_URL}"]]])
|
||||
}
|
||||
}
|
||||
stage("Prepare environment") {
|
||||
sh """#!/bin/bash
|
||||
if [ ! -d ${VENV_PATH} ]; then
|
||||
python3 -m venv ${VENV_PATH}
|
||||
source ${VENV_PATH}/bin/activate
|
||||
pip install -r ${WATCHDOG_ROOT}/requirements.txt
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage("Run script") {
|
||||
withCredentials([
|
||||
usernamePassword(credentialsId: '7157091e-bc04-42f0-99fd-dc4da2922a55',
|
||||
usernameVariable: 'username',
|
||||
passwordVariable: 'password')])
|
||||
{
|
||||
dir ("$BUILD_WORKSPACE") {
|
||||
sh """#!/bin/bash
|
||||
source ${VENV_PATH}/bin/activate
|
||||
export PYTHONHTTPSVERIFY=0
|
||||
python ${WATCHDOG_ROOT}/src/main.py \
|
||||
--msteams-url=${MSTEAMS_URL_FILE} \
|
||||
--github-credentials '${username}' '${password}' \
|
||||
--github-org=${GITHUB_ORG} \
|
||||
--github-project=${GITHUB_PROJECT} \
|
||||
--jenkins-token=${JENKINS_TOKEN_FILE} \
|
||||
--jenkins-server=${JENKINS_SERVER} \
|
||||
--jenkins-user=${JENKINS_USER} \
|
||||
--ci-job=${CI_JOB_NAME} \
|
||||
--watchdog-job=${WATCHDOG_JOB_NAME}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
echo "$e"
|
||||
currentBuild.result = "FAILURE"
|
||||
} finally {
|
||||
stage("Cleanup") {
|
||||
sh """
|
||||
cd $BUILD_WORKSPACE
|
||||
rm -rf ..?* .[!.]* *
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
python-jenkins==1.7.0
|
||||
retrying==1.3.3
|
||||
pygithub==1.51
|
||||
timeout-decorator==0.4.1
|
||||
requests==2.23.0
|
||||
wheel
|
||||
@@ -1,108 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import logging
|
||||
import timeout_decorator
|
||||
from datetime import datetime
|
||||
from retrying import retry
|
||||
from github import Github, GithubException
|
||||
|
||||
# Logging
|
||||
logging.basicConfig(format='%(name)s - %(levelname)s - %(message)s')
|
||||
log = logging.getLogger(__name__)
|
||||
log.setLevel(logging.INFO)
|
||||
|
||||
_RETRY_LIMIT = 3
|
||||
_RETRY_COOLDOWN_MS = 2000
|
||||
_REQUEST_TIMEOUT_S = 10
|
||||
|
||||
|
||||
class GitWrapper:
|
||||
"""Class wrapping PyGithub API.
|
||||
|
||||
The purpose of this class is to wrap methods from PyGithub API used in Watchdog, for less error-prone and
|
||||
more convenient use. Docs for used API, including wrapped methods can be found at:
|
||||
https://pygithub.readthedocs.io/en/latest/introduction.html
|
||||
|
||||
:param github_credentials: Credentials used for GitHub
|
||||
:param repository: GitHub repository name
|
||||
:param project: GitHub project name
|
||||
:type github_credentials: String
|
||||
:type repository: String
|
||||
:type project: String
|
||||
"""
|
||||
|
||||
def __init__(self, github_credentials, repository, project):
|
||||
self.git = Github(*github_credentials)
|
||||
self.repository = repository
|
||||
self.project = project
|
||||
self.github_credentials = github_credentials
|
||||
|
||||
@retry(stop_max_attempt_number=_RETRY_LIMIT, wait_fixed=_RETRY_COOLDOWN_MS)
|
||||
def get_git_time(self):
|
||||
"""Retrieve time from GitHub.
|
||||
|
||||
Used to reliably determine time during Watchdog run.
|
||||
|
||||
:return: Datetime object describing current time
|
||||
:rtype: datetime
|
||||
"""
|
||||
try:
|
||||
datetime_object = self._get_git_time()
|
||||
except ValueError as e:
|
||||
raise GitWrapperError(str(e))
|
||||
except GithubException as e:
|
||||
message = 'GitHub Exception during API status retrieval. Exception: {}'.format(str(e))
|
||||
raise GitWrapperError(message)
|
||||
except timeout_decorator.TimeoutError:
|
||||
message = 'GitHub Exception during API status retrieval. Timeout during API request.'
|
||||
raise GitWrapperError(message)
|
||||
return datetime_object
|
||||
|
||||
@retry(stop_max_attempt_number=_RETRY_LIMIT, wait_fixed=_RETRY_COOLDOWN_MS)
|
||||
def get_pull_requests(self):
|
||||
"""Retrieve paginated list of pull requests from GitHub.
|
||||
|
||||
:return: Paginated list of Pull Requests in GitHub repo
|
||||
:rtype: github.PaginatedList.PaginatedList of github.PullRequest.PullRequest
|
||||
"""
|
||||
try:
|
||||
prs = self._get_pull_requests()
|
||||
except GithubException as e:
|
||||
message = 'GitHub Exception during API status retrieval. Exception: {}'.format(str(e))
|
||||
raise GitWrapperError(message)
|
||||
return prs
|
||||
|
||||
@timeout_decorator.timeout(_REQUEST_TIMEOUT_S)
|
||||
def _get_git_time(self):
|
||||
"""Private method retrieving time from GitHub.
|
||||
|
||||
:return: Datetime object describing current time
|
||||
:rtype: datetime
|
||||
"""
|
||||
datetime_string = self.git.get_api_status().raw_headers.get('date', '')
|
||||
datetime_format = '%a, %d %b %Y %H:%M:%S %Z'
|
||||
datetime_object = datetime.strptime(datetime_string, datetime_format)
|
||||
return datetime_object
|
||||
|
||||
@timeout_decorator.timeout(_REQUEST_TIMEOUT_S)
|
||||
def _get_pull_requests(self):
|
||||
"""Private method retrieving pull requests from GitHub.
|
||||
|
||||
:return: Paginated list of Pull Requests in GitHub repo
|
||||
:rtype: github.PaginatedList.PaginatedList of github.PullRequest.PullRequest
|
||||
"""
|
||||
return self.git.get_organization(self.repository).get_repo(self.project).get_pulls()
|
||||
|
||||
|
||||
class GitWrapperError(Exception):
|
||||
"""Base class for exceptions raised in GitWrapper.
|
||||
|
||||
:param message Explanation of the error
|
||||
"""
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
log.exception(message)
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import requests
|
||||
import jenkins
|
||||
import logging
|
||||
from retrying import retry
|
||||
|
||||
# Logging
|
||||
logging.basicConfig(format='%(name)s - %(levelname)s - %(message)s')
|
||||
log = logging.getLogger(__name__)
|
||||
log.setLevel(logging.INFO)
|
||||
|
||||
_RETRY_LIMIT = 3
|
||||
_RETRY_COOLDOWN_MS = 5000
|
||||
|
||||
|
||||
class JenkinsWrapper:
|
||||
"""Class wrapping Python-Jenkins API.
|
||||
|
||||
The purpose of this class is to wrap methods from Python-Jenkins API used in Watchdog, for less error-prone and
|
||||
more convenient use. Docs for used API, including wrapped methods can be found at:
|
||||
https://python-jenkins.readthedocs.io/en/latest/
|
||||
|
||||
:param jenkins_token: Token used for Jenkins
|
||||
:param jenkins_user: Username used to connect to Jenkins
|
||||
:param jenkins_server: Jenkins server address
|
||||
:type jenkins_token: String
|
||||
:type jenkins_user: String
|
||||
:type jenkins_server: String
|
||||
"""
|
||||
|
||||
def __init__(self, jenkins_token, jenkins_user, jenkins_server):
|
||||
self.jenkins_server = jenkins_server
|
||||
self.jenkins = jenkins.Jenkins(jenkins_server, username=jenkins_user,
|
||||
password=jenkins_token)
|
||||
|
||||
@retry(stop_max_attempt_number=_RETRY_LIMIT, wait_fixed=_RETRY_COOLDOWN_MS)
|
||||
def get_build_console_output(self, job_name, build_number):
|
||||
return self.jenkins.get_build_console_output(job_name, build_number)
|
||||
|
||||
@retry(stop_max_attempt_number=_RETRY_LIMIT, wait_fixed=_RETRY_COOLDOWN_MS)
|
||||
def get_job_info(self, job_name):
|
||||
return self.jenkins.get_job_info(job_name)
|
||||
|
||||
@retry(stop_max_attempt_number=_RETRY_LIMIT, wait_fixed=_RETRY_COOLDOWN_MS)
|
||||
def get_build_info(self, job_name, build_number):
|
||||
return self.jenkins.get_build_info(job_name, build_number)
|
||||
|
||||
@retry(stop_max_attempt_number=_RETRY_LIMIT, wait_fixed=_RETRY_COOLDOWN_MS)
|
||||
def get_queue_item(self, queue_id):
|
||||
"""Attempt to retrieve Jenkins job queue item.
|
||||
|
||||
Exception communicating queue doesn't exist is expected,
|
||||
in that case method returns empty dict.
|
||||
|
||||
:param queue_id: Jenkins job queue ID number
|
||||
:type queue_id: int
|
||||
:return: Dictionary representing Jenkins job queue item
|
||||
:rtype: dict
|
||||
"""
|
||||
try:
|
||||
return self.jenkins.get_queue_item(queue_id)
|
||||
except Exception as e:
|
||||
# Exception 'queue does not exist' is expected behaviour when job is running
|
||||
if 'queue' in str(e) and 'does not exist' in str(e):
|
||||
return {}
|
||||
else:
|
||||
raise
|
||||
|
||||
@retry(stop_max_attempt_number=_RETRY_LIMIT, wait_fixed=_RETRY_COOLDOWN_MS)
|
||||
def get_idle_ci_hosts(self):
|
||||
"""Query Jenkins for idle servers.
|
||||
|
||||
Send GET request to Jenkins server, querying for idle servers labeled
|
||||
for OpenVino-ONNX CI job.
|
||||
|
||||
:return: Number of idle hosts delegated to OpenVino-ONNX CI
|
||||
:rtype: int
|
||||
"""
|
||||
jenkins_request_url = self.jenkins_server + 'label/ci&&onnx/api/json?pretty=true'
|
||||
try:
|
||||
log.info('Sending request to Jenkins: %s', jenkins_request_url)
|
||||
r = requests.Request(method='GET', url=jenkins_request_url, verify=False)
|
||||
response = self.jenkins.jenkins_request(r).json()
|
||||
return int(response['totalExecutors']) - int(response['busyExecutors'])
|
||||
except Exception as e:
|
||||
log.exception('Failed to send request to Jenkins!\nException message: %s', str(e))
|
||||
raise
|
||||
@@ -1,89 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from watchdog import Watchdog
|
||||
|
||||
DEFAULT_MSTEAMS_URL_FILE = '/home/lab_nerval/tokens/msteams_url'
|
||||
DEFAULT_GITHUB_ORGANIZATION = 'openvinotoolkit'
|
||||
DEFAULT_GITHUB_PROJECT = 'openvino'
|
||||
DEFAULT_JENKINS_TOKEN_FILE = '/home/lab_nerval/tokens/crackerjack'
|
||||
DEFAULT_JENKINS_SERVER = 'https://crackerjack.intel.com/'
|
||||
DEFAULT_JENKINS_USER = 'lab_nerval'
|
||||
DEFAULT_CI_JOB_NAME = 'onnx/OpenVino_CI'
|
||||
DEFAULT_WATCHDOG_JOB_NAME = 'onnx/ci_watchdog'
|
||||
|
||||
|
||||
def main(args):
|
||||
"""
|
||||
Read args passed to script, load tokens and run watchdog.
|
||||
|
||||
Keyword arguments:
|
||||
:param args: arguments parsed by argparse ArgumentParser
|
||||
|
||||
:return: returns status code 0 on successful completion
|
||||
|
||||
"""
|
||||
jenkins_server = args.jenkins_server.strip()
|
||||
jenkins_user = args.jenkins_user.strip()
|
||||
jenkins_token = open(args.jenkins_token).read().replace('\n', '').strip()
|
||||
msteams_url = open(args.msteams_url).read().replace('\n', '').strip()
|
||||
github_credentials = args.github_credentials
|
||||
github_org = args.github_org
|
||||
github_project = args.github_project
|
||||
ci_job = args.ci_job.strip()
|
||||
watchdog_job = args.watchdog_job.strip()
|
||||
quiet = args.quiet
|
||||
|
||||
wd = Watchdog(jenkins_token=jenkins_token,
|
||||
jenkins_server=jenkins_server,
|
||||
jenkins_user=jenkins_user,
|
||||
github_credentials=github_credentials,
|
||||
git_org=github_org,
|
||||
git_project=github_project,
|
||||
msteams_url=msteams_url,
|
||||
ci_job_name=ci_job,
|
||||
watchdog_job_name=watchdog_job)
|
||||
wd.run(quiet=quiet)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('--msteams-url', help='Path to MS Teams channel url to communicate messages.',
|
||||
default=DEFAULT_MSTEAMS_URL_FILE, action='store', required=False)
|
||||
|
||||
parser.add_argument('--github-credentials', help='GitHub user credentials to access repo.',
|
||||
nargs="+", required=True)
|
||||
|
||||
parser.add_argument('--github-org', help='Name of organization on GitHub.',
|
||||
default=DEFAULT_GITHUB_ORGANIZATION, action='store', required=False)
|
||||
|
||||
parser.add_argument('--github-project', help='Name of project on GitHub.',
|
||||
default=DEFAULT_GITHUB_PROJECT, action='store', required=False)
|
||||
|
||||
parser.add_argument('--jenkins-token', help='Path to Jenkins user token to access build info.',
|
||||
default=DEFAULT_JENKINS_TOKEN_FILE, action='store', required=False)
|
||||
|
||||
parser.add_argument('--jenkins-server', help='Jenkins server address.',
|
||||
default=DEFAULT_JENKINS_SERVER, action='store', required=False)
|
||||
|
||||
parser.add_argument('--jenkins-user', help='Jenkins user used to log in.',
|
||||
default=DEFAULT_JENKINS_USER, action='store', required=False)
|
||||
|
||||
parser.add_argument('--ci-job', help='Jenkins CI job name.',
|
||||
default=DEFAULT_CI_JOB_NAME, action='store', required=False)
|
||||
|
||||
parser.add_argument('--watchdog-job', help='Jenkins CI Watchdog job name.',
|
||||
default=DEFAULT_WATCHDOG_JOB_NAME, action='store', required=False)
|
||||
|
||||
parser.add_argument('--quiet', help="Quiet mode - doesn\'t send message to communicator.",
|
||||
action='store_true', required=False)
|
||||
|
||||
args = parser.parse_args()
|
||||
sys.exit(main(args))
|
||||
@@ -1,128 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
class MSTeamsCommunicator:
|
||||
"""Class communicating with MSTeams using Incoming Webhook.
|
||||
|
||||
The purpose of this class is to use MSTeams API to send message.
|
||||
Docs for used API, including wrapped methods can be found at:
|
||||
https://docs.microsoft.com/en-us/outlook/actionable-messages/send-via-connectors
|
||||
"""
|
||||
|
||||
def __init__(self, _ci_alerts_channel_url):
|
||||
self._ci_alerts_channel_url = _ci_alerts_channel_url
|
||||
self._queued_messages = {
|
||||
self._ci_alerts_channel_url: [],
|
||||
}
|
||||
|
||||
@property
|
||||
def messages(self):
|
||||
"""
|
||||
Get list of queued messages.
|
||||
|
||||
:return: List of queued messages
|
||||
:return type: List[String]
|
||||
"""
|
||||
return self._queued_messages.values()
|
||||
|
||||
def queue_message(self, message):
|
||||
"""
|
||||
Queue message to be sent later.
|
||||
|
||||
:param message: Message content
|
||||
:type message: String
|
||||
"""
|
||||
self._queued_messages[self._ci_alerts_channel_url].append(message)
|
||||
|
||||
def _parse_text(self, watchdog_log, message):
|
||||
"""
|
||||
Parse text to display as alert.
|
||||
|
||||
:param watchdog_log: Watchdog log content
|
||||
:param message: Unparsed message content
|
||||
:type watchdog_log: String
|
||||
:type message: String
|
||||
"""
|
||||
message_split = message.split('\n')
|
||||
log_url = None
|
||||
if len(message_split) == 3:
|
||||
log_url = message_split[-1]
|
||||
title = message_split[0]
|
||||
text = message_split[1]
|
||||
header = watchdog_log.split(' - ')
|
||||
header_formatted = '{} - [Watchdog Log]({})'.format(header[0], header[1])
|
||||
return title, log_url, '{}\n\n{}'.format(header_formatted, text)
|
||||
|
||||
def _json_request_content(self, title, log_url, text_formatted):
|
||||
"""
|
||||
Create final json request to send message to MS Teams channel.
|
||||
|
||||
:param title: Title of alert
|
||||
:param log_url: URL to PR
|
||||
:param text_formatted: General content of alert - finally formatted
|
||||
:type title: String
|
||||
:type title: String
|
||||
:type title: String
|
||||
"""
|
||||
data = {
|
||||
'@context': 'https://schema.org/extensions',
|
||||
'@type': 'MessageCard',
|
||||
'themeColor': '0072C6',
|
||||
'title': title,
|
||||
'text': text_formatted,
|
||||
'potentialAction':
|
||||
[
|
||||
{
|
||||
'@type': 'OpenUri',
|
||||
'name': 'Open PR',
|
||||
'targets':
|
||||
[
|
||||
{
|
||||
'os': 'default',
|
||||
'uri': log_url,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
return data
|
||||
|
||||
def _send_to_channel(self, watchdog_log, message_queue, channel_url):
|
||||
"""
|
||||
Send MSTeams message to specified channel.
|
||||
|
||||
:param watchdog_log: Watchdog log content
|
||||
:param message_queue: Queued messages to send
|
||||
:param channel_url: Channel url
|
||||
:type watchdog_log: String
|
||||
:type message_queue: String
|
||||
:type channel_url: String
|
||||
|
||||
"""
|
||||
for message in message_queue:
|
||||
title, log_url, text_formatted = self._parse_text(watchdog_log, message)
|
||||
data = self._json_request_content(title, log_url, text_formatted)
|
||||
|
||||
try:
|
||||
requests.post(url=channel_url, json=data)
|
||||
except Exception as ex:
|
||||
raise Exception('!!CRITICAL!! MSTeamsCommunicator: Could not send message '
|
||||
'due to {}'.format(ex))
|
||||
|
||||
def send_message(self, watchdog_log, quiet=False):
|
||||
"""
|
||||
Send queued messages as single communication.
|
||||
|
||||
:param watchdog_log: Watchdog log content
|
||||
:param quiet: Flag for disabling sending report through MS Teams
|
||||
:type watchdog_log: String
|
||||
:type quiet: Boolean
|
||||
"""
|
||||
for channel, message_queue in self._queued_messages.items():
|
||||
if not quiet and message_queue:
|
||||
self._send_to_channel(watchdog_log, message_queue, channel)
|
||||
@@ -1,505 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import datetime
|
||||
import time
|
||||
import re
|
||||
import logging
|
||||
import requests
|
||||
from ms_teams_communicator import MSTeamsCommunicator
|
||||
from jenkins_wrapper import JenkinsWrapper
|
||||
from jenkins import NotFoundException
|
||||
from git_wrapper import GitWrapper, GitWrapperError
|
||||
import os
|
||||
import json
|
||||
|
||||
# Logging
|
||||
logging.basicConfig(format='%(name)s - %(levelname)s - %(message)s')
|
||||
log = logging.getLogger(__name__)
|
||||
log.setLevel(logging.INFO)
|
||||
|
||||
# Watchdog static constant variables
|
||||
_SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||
_BUILD_DURATION_THRESHOLD = datetime.timedelta(minutes=60)
|
||||
_CI_START_THRESHOLD = datetime.timedelta(minutes=30)
|
||||
_AWAITING_JENKINS_THRESHOLD = datetime.timedelta(minutes=5)
|
||||
_WATCHDOG_DIR = os.path.expanduser('~')
|
||||
_PR_REPORTS_CONFIG_KEY = 'pr_reports'
|
||||
_CI_BUILD_FAIL_MESSAGE = 'ERROR: py3: commands failed'
|
||||
_CI_BUILD_SUCCESS_MESSAGE = 'py3: commands succeeded'
|
||||
_GITHUB_CI_CHECK_NAME = 'OpenVINO-ONNX'
|
||||
|
||||
INTERNAL_ERROR_MESSAGE_HEADER = '!!! --- !!! INTERNAL WATCHDOG ERROR !!! --- !!!'
|
||||
ERROR_MESSAGE_HEADER = '!!! OpenVino-ONNX CI Error !!!'
|
||||
WARNING_MESSAGE_HEADER = 'OpenVino-ONNX CI WARNING'
|
||||
INFO_MESSAGE_HEADER = 'OpenVino-ONNX CI INFO'
|
||||
|
||||
|
||||
class Watchdog:
|
||||
"""Class describing OpenVino-ONNX-CI Watchdog.
|
||||
|
||||
Watchdog connects to GitHub and retrieves the list of current pull requests (PRs) in
|
||||
OpenVino repository. Then it connects to specified Jenkins server to
|
||||
check CI jobs associated with every PR. Watchdog verifies time durations for Jenkins
|
||||
initial response, job queue and execution against time treshold constants. Every fail
|
||||
is logged and reported through MS Teams communicators.
|
||||
|
||||
:param jenkins_token: Token used for Jenkins
|
||||
:param jenkins_server: Jenkins server address
|
||||
:param jenkins_user: Username used to connect to Jenkins
|
||||
:param github_credentials: Credentials used to connect to GitHub
|
||||
:param msteams_url: URL used to connect to MS Teams channel
|
||||
:param ci_job_name: OpenVino-ONNX CI job name used in Jenkins
|
||||
:param watchdog_job_name: Watchdog job name used in Jenkins
|
||||
:type jenkins_token: String
|
||||
:type jenkins_server: String
|
||||
:type jenkins_user: String
|
||||
:type github_credentials: String
|
||||
:type msteams_url: String
|
||||
:type ci_job_name: String
|
||||
:type watchdog_job_name: String
|
||||
|
||||
.. note::
|
||||
Watchdog and OpenVino-ONNX CI job must be placed on the same Jenkins server.
|
||||
"""
|
||||
|
||||
def __init__(self, jenkins_token, jenkins_server, jenkins_user, github_credentials, git_org,
|
||||
git_project, msteams_url, ci_job_name, watchdog_job_name):
|
||||
self._config_path = os.path.join(_WATCHDOG_DIR, '{}/.{}_ci_watchdog.json'.format(_WATCHDOG_DIR, git_project))
|
||||
# Jenkins Wrapper object for CI job
|
||||
self._jenkins = JenkinsWrapper(jenkins_token,
|
||||
jenkins_user=jenkins_user,
|
||||
jenkins_server=jenkins_server)
|
||||
# Load GitHub token and log in, retrieve pull requests
|
||||
self._git = GitWrapper(github_credentials, repository=git_org, project=git_project)
|
||||
# Create MS Teams api object
|
||||
self._msteams_hook = MSTeamsCommunicator(msteams_url)
|
||||
self._ci_job_name = ci_job_name.lower()
|
||||
self._watchdog_job_name = watchdog_job_name
|
||||
# Read config file
|
||||
self._config = self._read_config_file()
|
||||
# Time at Watchdog initiation
|
||||
self._now_time = datetime.datetime.now()
|
||||
self._current_prs = {}
|
||||
self._ms_teams_enabled = True
|
||||
|
||||
def run(self, quiet=False):
|
||||
"""Run main watchdog logic.
|
||||
|
||||
Retrieve list of pull requests and pass it to the method responsible for checking them.
|
||||
|
||||
:param quiet: Flag for disabling sending report through communicator
|
||||
:type quiet: Boolean
|
||||
"""
|
||||
try:
|
||||
pull_requests = self._git.get_pull_requests()
|
||||
except GitWrapperError:
|
||||
message = 'Failed to retrieve Pull Requests!'
|
||||
log.exception(message)
|
||||
self._queue_message(message, message_severity='internal')
|
||||
# Check all pull requests
|
||||
for pr in pull_requests:
|
||||
try:
|
||||
self._check_pr(pr)
|
||||
except Exception as e:
|
||||
log.exception(str(e))
|
||||
self._queue_message(str(e), message_severity='internal', pr=pr)
|
||||
self._update_config()
|
||||
self._send_message(quiet=quiet)
|
||||
|
||||
def _read_config_file(self):
|
||||
"""Read Watchdog config file stored on the system.
|
||||
|
||||
The file stores every fail already reported along with timestamp. This
|
||||
mechanism is used to prevent Watchdog from reporting same failure
|
||||
multiple times. In case there's no config under the expected path,
|
||||
appropriate data structure is created and returned.
|
||||
|
||||
:return: Returns dict of dicts with reported fails with their timestamps
|
||||
:rtype: dict of dicts
|
||||
"""
|
||||
if os.path.isfile(self._config_path):
|
||||
log.info('Reading config file in: {}'.format(self._config_path))
|
||||
file = open(self._config_path, 'r')
|
||||
data = json.load(file)
|
||||
else:
|
||||
log.info('No config file found in: {}'.format(self._config_path))
|
||||
data = {_PR_REPORTS_CONFIG_KEY: {}}
|
||||
return data
|
||||
|
||||
def _check_pr(self, pr):
|
||||
"""Check pull request (if there's no reason to skip).
|
||||
|
||||
Retrieve list of statuses for every PR's last commit and interpret them. Filters out statuses
|
||||
unrelated to OpenVino-ONNX Jenkins CI and passes relevant statuses to method that interprets them.
|
||||
If no commit statuses related to Jenkins are available after time defined by
|
||||
**_AWAITING_JENKINS_THRESHOLD** calls appropriate method to check for builds waiting in queue.
|
||||
|
||||
:param pr: GitHub Pull Requests
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
"""
|
||||
log.info('===============================================')
|
||||
log.info('Checking PR#{}'.format(pr.number))
|
||||
# Get last Jenkins status
|
||||
last_status = self._get_last_status(pr)
|
||||
# Append PR checked in current run for Watchdog config
|
||||
self._current_prs[str(pr.number)] = self._get_pr_timestamps(pr, last_status)
|
||||
if self._should_ignore(pr) or self._updated_since_last_run(pr):
|
||||
log.info('Ignoring PR#{}'.format(pr.number))
|
||||
|
||||
return
|
||||
|
||||
# Calculate time passed since PR update (any commit, merge or comment)
|
||||
pr_time_delta = self._now_time - pr.updated_at
|
||||
if last_status:
|
||||
# Interpret found CI statuses
|
||||
log.info('Last status: {} at {}'.format(last_status.description, last_status.updated_at))
|
||||
self._interpret_status(last_status, pr)
|
||||
elif pr_time_delta > _CI_START_THRESHOLD:
|
||||
# If there's no status after assumed time - check if build is waiting in queue
|
||||
log.info('CI for PR {}: NO JENKINS STATUS YET'.format(pr.number))
|
||||
self._check_missing_status(pr)
|
||||
|
||||
@staticmethod
|
||||
def _get_pr_timestamps(pr, last_status):
|
||||
"""Get dict containing PR timestamp and last status timestamp.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
|
||||
:return: Dictionary with PR and last status update timestamps
|
||||
:rtype: dict
|
||||
"""
|
||||
pr_timestamp = time.mktime(pr.updated_at.timetuple())
|
||||
if last_status:
|
||||
status_timestamp = time.mktime(last_status.updated_at.timetuple())
|
||||
else:
|
||||
status_timestamp = None
|
||||
pr_dict = {'pr_timestamp': pr_timestamp,
|
||||
'status_timestamp': status_timestamp}
|
||||
return pr_dict
|
||||
|
||||
@staticmethod
|
||||
def _get_last_status(pr):
|
||||
"""Get last commit status posted from Jenkins.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
|
||||
:return: Either last PR status posted from Jenkins or None
|
||||
:rtype: github.CommitStatus.CommitStatus
|
||||
"""
|
||||
# Find last commit in PR
|
||||
last_commit = pr.get_commits().reversed[0]
|
||||
# Get statuses and filter them to contain only those related to Jenkins CI
|
||||
# and check if CI in Jenkins started
|
||||
statuses = last_commit.get_statuses()
|
||||
jenk_statuses = [stat for stat in statuses if
|
||||
_GITHUB_CI_CHECK_NAME in stat.context]
|
||||
try:
|
||||
last_status = jenk_statuses[0]
|
||||
except IndexError:
|
||||
last_status = None
|
||||
return last_status
|
||||
|
||||
@staticmethod
|
||||
def _should_ignore(pr):
|
||||
"""Determine if PR should be ignored.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
|
||||
:return: Returns True if PR should be ignored
|
||||
:rtype: Bool
|
||||
"""
|
||||
# Ignore PR if it has WIP label or WIP in title
|
||||
if 'WIP' in pr.title:
|
||||
log.info('PR#{} should be ignored. WIP tag in title.'.format(pr.number))
|
||||
return True
|
||||
|
||||
label_names = [label.name for label in pr.labels]
|
||||
if 'WIP' in label_names:
|
||||
log.info('PR#{} should be ignored. WIP label present.'.format(pr.number))
|
||||
return True
|
||||
|
||||
# Ignore PR if base ref is not master
|
||||
if 'master' not in pr.base.ref:
|
||||
log.info('PR#{} should be ignored. Base ref is not master'.format(pr.number))
|
||||
return True
|
||||
|
||||
# Ignore PR if mergeable state is 'dirty' or 'behind'.
|
||||
# Practically this ignores PR in case of merge conflicts
|
||||
ignored_mergeable_states = ['behind', 'dirty', 'draft']
|
||||
if pr.mergeable_state in ignored_mergeable_states:
|
||||
log.info('PR#{} should be ignored. Mergeable state is {}. '.format(pr.number, pr.mergeable_state))
|
||||
return True
|
||||
|
||||
# If no criteria for ignoring PR are met - return false
|
||||
return False
|
||||
|
||||
def _updated_since_last_run(self, pr):
|
||||
# Ignore if PR was already checked and there was no update in meantime
|
||||
pr_number = str(pr.number)
|
||||
current_pr_timestamps = self._current_prs.get(pr_number)
|
||||
last_pr_timestamps = self._config[_PR_REPORTS_CONFIG_KEY].get(pr_number)
|
||||
if current_pr_timestamps == last_pr_timestamps:
|
||||
log.info('PR#{} - No update since last check'.format(pr.number))
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def _check_missing_status(self, pr):
|
||||
"""Verify if missing status is expected.
|
||||
|
||||
This method checks if CI build for last was scheduled and still waits in queue for
|
||||
executor.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
"""
|
||||
pr_time_delta = self._now_time - pr.updated_at
|
||||
try:
|
||||
build_number = self._build_scheduled(pr)
|
||||
if self._build_in_queue(pr, build_number):
|
||||
message = ('PR# {}: build waiting in queue after {} minutes.'
|
||||
.format(pr.number, pr_time_delta.seconds / 60))
|
||||
severity = 'warning'
|
||||
else:
|
||||
message = ('PR# {}: missing status on GitHub after {} minutes.'
|
||||
.format(pr.number, pr_time_delta.seconds / 60))
|
||||
severity = 'error'
|
||||
self._queue_message(message, message_severity=severity, pr=pr)
|
||||
except TypeError:
|
||||
log.info('Committer outside of OpenVino organization')
|
||||
|
||||
def _build_scheduled(self, pr):
|
||||
"""Check if Jenkins build corresponding to PR was scheduled.
|
||||
|
||||
This method takes last Jenkins build for given PR and compares hash from Jenkins console output
|
||||
and sha from PR object to determine if CI build for appropriate commit was scheduled.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
|
||||
:return: Returns build number or -1 if no build found
|
||||
:rtype: int
|
||||
"""
|
||||
pr_number = str(pr.number)
|
||||
project_name_full = self._ci_job_name + '/PR-' + pr_number
|
||||
|
||||
try:
|
||||
# Retrieve console output from last Jenkins build for job corresponding to this PR
|
||||
last_build_number = self._jenkins.get_job_info(project_name_full)['lastBuild']['number']
|
||||
console_output = self._jenkins.get_build_console_output(project_name_full, last_build_number)
|
||||
# Check if CI build was scheduled - commit hash on GH must match hash in last Jenkins build console output
|
||||
# Retrieve hash from Jenkins output
|
||||
match_string = '(?:Obtained .ci/[a-zA-Z/]+Jenkinsfile from ([a-z0-9]{40}))'
|
||||
retrieved_sha = re.search(match_string, console_output).group(1)
|
||||
if retrieved_sha == pr.get_commits().reversed[0].sha:
|
||||
return last_build_number
|
||||
else:
|
||||
return -1
|
||||
except (NotFoundException, AttributeError, requests.exceptions.HTTPError):
|
||||
message = ('PR #{}: Jenkins build corresponding to commit {} not found!'
|
||||
.format(pr_number, pr.get_commits().reversed[0].sha))
|
||||
self._queue_message(message, message_severity='error', pr=pr)
|
||||
return -1
|
||||
|
||||
def _build_in_queue(self, pr, build_number):
|
||||
"""Check if Jenkins build waits in queue.
|
||||
|
||||
This method verifies if CI build is waiting in queue based on console output.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:param build_number: Jenkins build number to retrieve console output from
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
:type build_number: int
|
||||
|
||||
:return: Returns True if CI build is waiting in queue
|
||||
:rtype: Bool
|
||||
"""
|
||||
pr_number = str(pr.number)
|
||||
project_name_full = self._ci_job_name + '/PR-' + pr_number
|
||||
# Retrieve console output
|
||||
try:
|
||||
console_output = self._jenkins.get_build_console_output(project_name_full, build_number)
|
||||
except NotFoundException:
|
||||
return False
|
||||
# Check if build is waiting in queue (and not already running on an executor)
|
||||
if 'Waiting for next available executor on' in console_output \
|
||||
and 'Running on' not in console_output:
|
||||
log.info('CI for PR %s: WAITING IN QUEUE', pr_number)
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def _interpret_status(self, status, pr):
|
||||
"""
|
||||
Verify GitHub status passed to the method.
|
||||
|
||||
This method verifies last commit status for given PR, calling appropriate methods
|
||||
to further validate the status.
|
||||
|
||||
:param status: GitHub commit status
|
||||
:param pr: Single PR being currently checked
|
||||
:type status: github.CommitStatus.CommitStatus
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
"""
|
||||
try:
|
||||
# Retrieve build number for Jenkins build related to this PR
|
||||
build_number = self._retrieve_build_number(status.target_url)
|
||||
# CI build finished - verify if expected output is present
|
||||
finished_statuses = ['Build finished', 'This commit cannot be built', 'This commit looks good']
|
||||
pending_statuses = ['This commit is being built', 'Testing in progress',
|
||||
'This commit is scheduled to be built']
|
||||
if any(phrase in status.description for phrase in finished_statuses):
|
||||
self._check_finished(pr, build_number)
|
||||
# CI build in progress - verify timeouts for build queue and duration
|
||||
elif any(phrase in status.description for phrase in pending_statuses):
|
||||
self._check_in_progress(pr, build_number)
|
||||
else:
|
||||
message = 'ONNX CI job for PR# {}: unrecognized status: {}'.format(pr.number, status.description)
|
||||
self._queue_message(message, message_severity='error', pr=pr)
|
||||
except Exception:
|
||||
# Log Watchdog internal error in case any status can't be properly verified
|
||||
message = 'Failed to verify status "{}" for PR# {}'.format(status.description, pr.number)
|
||||
log.exception(message)
|
||||
self._queue_message(message, message_severity='internal', pr=pr)
|
||||
|
||||
def _retrieve_build_number(self, url):
|
||||
"""Retrieve Jenkins CI job build number from URL address coming from GitHub commit status.
|
||||
|
||||
:param url: URL address from GitHub commit status
|
||||
:type url: String
|
||||
|
||||
:return: Returns build number
|
||||
:rtype: int
|
||||
"""
|
||||
# Retrieve the build number from url string
|
||||
match_obj = re.search('(?:/PR-[0-9]+/)([0-9]+)', url)
|
||||
try:
|
||||
number = int(match_obj.group(1))
|
||||
return number
|
||||
except Exception:
|
||||
log.exception('Failed to retrieve build number from url link: %s', url)
|
||||
raise
|
||||
|
||||
def _queue_message(self, message, message_severity='info', pr=None):
|
||||
"""Add a message to message queue in communicator object.
|
||||
|
||||
The queued message is constructed based on message string passed as
|
||||
a method argument and message header. Message header is mapped to message severity
|
||||
also passed as an argument.
|
||||
|
||||
:param message: Message content
|
||||
:param message_severity: Message severity level
|
||||
:type message: String
|
||||
:type message_severity: int
|
||||
"""
|
||||
log.info(message)
|
||||
internal = False
|
||||
if 'internal' in message_severity:
|
||||
message_header = INTERNAL_ERROR_MESSAGE_HEADER
|
||||
internal = True
|
||||
elif 'error' in message_severity:
|
||||
message_header = ERROR_MESSAGE_HEADER
|
||||
elif 'warning' in message_severity:
|
||||
message_header = WARNING_MESSAGE_HEADER
|
||||
else:
|
||||
message_header = INFO_MESSAGE_HEADER
|
||||
# If message is related to PR attatch url
|
||||
if pr:
|
||||
message = message + '\n' + pr.html_url
|
||||
|
||||
send = message_header + '\n' + message
|
||||
if self._ms_teams_enabled:
|
||||
self._msteams_hook.queue_message(send)
|
||||
|
||||
def _check_finished(self, pr, build_number):
|
||||
"""Verify if finished build output contains expected string for either fail or success.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:param build_number: Jenkins CI job build number
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
:type build_number: int
|
||||
"""
|
||||
pr_number = str(pr.number)
|
||||
log.info('CI for PR %s: FINISHED', pr_number)
|
||||
# Check if FINISH was valid FAIL / SUCCESS
|
||||
project_name_full = self._ci_job_name + '/PR-' + pr_number
|
||||
build_output = self._jenkins.get_build_console_output(project_name_full, build_number)
|
||||
if _CI_BUILD_FAIL_MESSAGE not in build_output \
|
||||
and _CI_BUILD_SUCCESS_MESSAGE not in build_output:
|
||||
message = ('ONNX CI job for PR #{}: finished but no tests success or fail '
|
||||
'confirmation is present in console output!'.format(pr_number))
|
||||
self._queue_message(message, message_severity='error', pr=pr)
|
||||
|
||||
def _send_message(self, quiet=False):
|
||||
"""Send messages queued in MS Teams objects to designated channel.
|
||||
|
||||
Queued messages are being sent as a single communication.
|
||||
|
||||
:param quiet: Flag for disabling sending report through communicator
|
||||
:type quiet: Boolean
|
||||
"""
|
||||
if any(messages for messages in self._msteams_hook.messages):
|
||||
try:
|
||||
watchdog_build = self._jenkins.get_job_info(self._watchdog_job_name)['lastBuild']
|
||||
watchdog_build_number = watchdog_build['number']
|
||||
watchdog_build_link = watchdog_build['url']
|
||||
except Exception:
|
||||
watchdog_build_number = 'UNKNOWN'
|
||||
watchdog_build_link = self._jenkins.jenkins_server
|
||||
send = self._watchdog_job_name + '- build ' + str(
|
||||
watchdog_build_number) + ' - ' + watchdog_build_link
|
||||
|
||||
if self._ms_teams_enabled:
|
||||
self._msteams_hook.send_message(send, quiet=quiet)
|
||||
else:
|
||||
log.info('Nothing to report.')
|
||||
|
||||
def _check_in_progress(self, pr, build_number):
|
||||
"""Check if CI build succesfully started.
|
||||
|
||||
Checks if build started within designated time threshold, and job is
|
||||
currently running - it didn't cross the time threshold.
|
||||
|
||||
:param pr: Single PR being currently checked
|
||||
:param build_number: Jenkins CI job build number
|
||||
:type pr: github.PullRequest.PullRequest
|
||||
:type build_number: int
|
||||
"""
|
||||
pr_number = str(pr.number)
|
||||
log.info('CI for PR %s: TESTING IN PROGRESS', pr_number)
|
||||
project_name_full = self._ci_job_name + '/PR-' + pr_number
|
||||
build_info = self._jenkins.get_build_info(project_name_full, build_number)
|
||||
build_datetime = datetime.datetime.fromtimestamp(build_info['timestamp'] / 1000.0)
|
||||
build_delta = self._now_time - build_datetime
|
||||
log.info('Build %s: IN PROGRESS, started: %s minutes ago', str(build_number),
|
||||
str(build_delta))
|
||||
# If build still waiting in queue
|
||||
if build_delta > _CI_START_THRESHOLD and self._build_in_queue(pr, build_number):
|
||||
message = ('ONNX CI job build #{}, for PR #{} waiting in queue after {} '
|
||||
'minutes'.format(build_number, pr_number, str(build_delta.seconds / 60)))
|
||||
self._queue_message(message, message_severity='warning', pr=pr)
|
||||
elif build_delta > _BUILD_DURATION_THRESHOLD:
|
||||
# CI job take too long, possibly froze - communicate failure
|
||||
message = ('ONNX CI job build #{}, for PR #{} started, '
|
||||
'but did not finish in designated time of {} '
|
||||
'minutes!'.format(build_number, pr_number,
|
||||
str(_BUILD_DURATION_THRESHOLD.seconds / 60)))
|
||||
self._queue_message(message, message_severity='error', pr=pr)
|
||||
|
||||
def _update_config(self):
|
||||
"""Update Watchdog config file with PRs checked in current Watchdog run, remove old entries.
|
||||
|
||||
:param current_prs: List of PR numbers checked during current Watchdog run
|
||||
:type current_prs: list of ints
|
||||
"""
|
||||
# Cleanup config of old reports
|
||||
log.info('Writing to config file at: {}'.format(self._config_path))
|
||||
new_config = {_PR_REPORTS_CONFIG_KEY: self._current_prs}
|
||||
file = open(self._config_path, 'w+')
|
||||
json.dump(new_config, file)
|
||||
3
.github/dependabot.yml
vendored
3
.github/dependabot.yml
vendored
@@ -7,7 +7,7 @@ updates:
|
||||
directory: "/src/bindings/python"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
day: sunday
|
||||
time: "13:00"
|
||||
open-pull-requests-limit: 0
|
||||
reviewers:
|
||||
@@ -15,4 +15,3 @@ updates:
|
||||
- akuporos
|
||||
labels:
|
||||
- "category: dependencies"
|
||||
|
||||
|
||||
9
.github/github_org_control/config.json
vendored
9
.github/github_org_control/config.json
vendored
@@ -5,11 +5,10 @@
|
||||
"IGNORE_LOGINS": [
|
||||
"openvino-ci",
|
||||
"openvino-pushbot",
|
||||
"lab-nerval",
|
||||
"lab-nerval-onnx-ci",
|
||||
"onnx-watchdog-agent",
|
||||
"workbench-ci-bot",
|
||||
"openvino-pot-ci"
|
||||
"openvino-pot-ci",
|
||||
"sysicvvpux",
|
||||
"ote-ci-bot"
|
||||
],
|
||||
"MAX_MEMBERS_TO_REMOVE": 15,
|
||||
"EMAILS_FILE_PATH": "dev_emails-test.txt",
|
||||
@@ -28,7 +27,7 @@
|
||||
"openvino-ie-gna-maintainers": "category: GNA",
|
||||
"openvino-ie-gpu-maintainers": "category: GPU",
|
||||
"openvino-ie-lpt-maintainers": "category: LP transformations",
|
||||
"openvino-ie-multi-maintainers": "category: MULTI",
|
||||
"openvino-ie-auto-multi-maintainers": "category: MULTI",
|
||||
"openvino-ie-python-api-maintainers": "category: python api",
|
||||
"openvino-ie-template-maintainers": "category: TEMPLATE",
|
||||
"openvino-ie-tests-maintainers": "category: IE Tests",
|
||||
|
||||
2
.github/github_org_control/github_api.py
vendored
2
.github/github_org_control/github_api.py
vendored
@@ -157,7 +157,7 @@ class GithubOrgApi:
|
||||
self.github_users_by_email[email] = org_member
|
||||
if not is_valid_name(org_member.name):
|
||||
self.members_to_fix_name.add(org_member)
|
||||
elif not is_user_ignored(org_member):
|
||||
else:
|
||||
self.members_to_remove.add(org_member)
|
||||
|
||||
print("\nOrg members - no Intel emails:")
|
||||
|
||||
69
.github/workflows/py_checks.yml
vendored
69
.github/workflows/py_checks.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: IE Python Checks
|
||||
name: Python API Checks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -23,8 +23,9 @@ jobs:
|
||||
with:
|
||||
python-version: '3.6'
|
||||
- name: Install dependencies
|
||||
run: python -m pip install -r src/bindings/python/src/compatibility/openvino/requirements_dev.txt
|
||||
- name: Run Flake on samples
|
||||
run: python -m pip install -r src/bindings/python/requirements_test.txt
|
||||
# samples code-style
|
||||
- name: Run flake8 on samples
|
||||
run: python -m flake8 ./ --config=setup.cfg
|
||||
working-directory: samples/python
|
||||
- name: Create code style diff for samples
|
||||
@@ -38,21 +39,53 @@ jobs:
|
||||
with:
|
||||
name: samples_diff
|
||||
path: samples_diff.diff
|
||||
- name: Run Flake on src
|
||||
# IE Python API Flake code-style
|
||||
- name: Run flake8 on IE Python API
|
||||
run: python -m flake8 ./ --config=setup.cfg
|
||||
working-directory: src/bindings/python/src/compatibility/openvino
|
||||
- name: Create code style diff for Python src
|
||||
- name: Create code style diff for IE Python API
|
||||
if: failure()
|
||||
run: |
|
||||
python -m black -l 160 -S ./
|
||||
git diff > src_diff.diff
|
||||
git diff > ie_python_diff.diff
|
||||
working-directory: src/bindings/python/src/compatibility/openvino
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: src_diff
|
||||
path: src_diff.diff
|
||||
- name: Run Flake on wheel
|
||||
name: ie_python_diff
|
||||
path: ie_python_diff.diff
|
||||
# nGraph Python API Flake code-style
|
||||
- name: Run flake8 on nGraph Python API
|
||||
run: python -m flake8 ./src/compatibility/ngraph --config=setup.cfg
|
||||
working-directory: src/bindings/python
|
||||
- name: Create code style diff for nGraph Python API
|
||||
if: failure()
|
||||
run: |
|
||||
python -m black -l 160 -S ./
|
||||
git diff > pyngraph_diff.diff
|
||||
working-directory: src/bindings/python/src/compatibility/ngraph
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: pyngraph_diff
|
||||
path: pyngraph_diff.diff
|
||||
# Python API 2.0 Flake code-style
|
||||
- name: Run flake8 on Python API 2.0
|
||||
run: python -m flake8 ./src/openvino --config=setup.cfg
|
||||
working-directory: src/bindings/python
|
||||
- name: Create code style diff for Python API 2.0
|
||||
if: failure()
|
||||
run: |
|
||||
python -m black -l 160 -S ./
|
||||
git diff > pyopenvino_diff.diff
|
||||
working-directory: src/bindings/python/src/openvino
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: pyopenvino_diff
|
||||
path: pyopenvino_diff.diff
|
||||
# wheel Flake code-style
|
||||
- name: Run flake8 on wheel
|
||||
run: python -m flake8 ./ --config=../setup.cfg
|
||||
working-directory: src/bindings/python/wheel
|
||||
- name: Create code style diff for wheel
|
||||
@@ -66,10 +99,24 @@ jobs:
|
||||
with:
|
||||
name: wheel_diff
|
||||
path: wheel_diff.diff
|
||||
|
||||
- name: Run MyPy
|
||||
# Python API 2.0 tests Flake code-style
|
||||
- name: Run flake8 on python tests
|
||||
# ignore lack of docs in tests
|
||||
run: python -m flake8 tests/ --config=setup.cfg
|
||||
working-directory: src/bindings/python
|
||||
# IE Python API mypy check
|
||||
- name: Run mypy on IE Python API
|
||||
run: python -m mypy ./ --config-file ./setup.cfg
|
||||
working-directory: src/bindings/python/src/compatibility/openvino
|
||||
# nGraph Python API mypy check
|
||||
- name: Run mypy on nGraph Python API
|
||||
run: python -m mypy ./src/compatibility/ngraph --config-file ./setup.cfg
|
||||
working-directory: src/bindings/python
|
||||
# Python API 2.0 mypy check
|
||||
- name: Run mypy on Python API 2.0
|
||||
run: python -m mypy ./src/openvino --config-file ./setup.cfg
|
||||
working-directory: src/bindings/python
|
||||
|
||||
- name: Run Bandit
|
||||
run: python -m bandit -r ./ -f screen
|
||||
working-directory: src/bindings/python/src/compatibility/openvino
|
||||
|
||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,6 +1,6 @@
|
||||
[submodule "src/plugins/intel_cpu/thirdparty/mkl-dnn"]
|
||||
path = src/plugins/intel_cpu/thirdparty/mkl-dnn
|
||||
url = https://github.com/openvinotoolkit/oneDNN.git
|
||||
[submodule "src/plugins/intel_cpu/thirdparty/onednn"]
|
||||
path = src/plugins/intel_cpu/thirdparty/onednn
|
||||
url = https://github.com/luo-cheng2021/oneDNN.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/xbyak"]
|
||||
path = thirdparty/xbyak
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS)
|
||||
# 'target_link_libraries' does not work correctly when called from
|
||||
# different directly where 'add_library' is called: CMake generates
|
||||
# different directory where 'add_library' is called: CMake generates
|
||||
# incorrect OpenVINOConfig.cmake in this case
|
||||
cmake_minimum_required(VERSION 3.17)
|
||||
else()
|
||||
@@ -13,7 +13,9 @@ endif()
|
||||
|
||||
project(OpenVINO DESCRIPTION "OpenVINO toolkit")
|
||||
|
||||
set(IE_MAIN_SOURCE_DIR ${OpenVINO_SOURCE_DIR}/inference-engine)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type" FORCE)
|
||||
endif()
|
||||
|
||||
find_package(IEDevScripts REQUIRED
|
||||
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
|
||||
@@ -34,7 +36,9 @@ endif()
|
||||
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
|
||||
message (STATUS "CMAKE_VERSION ......................... " ${CMAKE_VERSION})
|
||||
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
|
||||
message (STATUS "CMAKE_SOURCE_DIR ...................... " ${CMAKE_SOURCE_DIR})
|
||||
message (STATUS "OpenVINO_SOURCE_DIR ................... " ${OpenVINO_SOURCE_DIR})
|
||||
message (STATUS "OpenVINO_BINARY_DIR ................... " ${OpenVINO_BINARY_DIR})
|
||||
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
|
||||
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
|
||||
message (STATUS "CMAKE_CXX_COMPILER_ID ................. " ${CMAKE_CXX_COMPILER_ID})
|
||||
@@ -42,11 +46,12 @@ message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
|
||||
message (STATUS "CMAKE_TOOLCHAIN_FILE .................. " ${CMAKE_TOOLCHAIN_FILE})
|
||||
|
||||
# remove file with exported developer targets to force its regeneration
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/ngraph/ngraphTargets.cmake")
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/ngraphTargets.cmake")
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
|
||||
foreach(component IN LISTS openvino_export_components)
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
|
||||
unset(${component} CACHE)
|
||||
endforeach()
|
||||
unset(openvino_export_components CACHE)
|
||||
|
||||
22
CODEOWNERS
22
CODEOWNERS
@@ -39,14 +39,19 @@ Jenkinsfile @openvinotoolkit/openvino-admins
|
||||
|
||||
# IE CPU:
|
||||
/src/plugins/intel_cpu/ @openvinotoolkit/openvino-ie-cpu-maintainers @openvinotoolkit/openvino-ie-cpu-developers
|
||||
/src/common/low_precision_transformations/ @openvinotoolkit/openvino-ie-cpu-maintainers @openvinotoolkit/openvino-ie-cpu-developers
|
||||
/src/plugins/intel_cpu/thirdparty/mkl-dnn/ @openvinotoolkit/openvino-ie-cpu-maintainers @openvinotoolkit/openvino-ie-cpu-developers
|
||||
/src/plugins/intel_cpu/thirdparty/onednn/ @openvinotoolkit/openvino-ie-cpu-maintainers @openvinotoolkit/openvino-ie-cpu-developers
|
||||
|
||||
#IE LPT
|
||||
/src/common/low_precision_transformations/ @openvinotoolkit/openvino-ie-lpt-maintainers
|
||||
|
||||
# IE GPU:
|
||||
/src/inference/include/ie/gpu/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/src/inference/include/ie/cldnn/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/src/inference/include/openvino/runtime/intel_gpu/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/src/plugins/intel_gpu/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/docs/snippets/gpu/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/docs/OV_Runtime_UG/supported_plugins/GPU.md @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/docs/OV_Runtime_UG/supported_plugins/GPU_RemoteTensor_API.md @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
|
||||
# IE VPU:
|
||||
/src/plugins/intel_myriad @openvinotoolkit/openvino-ie-vpu-maintainers
|
||||
@@ -63,6 +68,9 @@ Jenkinsfile @openvinotoolkit/openvino-admins
|
||||
/src/plugins/intel_gna/ @openvinotoolkit/openvino-ie-gna-maintainers
|
||||
/src/inference/include/ie/gna/ @openvinotoolkit/openvino-ie-gna-maintainers
|
||||
|
||||
# IE ARM CPU:
|
||||
/docs/OV_Runtime_UG/supported_plugins/ARM_CPU.md @openvinotoolkit/openvino_contrib-arm_plugin-maintainers
|
||||
|
||||
# IE Auto (MULTI) plugin:
|
||||
/src/plugins/auto/ @openvinotoolkit/openvino-ie-auto-multi-maintainers
|
||||
/src/inference/include/ie/multi-device/ @openvinotoolkit/openvino-ie-auto-multi-maintainers
|
||||
@@ -71,8 +79,8 @@ Jenkinsfile @openvinotoolkit/openvino-admins
|
||||
/src/frontends/paddle/ @openvinotoolkit/openvino-ie-paddle-maintainers
|
||||
|
||||
# IE Tests:
|
||||
/src/tests/ @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
/src/tests_deprecated/ @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
/src/tests/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ie-test-developers
|
||||
/src/tests_deprecated/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ie-test-developers
|
||||
/src/tests/functional/inference_engine/ngraph_reader/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ngraph-maintainers
|
||||
/src/tests/functional/inference_engine/transformations/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ngraph-maintainers
|
||||
|
||||
@@ -82,6 +90,6 @@ Jenkinsfile @openvinotoolkit/openvino-admins
|
||||
*.md @openvinotoolkit/openvino-docs-maintainers
|
||||
|
||||
# Control 3d party dependencies
|
||||
**/*requirements*.* @openvino-configuration-mgmt
|
||||
**/setup.py @openvino-configuration-mgmt
|
||||
/scripts/install_dependencies/ @openvino-configuration-mgmt
|
||||
**/*requirements*.* @openvinotoolkit/openvino-configuration-mgmt
|
||||
**/setup.py @openvinotoolkit/openvino-configuration-mgmt
|
||||
/scripts/install_dependencies/ @openvinotoolkit/openvino-configuration-mgmt
|
||||
|
||||
55
CONTRIBUTING.md
Normal file
55
CONTRIBUTING.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# How to contribute to the OpenVINO repository
|
||||
|
||||
We welcome community contributions to OpenVINO™. Please read the following guide to learn how to find ideas for contribution, practices for good pull requests, checking your changes with our tests and more.
|
||||
|
||||
|
||||
## Before you start contributing you should
|
||||
|
||||
- Make sure you agree to contribute your code under [OpenVINO™ (Apache 2.0)](https://github.com/openvinotoolkit/openvino/blob/master/LICENSE) license.
|
||||
- Figure out what you’re going to contribute. If you don’t know what you are going to work on, navigate to the [Github "Issues" tab](https://github.com/openvinotoolkit/openvino/issues). Make sure that there isn't someone working on it. In the latter case you might provide support or suggestion in the issue or in the linked pull request.
|
||||
- If you are going to fix a bug, check that it's still exists in the latest release. This can be done by building the latest master branch, and make sure that the error is still reproducible there. We do not fix bugs that only affect older non-LTS releases like 2020.2 for example (more details about [branching strategy](https://github.com/openvinotoolkit/openvino/wiki/Branches)).
|
||||
|
||||
|
||||
## "Fork & Pull Request model" for code contribution
|
||||
|
||||
### [](https://github.com/openvinotoolkit/openvino/blob/master/CONTRIBUTING.md#the-instruction-in-brief)The instruction in brief
|
||||
|
||||
- Register at GitHub. Create your fork of OpenVINO™ repository [https://github.com/openvinotoolkit/openvino](https://github.com/openvinotoolkit/openvino) (see [https://help.github.com/articles/fork-a-repo](https://help.github.com/articles/fork-a-repo) for details).
|
||||
- Install Git.
|
||||
- Set your user name and email address in a Git configuration according to GitHub account (see [https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for details).
|
||||
- Choose a task for yourself. It could be a bugfix or some new code.
|
||||
- Choose a base branch for your work. More details about branches and policies are here: [Branches](https://github.com/openvinotoolkit/openvino/wiki/Branches)
|
||||
- Clone your fork to your computer.
|
||||
- Create a new branch (with a meaningful name) from the base branch you chose.
|
||||
- Modify / add the code following our [Coding Style Guide](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLines).
|
||||
- If you want to add a new sample, please look at this [Guide for contributing to C++/C/Python IE samples](https://github.com/openvinotoolkit/openvino/wiki/SampleContribute)
|
||||
- If you want to contribute to the documentation and want to add a new guide, follow that instruction [Documentation guidelines](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLinesDocumentation)
|
||||
- Run testsuite locally:
|
||||
- execute each test binary from the artifacts directory, e.g. `<source dir>/bin/intel64/Release/ieFuncTests`
|
||||
- When you are done, make sure that your branch is to date with latest state of the branch you want to contribute to (e.g. `git fetch upstream && git merge upstream/master`), push your branch to your GitHub fork; then create a pull request from your branch to the base branch (see [https://help.github.com/articles/using-pull-requests](https://help.github.com/articles/using-pull-requests) for details).
|
||||
|
||||
## Making a good pull request
|
||||
|
||||
Following these guidelines will increase the likelihood of your pull request being accepted:
|
||||
|
||||
- One PR – one issue.
|
||||
- Build perfectly on your local system.
|
||||
- Choose the right base branch [Branches](https://github.com/openvinotoolkit/openvino/wiki/Branches).
|
||||
- Follow the [Coding Style Guide](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLines) for your code.
|
||||
- Update documentation using [Documentation guidelines](https://github.com/openvinotoolkit/openvino/wiki/CodingStyleGuideLinesDocumentation) if needed.
|
||||
- Cover your changes with test.
|
||||
- Add license at the top of new files [C++ example](https://github.com/openvinotoolkit/openvino/blob/master/samples/cpp/classification_sample_async/main.cpp#L1-L2), [Python example](https://github.com/openvinotoolkit/openvino/blob/master/samples/python/hello_classification/hello_classification.py#L3-L4).
|
||||
- Add enough information: a meaningful title, the reason why you made the commit and a link to the issue page if exists.
|
||||
- Remove unrelated to PR changes.
|
||||
- If it is still WIP and you want to check CI test results early then use _Draft_ PR.
|
||||
- Submit your PR and become an OpenVINO™ contributor!
|
||||
|
||||
|
||||
## Testing and merging pull requests
|
||||
|
||||
Your pull request will be automatically tested by OpenVINO™'s precommit (testing status are automatically reported as "green" or "red" circles in precommit steps on PR's page). If any builders have failed, you need fix the issue. To rerun the automatic builds just push changes to your branch on GitHub. No need to close pull request and open a new one!
|
||||
|
||||
|
||||
## Merging PR
|
||||
|
||||
As soon as the reviewer is fine with the pull request and precommit shows "green" status, the "Approved" review status is put, which signals OpenVINO™ maintainers that they can merge your pull request.
|
||||
210
README.md
210
README.md
@@ -1,50 +1,208 @@
|
||||
# OpenVINO™ Toolkit
|
||||
[](https://github.com/openvinotoolkit/openvino/releases/tag/2021.4.2)
|
||||
<div align="center">
|
||||
|
||||
<img src="docs/img/openvino-logo-purple-black.png" width="400px">
|
||||
|
||||
[](https://github.com/openvinotoolkit/openvino/releases/tag/2022.1)
|
||||
[](LICENSE)
|
||||

|
||||

|
||||
[](https://badge.fury.io/py/openvino)
|
||||
[](https://pepy.tech/project/openvino)
|
||||
|
||||
</div>
|
||||
|
||||
This toolkit allows developers to deploy pre-trained deep learning models
|
||||
through a high-level OpenVINO™ Runtime C++ and Python APIs integrated with application logic.
|
||||
## Contents:
|
||||
|
||||
This open source version includes several components: namely [Model Optimizer], [OpenVINO™ Runtime], [Post-Training Optimization Tool], as well as CPU, GPU, MYRIAD, multi device and heterogeneous plugins to accelerate deep learning inferencing on Intel® CPUs and Intel® Processor Graphics.
|
||||
- [What is OpenVINO?](#what-is-openvino-toolkit)
|
||||
- [Components](#components)
|
||||
- [Supported Hardware matrix](#supported-hardware-matrix)
|
||||
- [License](#license)
|
||||
- [Documentation](#documentation)
|
||||
- [Tutorials](#tutorials)
|
||||
- [Products which use OpenVINO](#products-which-use-openvino)
|
||||
- [System requirements](#system-requirements)
|
||||
- [How to build](#how-to-build)
|
||||
- [How to contribute](#how-to-contribute)
|
||||
- [Get a support](#get-a-support)
|
||||
- [See also](#see-also)
|
||||
|
||||
## What is OpenVINO toolkit?
|
||||
|
||||
OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference.
|
||||
- Boost deep learning performance in computer vision, automatic speech recognition, natural language processing and other common tasks
|
||||
- Use models trained with popular frameworks like TensorFlow, PyTorch and more
|
||||
- Reduce resource demands and efficiently deploy on a range of Intel® platforms from edge to cloud
|
||||
|
||||
|
||||
This open-source version includes several components: namely [Model Optimizer], [OpenVINO™ Runtime], [Post-Training Optimization Tool], as well as CPU, GPU, MYRIAD, multi device and heterogeneous plugins to accelerate deep learning inferencing on Intel® CPUs and Intel® Processor Graphics.
|
||||
It supports pre-trained models from the [Open Model Zoo], along with 100+ open
|
||||
source and public models in popular formats such as TensorFlow, ONNX, PaddlePaddle, MXNet, Caffe, Kaldi.
|
||||
|
||||
## Repository components
|
||||
* [OpenVINO™ Runtime]
|
||||
* [Model Optimizer]
|
||||
* [Post-Training Optimization Tool]
|
||||
### Components
|
||||
* [OpenVINO™ Runtime] - is a set of C++ libraries with C and Python bindings providing a common API to deliver inference solutions on the platform of your choice.
|
||||
* [core](https://github.com/openvinotoolkit/openvino/tree/master/src/core) - provides the base API for model representation and modification.
|
||||
* [inference](https://github.com/openvinotoolkit/openvino/tree/master/src/inference) - provides an API to infer models on device.
|
||||
* [transformations](https://github.com/openvinotoolkit/openvino/tree/master/src/common/transformations) - contains the set of common transformations which are used in OpenVINO plugins.
|
||||
* [low precision transformations](https://github.com/openvinotoolkit/openvino/tree/master/src/common/low_precision_transformations) - contains the set of transformations which are used in low precision models
|
||||
* [bindings](https://github.com/openvinotoolkit/openvino/tree/master/src/bindings) - contains all awailable OpenVINO bindings which are maintained by OpenVINO team.
|
||||
* [c](https://github.com/openvinotoolkit/openvino/tree/master/src/bindings/c) - provides C API for OpenVINO™ Runtime
|
||||
* [python](https://github.com/openvinotoolkit/openvino/tree/master/src/bindings/python) - Python API for OpenVINO™ Runtime
|
||||
* [Plugins](https://github.com/openvinotoolkit/openvino/tree/master/src/plugins) - contains OpenVINO plugins which are maintained in open-source by OpenVINO team. For more information please taje a look to the [list of supported devices](#supported-hardware-matrix).
|
||||
* [Frontends](https://github.com/openvinotoolkit/openvino/tree/master/src/frontends) - contains available OpenVINO frontends which allow to read model from native framework format.
|
||||
* [Model Optimizer] - is a cross-platform command-line tool that facilitates the transition between training and deployment environments, performs static model analysis, and adjusts deep learning models for optimal execution on end-point target devices.
|
||||
* [Post-Training Optimization Tool] - is designed to accelerate the inference of deep learning models by applying special methods without model retraining or fine-tuning, for example, post-training 8-bit quantization.
|
||||
* [Samples] - applications on C, C++ and Python languages which shows basic use cases of OpenVINO usages.
|
||||
|
||||
## Supported Hardware matrix
|
||||
|
||||
The OpenVINO™ Runtime can infer models on different hardware devices. This section provides the list of supported devices.
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Plugin</th>
|
||||
<th>Library</th>
|
||||
<th>ShortDescription</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan=2>CPU</td>
|
||||
<td> <a href="https://docs.openvino.ai/nightly/openvino_docs_OV_UG_supported_plugins_CPU.html#doxid-openvino-docs-o-v-u-g-supported-plugins-c-p-u">Intel CPU</a></tb>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_cpu">openvino_intel_cpu_plugin</a></i></b></td>
|
||||
<td>Intel Xeon with Intel® Advanced Vector Extensions 2 (Intel® AVX2), Intel® Advanced Vector Extensions 512 (Intel® AVX-512), and AVX512_BF16, Intel Core Processors with Intel AVX2, Intel Atom Processors with Intel® Streaming SIMD Extensions (Intel® SSE)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <a href="https://docs.openvino.ai/nightly/openvino_docs_OV_UG_supported_plugins_ARM_CPU.html">ARM CPU</a></tb>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino_contrib/tree/master/modules/arm_plugin">openvino_arm_cpu_plugin</a></i></b></td>
|
||||
<td>Raspberry Pi™ 4 Model B, Apple® Mac mini with M1 chip, NVIDIA® Jetson Nano™, Android™ devices
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GPU</td>
|
||||
<td><a href="https://docs.openvino.ai/nightly/openvino_docs_OV_UG_supported_plugins_GPU.html#doxid-openvino-docs-o-v-u-g-supported-plugins-g-p-u">Intel GPU</a></td>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_gpu">openvino_intel_gpu_plugin</a></i></b></td>
|
||||
<td>Intel Processor Graphics, including Intel HD Graphics and Intel Iris Graphics</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GNA</td>
|
||||
<td><a href="https://docs.openvino.ai/nightly/openvino_docs_OV_UG_supported_plugins_GNA.html#doxid-openvino-docs-o-v-u-g-supported-plugins-g-n-a">Intel GNA</a></td>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_gna">openvino_intel_gna_plugin</a></i></b></td>
|
||||
<td>Intel Speech Enabling Developer Kit, Amazon Alexa* Premium Far-Field Developer Kit, Intel Pentium Silver J5005 Processor, Intel Pentium Silver N5000 Processor, Intel Celeron J4005 Processor, Intel Celeron J4105 Processor, Intel Celeron Processor N4100, Intel Celeron Processor N4000, Intel Core i3-8121U Processor, Intel Core i7-1065G7 Processor, Intel Core i7-1060G7 Processor, Intel Core i5-1035G4 Processor, Intel Core i5-1035G7 Processor, Intel Core i5-1035G1 Processor, Intel Core i5-1030G7 Processor, Intel Core i5-1030G4 Processor, Intel Core i3-1005G1 Processor, Intel Core i3-1000G1 Processor, Intel Core i3-1000G4 Processor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>VPU</td>
|
||||
<td><a href="https://docs.openvino.ai/nightly/openvino_docs_IE_DG_supported_plugins_VPU.html#doxid-openvino-docs-i-e-d-g-supported-plugins-v-p-u">Myriad plugin</a></td>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/intel_myriad">openvino_intel_myriad_plugin</a></i></b></td>
|
||||
<td>Intel® Neural Compute Stick 2 powered by the Intel® Movidius™ Myriad™ X</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Also OpenVINO™ Toolkit contains several plugins which should simplify to load model on several hardware devices:
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Plugin</th>
|
||||
<th>Library</th>
|
||||
<th>ShortDescription</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a href="https://docs.openvino.ai/nightly/openvino_docs_IE_DG_supported_plugins_AUTO.html#doxid-openvino-docs-i-e-d-g-supported-plugins-a-u-t-o">Auto</a></td>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/auto">openvino_auto_plugin</a></i></b></td>
|
||||
<td>Auto plugin enables selecting Intel device for inference automatically</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://docs.openvino.ai/nightly/openvino_docs_OV_UG_Automatic_Batching.html">Auto Batch</a></td>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/auto_batch">openvino_auto_batch_plugin</a></i></b></td>
|
||||
<td>Auto batch plugin performs on-the-fly automatic batching (i.e. grouping inference requests together) to improve device utilization, with no programming effort from the user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://docs.openvino.ai/nightly/openvino_docs_OV_UG_Hetero_execution.html#doxid-openvino-docs-o-v-u-g-hetero-execution">Hetero</a></td>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/hetero">openvino_hetero_plugin</a></i></b></td>
|
||||
<td>Heterogeneous execution enables automatic inference splitting between several devices</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://docs.openvino.ai/nightly/openvino_docs_OV_UG_Running_on_multiple_devices.html#doxid-openvino-docs-o-v-u-g-running-on-multiple-devices">Multi</a></td>
|
||||
<td><b><i><a href="https://github.com/openvinotoolkit/openvino/tree/master/src/plugins/auto">openvino_auto_plugin</a></i></b></td>
|
||||
<td>Multi plugin enables simultaneous inference of the same model on several devices in parallel</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## License
|
||||
Deep Learning Deployment Toolkit is licensed under [Apache License Version 2.0](LICENSE).
|
||||
By contributing to the project, you agree to the license and copyright terms therein
|
||||
and release your contribution under these terms.
|
||||
OpenVINO™ Toolkit is licensed under [Apache License Version 2.0](LICENSE).
|
||||
By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.
|
||||
|
||||
## Resources
|
||||
* Docs: https://docs.openvino.ai/
|
||||
* Wiki: https://github.com/openvinotoolkit/openvino/wiki
|
||||
* Issue tracking: https://github.com/openvinotoolkit/openvino/issues
|
||||
* Storage: https://storage.openvinotoolkit.org/
|
||||
* Additional OpenVINO™ toolkit modules: https://github.com/openvinotoolkit/openvino_contrib
|
||||
* [Intel® Distribution of OpenVINO™ toolkit Product Page](https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit.html)
|
||||
* [Intel® Distribution of OpenVINO™ toolkit Release Notes](https://software.intel.com/en-us/articles/OpenVINO-RelNotes)
|
||||
## Documentation
|
||||
|
||||
### User documentation
|
||||
|
||||
The latest documentation for OpenVINO™ Toolkit is availabe [here](https://docs.openvino.ai/). This documentation contains detailed information about all OpenVINO components and provides all important information which could be needed if you create an application which is based on binary OpenVINO distribution or own OpenVINO version without source code modification.
|
||||
|
||||
### Developer documentation
|
||||
|
||||
[Developer documentation](#todo-add) contains information about architectural decisions which are applied inside the OpenVINO components. This documentation has all necessary information which could be needed in order to contribute to OpenVINO.
|
||||
|
||||
## Tutorials
|
||||
|
||||
The list of OpenVINO tutorials:
|
||||
|
||||
- [Jupiter notebooks](https://github.com/openvinotoolkit/openvino_notebooks)
|
||||
|
||||
## Products which use OpenVINO
|
||||
|
||||
- [OpenCV](https://opencv.org/)
|
||||
- [ONNX Runtime](https://onnxruntime.ai/)
|
||||
- [OpenVINO™ Integration with TensorFlow](https://www.intel.com/content/www/us/en/developer/tools/devcloud/edge/build/ovtfoverview.html)
|
||||
- [TNN](https://github.com/Tencent/TNN/tree/master)
|
||||
|
||||
## System requirements
|
||||
|
||||
The full information about system requirements depends on platform and available in section `System requirement` on dedicated pages:
|
||||
- [Linux](https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_linux.html)
|
||||
- [Windows](https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_windows.html)
|
||||
- [macOS](https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_macos.html)
|
||||
- [Raspbian](https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_raspbian.html)
|
||||
|
||||
## How to build
|
||||
|
||||
Please take a look to [OpenVINO Wiki](https://github.com/openvinotoolkit/openvino/wiki#how-to-build) to get more information about OpenVINO build process.
|
||||
|
||||
## How to contribute
|
||||
|
||||
See [CONTRIBUTING](./CONTRIBUTING.md) for details. Thank you!
|
||||
|
||||
## Get a support
|
||||
|
||||
## Support
|
||||
Please report questions, issues and suggestions using:
|
||||
|
||||
* The [`openvino`](https://stackoverflow.com/questions/tagged/openvino) tag on StackOverflow\*
|
||||
* [GitHub* Issues](https://github.com/openvinotoolkit/openvino/issues)
|
||||
* The [`openvino`](https://stackoverflow.com/questions/tagged/openvino) tag on StackOverflow\*
|
||||
* [Forum](https://software.intel.com/en-us/forums/computer-vision)
|
||||
|
||||
## See also
|
||||
|
||||
* [OpenVINO Wiki](https://github.com/openvinotoolkit/openvino/wiki)
|
||||
* [OpenVINO Storage](https://storage.openvinotoolkit.org/)
|
||||
* Additional OpenVINO™ toolkit modules:
|
||||
* [openvino_contrib](https://github.com/openvinotoolkit/openvino_contrib)
|
||||
* [Intel® Distribution of OpenVINO™ toolkit Product Page](https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit.html)
|
||||
* [Intel® Distribution of OpenVINO™ toolkit Release Notes](https://software.intel.com/en-us/articles/OpenVINO-RelNotes)
|
||||
* [Neural Network Compression Framework (NNCF)](https://github.com/openvinotoolkit/nncf) - a suite of advanced algorithms for model inference optimization including quantization, filter pruning, binarization and sparsity
|
||||
* [OpenVINO™ Training Extensions (OTE)](https://github.com/openvinotoolkit/training_extensions) - convenient environment to train Deep Learning models and convert them using OpenVINO for optimized inference.
|
||||
* [OpenVINO™ Model Server (OVMS)](https://github.com/openvinotoolkit/model_server) - a scalable, high-performance solution for serving deep learning models optimized for Intel architectures
|
||||
* [DL Workbench](https://docs.openvino.ai/nightly/workbench_docs_Workbench_DG_Introduction.html) - An alternative, web-based version of OpenVINO designed to make production of pretrained deep learning models significantly easier.
|
||||
* [Computer Vision Annotation Tool (CVAT)](https://github.com/openvinotoolkit/cvat) - an online, interactive video and image annotation tool for computer vision purposes.
|
||||
* [Dataset Management Framework (Datumaro)](https://github.com/openvinotoolkit/datumaro) - a framework and CLI tool to build, transform, and analyze datasets.
|
||||
|
||||
---
|
||||
\* Other names and brands may be claimed as the property of others.
|
||||
|
||||
[Open Model Zoo]:https://github.com/openvinotoolkit/open_model_zoo
|
||||
[OpenVINO™ Runtime]:https://docs.openvino.ai/latest/openvino_docs_IE_DG_Deep_Learning_Inference_Engine_DevGuide.html
|
||||
[OpenVINO™ Runtime]:https://docs.openvino.ai/latest/openvino_docs_OV_UG_OV_Runtime_User_Guide.html
|
||||
[Model Optimizer]:https://docs.openvino.ai/latest/openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html
|
||||
[Post-Training Optimization Tool]:https://docs.openvino.ai/latest/pot_README.html
|
||||
[tag on StackOverflow]:https://stackoverflow.com/search?q=%23openvino
|
||||
|
||||
[Post-Training Optimization Tool]:https://docs.openvino.ai/latest/pot_introduction.html
|
||||
[Samples]:https://github.com/openvinotoolkit/openvino/tree/master/samples
|
||||
|
||||
@@ -7,6 +7,7 @@ set(CMAKE_SYSTEM_PROCESSOR armv7l)
|
||||
|
||||
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
|
||||
set(PKG_CONFIG_EXECUTABLE arm-linux-gnueabihf-pkg-config CACHE PATH "Path to ARM pkg-config")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
|
||||
@@ -7,6 +7,7 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
|
||||
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
|
||||
set(PKG_CONFIG_EXECUTABLE aarch64-linux-gnu-pkg-config CACHE PATH "Path to ARM64 pkg-config")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
|
||||
@@ -23,17 +23,15 @@ message(STATUS "MODELS_PATH=" ${MODELS_PATH})
|
||||
|
||||
fetch_models_and_validation_set()
|
||||
|
||||
if(COMMAND get_linux_name)
|
||||
get_linux_name(LINUX_OS_NAME)
|
||||
endif()
|
||||
get_linux_name(LINUX_OS_NAME)
|
||||
|
||||
if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_SYSTEM_NAME MATCHES Linux AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
set(protoc_version "3.9.2")
|
||||
set(protoc_version "3.18.2")
|
||||
|
||||
RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
|
||||
ARCHIVE_LIN "protoc-${protoc_version}-linux-x86_64.tar.gz"
|
||||
TARGET_PATH "${TEMP}/protoc-${protoc_version}-linux-x86_64"
|
||||
SHA256 "1d6da1d97d0cbfcd333558afe24533eb3cb48dc1e0ab5e971aa1e50ede8bcf45"
|
||||
SHA256 "42fde2b6044c1f74c7e86d4e03b43aac87128ddf57ac6ed8c4eab7a1e21bbf21"
|
||||
)
|
||||
debug_message(STATUS "host protoc-${protoc_version} root path = " ${SYSTEM_PROTOC_ROOT})
|
||||
|
||||
@@ -93,7 +91,19 @@ if(THREADING STREQUAL "OMP")
|
||||
endif()
|
||||
|
||||
## TBB package
|
||||
if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
||||
unset(_ov_download_tbb_done CACHE)
|
||||
|
||||
#
|
||||
# The function downloads prebuilt TBB package
|
||||
# NOTE: the function should be used if system TBB is not found
|
||||
# or ENABLE_SYSTEM_TBB is OFF
|
||||
#
|
||||
function(ov_download_tbb)
|
||||
if(_ov_download_tbb_done OR NOT THREADING MATCHES "^(TBB|TBB_AUTO)$")
|
||||
return()
|
||||
endif()
|
||||
set(_ov_download_tbb_done ON CACHE BOOL "Whether prebuilt TBB is already downloaded")
|
||||
|
||||
reset_deps_cache(TBBROOT TBB_DIR)
|
||||
|
||||
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
||||
@@ -109,16 +119,6 @@ if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
||||
TARGET_PATH "${TEMP}/tbb"
|
||||
ENVIRONMENT "TBBROOT"
|
||||
SHA256 "f1c9b9e2861efdaa01552bd25312ccbc5feeb45551e5f91ae61e29221c5c1479")
|
||||
if(ENABLE_TBBBIND_2_5)
|
||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||
ARCHIVE_WIN "tbbbind_2_5_static_win_v1.zip"
|
||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||
SHA256 "a67afeea8cf194f97968c800dab5b5459972908295242e282045d6b8953573c1")
|
||||
else()
|
||||
message(WARNING "prebuilt TBBBIND_2_5 is not available.
|
||||
Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure")
|
||||
endif()
|
||||
elseif(ANDROID) # Should be before LINUX due LINUX is detected as well
|
||||
RESOLVE_DEPENDENCY(TBB
|
||||
ARCHIVE_ANDROID "tbb2020_20200404_android.tgz"
|
||||
@@ -131,16 +131,6 @@ if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
||||
TARGET_PATH "${TEMP}/tbb"
|
||||
ENVIRONMENT "TBBROOT"
|
||||
SHA256 "95b2f3b0b70c7376a0c7de351a355c2c514b42c4966e77e3e34271a599501008")
|
||||
if(ENABLE_TBBBIND_2_5)
|
||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||
ARCHIVE_LIN "tbbbind_2_5_static_lin_v2.tgz"
|
||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||
SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4")
|
||||
else()
|
||||
message(WARNING "prebuilt TBBBIND_2_5 is not available.
|
||||
Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure")
|
||||
endif()
|
||||
elseif(LINUX AND AARCH64)
|
||||
RESOLVE_DEPENDENCY(TBB
|
||||
ARCHIVE_LIN "keembay/tbb2020_38404_kmb_lic.tgz"
|
||||
@@ -160,18 +150,68 @@ if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
||||
update_deps_cache(TBBROOT "${TBB}" "Path to TBB root folder")
|
||||
if(EXISTS "${TBBROOT}/lib/cmake/TBB/TBBConfig.cmake")
|
||||
# oneTBB case
|
||||
update_deps_cache(TBB_DIR "${TBB}/lib/cmake/TBB" "Path to TBB cmake folder")
|
||||
update_deps_cache(TBB_DIR "${TBBROOT}/lib/cmake/TBB" "Path to TBB cmake folder")
|
||||
elseif(EXISTS "${TBBROOT}/lib64/cmake/TBB/TBBConfig.cmake")
|
||||
# 64-bits oneTBB case
|
||||
update_deps_cache(TBB_DIR "${TBBROOT}/lib64/cmake/TBB" "Path to TBB cmake folder")
|
||||
elseif(EXISTS "${TBBROOT}/cmake/TBBConfig.cmake")
|
||||
# custom downloaded or user provided TBB
|
||||
update_deps_cache(TBB_DIR "${TBBROOT}/cmake" "Path to TBB cmake folder")
|
||||
else()
|
||||
update_deps_cache(TBB_DIR "${TBB}/cmake" "Path to TBB cmake folder")
|
||||
message(WARNING "Failed to find TBBConfig.cmake in ${TBBROOT} tree. Custom TBBConfig.cmake will be used")
|
||||
endif()
|
||||
|
||||
debug_message(STATUS "tbb=" ${TBB})
|
||||
debug_message(STATUS "tbb_dir=" ${TBB_DIR})
|
||||
debug_message(STATUS "tbbroot=" ${TBBROOT})
|
||||
|
||||
set(TBB "${TBB}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
## TBBBind_2_5 package
|
||||
unset(_ov_download_tbbbind_2_5_done CACHE)
|
||||
|
||||
#
|
||||
# The function downloads static prebuilt TBBBind_2_5 package
|
||||
# NOTE: the function should be called only we have TBB with version less 2021
|
||||
#
|
||||
function(ov_download_tbbbind_2_5)
|
||||
if(_ov_download_tbbbind_2_5_done OR NOT ENABLE_TBBBIND_2_5)
|
||||
return()
|
||||
endif()
|
||||
set(_ov_download_tbbbind_2_5_done ON CACHE BOOL "Whether prebuilt TBBBind_2_5 is already downloaded")
|
||||
|
||||
reset_deps_cache(TBBBIND_2_5_DIR)
|
||||
|
||||
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
||||
set(IE_PATH_TO_DEPS "$ENV{THIRDPARTY_SERVER_PATH}")
|
||||
elseif(DEFINED THIRDPARTY_SERVER_PATH)
|
||||
set(IE_PATH_TO_DEPS "${THIRDPARTY_SERVER_PATH}")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND X86_64)
|
||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||
ARCHIVE_WIN "tbbbind_2_5_static_win_v1.zip"
|
||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||
SHA256 "a67afeea8cf194f97968c800dab5b5459972908295242e282045d6b8953573c1")
|
||||
elseif(ANDROID)
|
||||
# don't have TBBBIND_2_5
|
||||
elseif(LINUX AND X86_64)
|
||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||
ARCHIVE_LIN "tbbbind_2_5_static_lin_v2.tgz"
|
||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||
SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4")
|
||||
else()
|
||||
message(WARNING "prebuilt TBBBIND_2_5 is not available.
|
||||
Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure")
|
||||
endif()
|
||||
|
||||
update_deps_cache(TBBBIND_2_5_DIR "${TBBBIND_2_5}/cmake" "Path to TBBBIND_2_5 cmake folder")
|
||||
debug_message(STATUS "tbb=" ${TBB})
|
||||
|
||||
if(DEFINED IE_PATH_TO_DEPS)
|
||||
unset(IE_PATH_TO_DEPS)
|
||||
endif()
|
||||
endif()
|
||||
set(TBBBIND_2_5 "${TBBBIND_2_5}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
## OpenCV
|
||||
if(ENABLE_OPENCV)
|
||||
@@ -265,8 +305,6 @@ else()
|
||||
reset_deps_cache(OpenCV_DIR)
|
||||
endif()
|
||||
|
||||
include(${OpenVINO_SOURCE_DIR}/src/cmake/ie_parallel.cmake)
|
||||
|
||||
if(ENABLE_INTEL_GNA)
|
||||
reset_deps_cache(
|
||||
GNA_EXT_DIR
|
||||
@@ -276,8 +314,8 @@ if(ENABLE_INTEL_GNA)
|
||||
GNA_LIB_DIR
|
||||
libGNA_INCLUDE_DIRS
|
||||
libGNA_LIBRARIES_BASE_PATH)
|
||||
set(GNA_VERSION "03.00.00.1455.0")
|
||||
set(GNA_HASH "99891696269d8fa10116c96e6b7bda4362736881f0df8df8b56c751ee18e5820")
|
||||
set(GNA_VERSION "03.00.00.1455.2")
|
||||
set(GNA_HASH "e52785d3f730fefb4e794bb7ab40c8676537ef2f7c69c5b4bb89a5d3cc0bbe60")
|
||||
|
||||
set(FILES_TO_EXTRACT_LIST gna_${GNA_VERSION}/include)
|
||||
if(WIN32)
|
||||
|
||||
@@ -14,8 +14,8 @@ set(CMAKE_MODULE_PATH "${IEDevScripts_DIR}")
|
||||
function(set_ci_build_number)
|
||||
set(repo_root "${CMAKE_SOURCE_DIR}")
|
||||
include(version)
|
||||
foreach(var CI_BUILD_NUMBER IE_VERSION IE_VERSION_BUILD
|
||||
IE_VERSION_MAJOR IE_VERSION_MINOR IE_VERSION_PATCH)
|
||||
foreach(var CI_BUILD_NUMBER OpenVINO_VERSION OpenVINO_VERSION_BUILD
|
||||
OpenVINO_VERSION_MAJOR OpenVINO_VERSION_MINOR OpenVINO_VERSION_PATCH)
|
||||
if(NOT DEFINED ${var})
|
||||
message(FATAL_ERROR "${var} version component is not defined")
|
||||
endif()
|
||||
@@ -158,16 +158,22 @@ else ()
|
||||
endif()
|
||||
add_definitions(-DIE_BUILD_POSTFIX=\"${IE_BUILD_POSTFIX}\")
|
||||
|
||||
macro(ov_set_if_not_defined var value)
|
||||
if(NOT DEFINED ${var})
|
||||
set(${var} ${value})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(NOT UNIX)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
ov_set_if_not_defined(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
else()
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
|
||||
ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
|
||||
ov_set_if_not_defined(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
|
||||
endif()
|
||||
set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
ov_set_if_not_defined(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
ov_set_if_not_defined(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
ov_set_if_not_defined(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
@@ -180,6 +186,8 @@ endif()
|
||||
# Use solution folders
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# cmake_dependent_option() supports full Condition Syntax
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0127 NEW)
|
||||
# Enable CMAKE_<LANG>_COMPILER_ID AppleClang
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
|
||||
|
||||
@@ -206,6 +214,10 @@ endif()
|
||||
|
||||
macro(ov_install_static_lib target comp)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
get_target_property(target_type ${target} TYPE)
|
||||
if(${target_type} STREQUAL "STATIC_LIBRARY")
|
||||
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
endif()
|
||||
install(TARGETS ${target} EXPORT OpenVINOTargets
|
||||
ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT ${comp} ${ARGN})
|
||||
endif()
|
||||
|
||||
@@ -23,13 +23,13 @@ else()
|
||||
unset(IE_OWN_TBB_CONFIG)
|
||||
endif()
|
||||
|
||||
unset(TBB_DIR)
|
||||
unset(TBB_DIR CACHE)
|
||||
|
||||
find_package(TBB
|
||||
CONFIG
|
||||
PATHS ${TBBROOT}/cmake
|
||||
${TBBROOT}/lib/cmake/TBB # oneTBB case
|
||||
${IEDevScripts_DIR}/${IE_OWN_TBB_CONFIG}
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
find_package_handle_standard_args(TBB CONFIG_MODE)
|
||||
|
||||
@@ -76,8 +76,8 @@ function(addIeTarget)
|
||||
|
||||
# remove unnecessary directories
|
||||
foreach(excludedDir ${ARG_EXCLUDED_SOURCE_PATHS})
|
||||
list(FILTER includes EXCLUDE REGEX "${excludedDir}*")
|
||||
list(FILTER sources EXCLUDE REGEX "${excludedDir}*")
|
||||
list(FILTER includes EXCLUDE REGEX "${excludedDir}.*")
|
||||
list(FILTER sources EXCLUDE REGEX "${excludedDir}.*")
|
||||
endforeach()
|
||||
|
||||
source_group("include" FILES ${includes})
|
||||
|
||||
@@ -51,12 +51,6 @@ endfunction()
|
||||
set(VALIDATED_LIBRARIES "" CACHE INTERNAL "")
|
||||
|
||||
function(_ov_add_api_validator_post_build_step)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
# since _ov_add_api_validator_post_build_step
|
||||
# is currently run only on shared libraries, we have nothing to test
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(UWP_API_VALIDATOR_APIS "${PROGRAMFILES}/Windows Kits/10/build/universalDDIs/x64/UniversalDDIs.xml")
|
||||
set(UWP_API_VALIDATOR_EXCLUSION "${UWP_SDK_PATH}/BinaryExclusionlist.xml")
|
||||
|
||||
|
||||
2
cmake/developer_package/cpplint/cpplint.py
vendored
2
cmake/developer_package/cpplint/cpplint.py
vendored
@@ -3592,7 +3592,7 @@ def CheckOperatorSpacing(filename, clean_lines, linenum, error):
|
||||
elif not Match(r'#.*include', line):
|
||||
# Look for < that is not surrounded by spaces. This is only
|
||||
# triggered if both sides are missing spaces, even though
|
||||
# technically should should flag if at least one side is missing a
|
||||
# technically should flag if at least one side is missing a
|
||||
# space. This is done to avoid some false positives with shifts.
|
||||
match = Match(r'^(.*[^\s<])<[^\s=<,]', line)
|
||||
if match:
|
||||
|
||||
@@ -146,8 +146,6 @@ function (DownloadOrExtractInternal URL archive_path unpacked_path folder fattal
|
||||
|
||||
endfunction(DownloadOrExtractInternal)
|
||||
|
||||
file(REMOVE ${CMAKE_BINARY_DIR}/dependencies_64.txt)
|
||||
|
||||
function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked_path result_path folder fattal resultExt use_alternatives sha256 files_to_extract)
|
||||
set (archive_path ${TEMP}/download/${archive_name})
|
||||
set (status "ON")
|
||||
@@ -164,7 +162,6 @@ function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked
|
||||
if (${use_alternatives})
|
||||
set(DEP_INFO "${component}=${URL}")
|
||||
debug_message (STATUS "DEPENDENCY_URL: ${DEP_INFO}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/dependencies_64.txt "${DEP_INFO}\n")
|
||||
endif()
|
||||
|
||||
debug_message ("checking that unpacked directory exist: ${unpacked_path}")
|
||||
|
||||
@@ -7,7 +7,7 @@ include(target_flags)
|
||||
|
||||
# FIXME: there are compiler failures with LTO and Cross-Compile toolchains. Disabling for now, but
|
||||
# this must be addressed in a proper way
|
||||
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF "LINUX;NOT CMAKE_CROSSCOMPILING; CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
|
||||
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF "LINUX;NOT CMAKE_CROSSCOMPILING;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
|
||||
|
||||
ie_option (OS_FOLDER "create OS dedicated folder in output" OFF)
|
||||
|
||||
@@ -79,6 +79,4 @@ if(ENABLE_AVX512F)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (VERBOSE_BUILD)
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE_BUILD} CACHE BOOL "" FORCE)
|
||||
|
||||
@@ -82,10 +82,11 @@ unset(protobuf_installed CACHE)
|
||||
|
||||
#
|
||||
# ov_add_frontend(NAME <IR|ONNX|...>
|
||||
# FILEDESCRIPTION <description>
|
||||
# [LINKABLE_FRONTEND]
|
||||
# [SKIP_INSTALL]
|
||||
# [PROTOBUF_LITE]
|
||||
# FILEDESCRIPTION <description> # used on Windows to describe DLL file
|
||||
# [LINKABLE_FRONTEND] # whether we can use FE API directly or via FEM only
|
||||
# [SKIP_INSTALL] # private frontend, not for end users
|
||||
# [PROTOBUF_LITE] # requires only libprotobuf-lite
|
||||
# [SKIP_NCC_STYLE] # use custom NCC rules
|
||||
# [LINK_LIBRARIES <lib1 lib2 ...>])
|
||||
#
|
||||
macro(ov_add_frontend)
|
||||
@@ -106,6 +107,17 @@ macro(ov_add_frontend)
|
||||
set(FRONTEND_NAMES "${FRONTEND_NAMES}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
|
||||
if (WIN32)
|
||||
# Remove linux specific files
|
||||
file(GLOB_RECURSE LIN_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/os/lin/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/os/lin/*.hpp)
|
||||
list(REMOVE_ITEM LIBRARY_SRC "${LIN_FILES}")
|
||||
else()
|
||||
# Remove windows specific files
|
||||
file(GLOB_RECURSE WIN_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/os/win/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/os/win/*.hpp)
|
||||
list(REMOVE_ITEM LIBRARY_SRC "${WIN_FILES}")
|
||||
endif()
|
||||
file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp)
|
||||
file(GLOB_RECURSE LIBRARY_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
|
||||
|
||||
@@ -231,7 +243,7 @@ macro(ov_add_frontend)
|
||||
endif()
|
||||
|
||||
if(OV_FRONTEND_LINKABLE_FRONTEND)
|
||||
# install -dev part
|
||||
# install library development files
|
||||
install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/openvino
|
||||
DESTINATION ${FRONTEND_INSTALL_INCLUDE}/
|
||||
COMPONENT core_dev
|
||||
|
||||
@@ -31,4 +31,8 @@ if (LINUX)
|
||||
set(${res_var} NOTFOUND PARENT_SCOPE)
|
||||
endif ()
|
||||
endfunction()
|
||||
else()
|
||||
function(get_linux_name res_var)
|
||||
set(${res_var} NOTFOUND PARENT_SCOPE)
|
||||
endfunction()
|
||||
endif ()
|
||||
|
||||
@@ -23,7 +23,7 @@ execute_process(
|
||||
ERROR_VARIABLE error_var)
|
||||
|
||||
if(NOT clang_find_result EQUAL "0")
|
||||
message(WARNING "Please, install libclang-[N]-dev package (required for ncc naming style check)")
|
||||
message(WARNING "Please, install clang-[N] libclang-[N]-dev package (required for ncc naming style check)")
|
||||
message(WARNING "find_package(Clang) output: ${output_var}")
|
||||
message(WARNING "find_package(Clang) error: ${error_var}")
|
||||
set(ENABLE_NCC_STYLE OFF)
|
||||
@@ -106,9 +106,11 @@ function(ov_ncc_naming_style)
|
||||
"${NCC_STYLE_SOURCE_DIRECTORY}/*.cpp")
|
||||
|
||||
list(APPEND NCC_STYLE_ADDITIONAL_INCLUDE_DIRECTORIES "${NCC_STYLE_SOURCE_DIRECTORY}")
|
||||
# without it sources with same name from different directories will map to same .ncc_style target
|
||||
file(RELATIVE_PATH source_dir_rel ${CMAKE_SOURCE_DIR} ${NCC_STYLE_SOURCE_DIRECTORY})
|
||||
|
||||
foreach(source IN LISTS sources)
|
||||
set(output_file "${ncc_style_bin_dir}/${source}.ncc_style")
|
||||
set(output_file "${ncc_style_bin_dir}/${source_dir_rel}/${source}.ncc_style")
|
||||
set(full_source_path "${NCC_STYLE_SOURCE_DIRECTORY}/${source}")
|
||||
|
||||
add_custom_command(
|
||||
|
||||
@@ -99,7 +99,7 @@ CxxCatchStatement: '^.*$'
|
||||
CxxTryStatement: '^.*$'
|
||||
CxxForRangeStatement: '^.*$'
|
||||
MsAsmStatement: 'XXXX'
|
||||
NullStatement: 'XXXX'
|
||||
NullStatement: '^.*$'
|
||||
DeclarationStatement: '^.*$'
|
||||
TranslationUnit: 'XXXX'
|
||||
UnexposedAttribute: '^.*$'
|
||||
|
||||
@@ -11,6 +11,11 @@ macro (ie_option variable description value)
|
||||
list(APPEND IE_OPTIONS ${variable})
|
||||
endmacro()
|
||||
|
||||
# Usage: ov_option(<option_variable> "description" <initial value or boolean expression> [IF <condition>])
|
||||
macro (ov_option variable description value)
|
||||
ie_option(${variable} "${description}" ${value})
|
||||
endmacro()
|
||||
|
||||
macro (ie_dependent_option variable description def_value condition fallback_value)
|
||||
cmake_dependent_option(${variable} "${description}" ${def_value} "${condition}" ${fallback_value})
|
||||
list(APPEND IE_OPTIONS ${variable})
|
||||
|
||||
@@ -15,6 +15,10 @@ function(ie_cpack_set_library_dir)
|
||||
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
set(IE_CPACK_RUNTIME_PATH runtime/bin/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
set(IE_CPACK_ARCHIVE_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
elseif(APPLE)
|
||||
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
set(IE_CPACK_RUNTIME_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
set(IE_CPACK_ARCHIVE_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
else()
|
||||
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
set(IE_CPACK_RUNTIME_PATH runtime/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
@@ -65,8 +69,8 @@ macro(ie_cpack)
|
||||
endif()
|
||||
|
||||
foreach(ver IN LISTS MAJOR MINOR PATCH)
|
||||
if(DEFINED IE_VERSION_${ver})
|
||||
set(CPACK_PACKAGE_VERSION_${ver} ${IE_VERSION_${ver}})
|
||||
if(DEFINED OpenVINO_VERSION_${ver})
|
||||
set(CPACK_PACKAGE_VERSION_${ver} ${OpenVINO_VERSION_${ver}})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ function(ie_plugin_get_file_name target_name library_name)
|
||||
set("${library_name}" "${LIB_PREFIX}${target_name}${LIB_SUFFIX}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(NOT TARGET ie_plugins)
|
||||
add_custom_target(ie_plugins)
|
||||
if(NOT TARGET ov_plugins)
|
||||
add_custom_target(ov_plugins)
|
||||
endif()
|
||||
|
||||
#
|
||||
@@ -27,11 +27,12 @@ endif()
|
||||
# [OBJECT_LIBRARIES <object_libs>]
|
||||
# [VERSION_DEFINES_FOR <source>]
|
||||
# [SKIP_INSTALL]
|
||||
# [SKIP_REGISTRATION] Skip creation of <device>.xml
|
||||
# [ADD_CLANG_FORMAT]
|
||||
# )
|
||||
#
|
||||
function(ie_add_plugin)
|
||||
set(options SKIP_INSTALL ADD_CLANG_FORMAT AS_EXTENSION)
|
||||
set(options SKIP_INSTALL ADD_CLANG_FORMAT AS_EXTENSION SKIP_REGISTRATION)
|
||||
set(oneValueArgs NAME DEVICE_NAME VERSION_DEFINES_FOR PSEUDO_PLUGIN_FOR)
|
||||
set(multiValueArgs DEFAULT_CONFIG SOURCES OBJECT_LIBRARIES CPPLINT_FILTERS)
|
||||
cmake_parse_arguments(IE_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
@@ -101,7 +102,7 @@ function(ie_add_plugin)
|
||||
add_cpplint_target(${IE_PLUGIN_NAME}_cpplint FOR_TARGETS ${IE_PLUGIN_NAME} CUSTOM_FILTERS ${custom_filter})
|
||||
endif()
|
||||
|
||||
add_dependencies(ie_plugins ${IE_PLUGIN_NAME})
|
||||
add_dependencies(ov_plugins ${IE_PLUGIN_NAME})
|
||||
if(TARGET openvino_gapi_preproc)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_dependencies(${IE_PLUGIN_NAME} openvino_gapi_preproc)
|
||||
@@ -146,25 +147,27 @@ function(ie_add_plugin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check that plugin with such name is not registered
|
||||
# Enable for static build to generate correct plugins.hpp
|
||||
if(NOT IE_PLUGIN_SKIP_REGISTRATION OR NOT BUILD_SHARED_LIBS)
|
||||
# check that plugin with such name is not registered
|
||||
foreach(plugin_entry IN LISTS PLUGIN_FILES)
|
||||
string(REPLACE ":" ";" plugin_entry "${plugin_entry}")
|
||||
list(GET plugin_entry -1 library_name)
|
||||
list(GET plugin_entry 0 plugin_name)
|
||||
if(plugin_name STREQUAL "${IE_PLUGIN_DEVICE_NAME}" AND
|
||||
NOT library_name STREQUAL ${IE_PLUGIN_NAME})
|
||||
message(FATAL_ERROR "${IE_PLUGIN_NAME} and ${library_name} are both registered as ${plugin_name}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(plugin_entry IN LISTS PLUGIN_FILES)
|
||||
string(REPLACE ":" ";" plugin_entry "${plugin_entry}")
|
||||
list(GET plugin_entry -1 library_name)
|
||||
list(GET plugin_entry 0 plugin_name)
|
||||
if(plugin_name STREQUAL "${IE_PLUGIN_DEVICE_NAME}" AND
|
||||
NOT library_name STREQUAL ${IE_PLUGIN_NAME})
|
||||
message(FATAL_ERROR "${IE_PLUGIN_NAME} and ${library_name} are both registered as ${plugin_name}")
|
||||
endif()
|
||||
endforeach()
|
||||
# append plugin to the list to register
|
||||
|
||||
# append plugin to the list to register
|
||||
|
||||
list(APPEND PLUGIN_FILES "${IE_PLUGIN_DEVICE_NAME}:${IE_PLUGIN_NAME}")
|
||||
set(PLUGIN_FILES "${PLUGIN_FILES}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_CONFIG "${IE_PLUGIN_DEFAULT_CONFIG}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_PSEUDO_PLUGIN_FOR "${IE_PLUGIN_PSEUDO_PLUGIN_FOR}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_AS_EXTENSION "${IE_PLUGIN_AS_EXTENSION}" CACHE INTERNAL "" FORCE)
|
||||
list(APPEND PLUGIN_FILES "${IE_PLUGIN_DEVICE_NAME}:${IE_PLUGIN_NAME}")
|
||||
set(PLUGIN_FILES "${PLUGIN_FILES}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_CONFIG "${IE_PLUGIN_DEFAULT_CONFIG}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_PSEUDO_PLUGIN_FOR "${IE_PLUGIN_PSEUDO_PLUGIN_FOR}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_AS_EXTENSION "${IE_PLUGIN_AS_EXTENSION}" CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(ov_add_plugin)
|
||||
@@ -172,13 +175,12 @@ function(ov_add_plugin)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_register_plugins_dynamic(MAIN_TARGET <main target name>
|
||||
# POSSIBLE_PLUGINS <list of plugins which can be build by this repo>)
|
||||
# ie_register_plugins_dynamic(MAIN_TARGET <main target name>)
|
||||
#
|
||||
macro(ie_register_plugins_dynamic)
|
||||
set(options)
|
||||
set(oneValueArgs MAIN_TARGET)
|
||||
set(multiValueArgs POSSIBLE_PLUGINS)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(IE_REGISTER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT IE_REGISTER_MAIN_TARGET)
|
||||
@@ -261,6 +263,15 @@ macro(ie_register_plugins)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# ov_register_plugins()
|
||||
#
|
||||
macro(ov_register_plugins)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
ie_register_plugins_dynamic(${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# ie_target_link_plugins(<TARGET_NAME>)
|
||||
#
|
||||
@@ -347,7 +358,7 @@ function(ie_generate_plugins_hpp)
|
||||
# for some reason dependency on source files does not work
|
||||
# so, we have to use explicit target and make it dependency for inference_engine
|
||||
add_custom_target(_ie_plugins_hpp DEPENDS ${ie_plugins_hpp})
|
||||
add_dependencies(inference_engine _ie_plugins_hpp)
|
||||
add_dependencies(inference_engine_obj _ie_plugins_hpp)
|
||||
|
||||
# add dependency for object files
|
||||
get_target_property(sources inference_engine_obj SOURCES)
|
||||
|
||||
@@ -26,20 +26,22 @@ function (commitHash VAR)
|
||||
set (${VAR} ${GIT_COMMIT_HASH} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(ie_parse_ci_build_number)
|
||||
set(IE_VERSION_BUILD 000)
|
||||
macro(ov_parse_ci_build_number)
|
||||
set(OpenVINO_VERSION_BUILD 000)
|
||||
set(IE_VERSION_BUILD ${OpenVINO_VERSION_BUILD})
|
||||
|
||||
if(CI_BUILD_NUMBER MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)\-([0-9]+)\-.*")
|
||||
set(IE_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(IE_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(IE_VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
set(IE_VERSION_BUILD ${CMAKE_MATCH_4})
|
||||
set(OpenVINO_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(OpenVINO_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(OpenVINO_VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
set(OpenVINO_VERSION_BUILD ${CMAKE_MATCH_4})
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED repo_root)
|
||||
message(FATAL_ERROR "repo_root is not defined")
|
||||
endif()
|
||||
|
||||
macro(ie_get_hpp_version)
|
||||
macro(ov_get_hpp_version)
|
||||
if(NOT DEFINED OpenVINO_SOURCE_DIR)
|
||||
return()
|
||||
endif()
|
||||
@@ -59,11 +61,12 @@ macro(ie_parse_ci_build_number)
|
||||
|
||||
foreach(suffix MAJOR MINOR PATCH)
|
||||
set(ie_version_name "IE_VERSION_${suffix}")
|
||||
set(ov_version_name "OPENVINO_VERSION_${suffix}")
|
||||
set(ov_version_name "OpenVINO_VERSION_${suffix}")
|
||||
set(ov_version_name_hpp "OPENVINO_VERSION_${suffix}")
|
||||
|
||||
string(REGEX REPLACE ".+${ie_version_name}[ ]+([0-9]+).*" "\\1"
|
||||
${ie_version_name}_HPP "${IE_VERSION_PARTS}")
|
||||
string(REGEX REPLACE ".+${ov_version_name}[ ]+([0-9]+).*" "\\1"
|
||||
string(REGEX REPLACE ".+${ov_version_name_hpp}[ ]+([0-9]+).*" "\\1"
|
||||
${ov_version_name}_HPP "${OV_VERSION_PARTS}")
|
||||
|
||||
if(NOT ${ie_version_name}_HPP EQUAL ${ov_version_name}_HPP)
|
||||
@@ -72,26 +75,26 @@ macro(ie_parse_ci_build_number)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(ie_hpp_version_is_found ON)
|
||||
set(ov_hpp_version_is_found ON)
|
||||
endmacro()
|
||||
|
||||
# detect OpenVINO version via ie_version.hpp
|
||||
ie_get_hpp_version()
|
||||
# detect OpenVINO version via openvino/core/version.hpp and ie_version.hpp
|
||||
ov_get_hpp_version()
|
||||
|
||||
if(ie_hpp_version_is_found)
|
||||
foreach(var IE_VERSION_MAJOR IE_VERSION_MINOR IE_VERSION_PATCH)
|
||||
if(ov_hpp_version_is_found)
|
||||
foreach(var OpenVINO_VERSION_MAJOR OpenVINO_VERSION_MINOR OpenVINO_VERSION_PATCH)
|
||||
if(DEFINED ${var} AND NOT ${var} EQUAL ${var}_HPP)
|
||||
message(FATAL_ERROR "${var} parsed from CI_BUILD_NUMBER (${${var}}) \
|
||||
and from ie_version.hpp (${${var}_HPP}) are different")
|
||||
and from openvino/core/version.hpp (${${var}_HPP}) are different")
|
||||
else()
|
||||
# CI_BUILD_NUMBER is not defined well, take info from ie_verison.hpp as a baseline
|
||||
# CI_BUILD_NUMBER is not defined well, take info from openvino/core/version.hpp as a baseline
|
||||
set(${var} ${${var}_HPP})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(IE_VERSION "${IE_VERSION_MAJOR}.${IE_VERSION_MINOR}.${IE_VERSION_PATCH}")
|
||||
message(STATUS "OpenVINO version is ${IE_VERSION}")
|
||||
set(OpenVINO_VERSION "${OpenVINO_VERSION_MAJOR}.${OpenVINO_VERSION_MINOR}.${OpenVINO_VERSION_PATCH}")
|
||||
message(STATUS "OpenVINO version is ${OpenVINO_VERSION} (Build ${OpenVINO_VERSION_BUILD})")
|
||||
endmacro()
|
||||
|
||||
if (DEFINED ENV{CI_BUILD_NUMBER})
|
||||
@@ -104,10 +107,10 @@ else()
|
||||
set(CI_BUILD_NUMBER "${custom_build}")
|
||||
endif()
|
||||
|
||||
# provides Inference Engine version
|
||||
# provides OpenVINO version
|
||||
# 1. If CI_BUILD_NUMBER is defined, parses this information
|
||||
# 2. Otherwise, parses ie_version.hpp
|
||||
ie_parse_ci_build_number()
|
||||
# 2. Otherwise, parses openvino/core/version.hpp
|
||||
ov_parse_ci_build_number()
|
||||
|
||||
macro (addVersionDefines FILE)
|
||||
set(__version_file ${FILE})
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(IE_VS_VER_FILEVERSION_QUAD "${IE_VERSION_MAJOR},${IE_VERSION_MINOR},${IE_VERSION_PATCH},0")
|
||||
set(IE_VS_VER_PRODUCTVERSION_QUAD "${IE_VERSION_MAJOR},${IE_VERSION_MINOR},${IE_VERSION_PATCH},0")
|
||||
set(IE_VS_VER_FILEVERSION_STR "${IE_VERSION_MAJOR}.${IE_VERSION_MINOR}.${IE_VERSION_PATCH}.0")
|
||||
set(IE_VS_VER_FILEVERSION_QUAD "${OpenVINO_VERSION_MAJOR},${OpenVINO_VERSION_MINOR},${OpenVINO_VERSION_PATCH},${OpenVINO_VERSION_BUILD}")
|
||||
set(IE_VS_VER_PRODUCTVERSION_QUAD "${OpenVINO_VERSION_MAJOR},${OpenVINO_VERSION_MINOR},${OpenVINO_VERSION_PATCH},${OpenVINO_VERSION_BUILD}")
|
||||
set(IE_VS_VER_FILEVERSION_STR "${OpenVINO_VERSION_MAJOR}.${OpenVINO_VERSION_MINOR}.${OpenVINO_VERSION_PATCH}.${OpenVINO_VERSION_BUILD}")
|
||||
|
||||
set(IE_VS_VER_COMPANY_NAME_STR "Intel Corporation")
|
||||
set(IE_VS_VER_PRODUCTVERSION_STR "${CI_BUILD_NUMBER}")
|
||||
|
||||
@@ -6,15 +6,19 @@ function(ie_generate_dev_package_config)
|
||||
# dummy check that OpenCV is here
|
||||
find_package(OpenCV QUIET)
|
||||
|
||||
set(all_dev_targets gflags ov_runtime_libraries)
|
||||
foreach(component IN LISTS openvino_export_components)
|
||||
# export all targets with prefix and use them during extra modules build
|
||||
export(TARGETS ${${component}} NAMESPACE IE::
|
||||
APPEND FILE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
|
||||
APPEND FILE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
|
||||
list(APPEND all_dev_targets ${${component}})
|
||||
endforeach()
|
||||
add_custom_target(ie_dev_targets DEPENDS ${all_dev_targets})
|
||||
|
||||
# if we've found system gflags
|
||||
if(gflags_DIR)
|
||||
set(gflags_BINARY_DIR "${gflags_DIR}")
|
||||
endif()
|
||||
|
||||
configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake"
|
||||
INSTALL_DESTINATION share # not used
|
||||
@@ -30,18 +34,22 @@ function(ov_generate_dev_package_config)
|
||||
# dummy check that OpenCV is here
|
||||
find_package(OpenCV QUIET)
|
||||
|
||||
set(all_dev_targets gflags ov_runtime_libraries)
|
||||
foreach(component IN LISTS openvino_export_components)
|
||||
string(FIND "${component}" "_legacy" index)
|
||||
if (index EQUAL -1)
|
||||
if(index EQUAL -1)
|
||||
# export all targets with prefix and use them during extra modules build
|
||||
export(TARGETS ${${component}} NAMESPACE openvino::
|
||||
APPEND FILE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
|
||||
APPEND FILE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
|
||||
list(APPEND all_dev_targets ${${component}})
|
||||
endif()
|
||||
endforeach()
|
||||
add_custom_target(ov_dev_targets DEPENDS ${all_dev_targets})
|
||||
|
||||
# if we've found system gflags
|
||||
if(gflags_DIR)
|
||||
set(gflags_BINARY_DIR "${gflags_DIR}")
|
||||
endif()
|
||||
|
||||
configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/OpenVINODeveloperPackageConfig.cmake"
|
||||
INSTALL_DESTINATION share # not used
|
||||
@@ -59,14 +67,14 @@ endfunction()
|
||||
|
||||
function(register_extra_modules)
|
||||
# post export
|
||||
openvino_developer_export_targets(COMPONENT core TARGETS inference_engine)
|
||||
openvino_developer_export_targets(COMPONENT core TARGETS ngraph)
|
||||
openvino_developer_export_targets(COMPONENT core_legacy TARGETS inference_engine)
|
||||
openvino_developer_export_targets(COMPONENT core_legacy TARGETS ngraph)
|
||||
|
||||
set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/runtime")
|
||||
set(OpenVINODeveloperPackage_DIR "${CMAKE_BINARY_DIR}/runtime")
|
||||
|
||||
function(generate_fake_dev_package NS)
|
||||
if (NS STREQUAL "openvino")
|
||||
if(NS STREQUAL "openvino")
|
||||
set(devconfig_file "${OpenVINODeveloperPackage_DIR}/OpenVINODeveloperPackageConfig.cmake")
|
||||
else()
|
||||
set(devconfig_file "${InferenceEngineDeveloperPackage_DIR}/InferenceEngineDeveloperPackageConfig.cmake")
|
||||
@@ -81,10 +89,6 @@ function(register_extra_modules)
|
||||
file(APPEND "${devconfig_file}" "add_library(${NS}::${target} ALIAS ${target})\n")
|
||||
endif()
|
||||
endforeach()
|
||||
if ("${NS}" STREQUAL "openvino")
|
||||
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime ALIAS openvino)\n")
|
||||
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime::dev ALIAS openvino_dev)\n")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
generate_fake_dev_package("openvino")
|
||||
@@ -137,7 +141,7 @@ ie_generate_dev_package_config()
|
||||
ov_generate_dev_package_config()
|
||||
|
||||
# extra modules must be registered after inference_engine library
|
||||
# and all other IE common libraries (ov_runtime_libraries) are creared
|
||||
# and all other OpenVINO Core libraries are creared
|
||||
# because 'register_extra_modules' creates fake InferenceEngineDeveloperPackageConfig.cmake
|
||||
# with all imported developer targets
|
||||
register_extra_modules()
|
||||
|
||||
@@ -59,7 +59,7 @@ cmake_dependent_option (ENABLE_WHEEL "Build wheel packages for PyPi" OFF
|
||||
# Inference Engine specific options
|
||||
#
|
||||
|
||||
# "MKL-DNN library based on OMP or TBB or Sequential implementation: TBB|OMP|SEQ"
|
||||
# "OneDNN library based on OMP or TBB or Sequential implementation: TBB|OMP|SEQ"
|
||||
if(X86 OR ARM OR (MSVC AND (ARM OR AARCH64)) )
|
||||
set(THREADING_DEFAULT "SEQ")
|
||||
else()
|
||||
@@ -82,7 +82,7 @@ else()
|
||||
set(ENABLE_TBBBIND_2_5_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
ie_dependent_option (ENABLE_TBBBIND_2_5 "Enable TBBBind_2_5 static usage in OpenVINO runtime" ON "ENABLE_TBBBIND_2_5_DEFAULT" OFF)
|
||||
ie_dependent_option (ENABLE_TBBBIND_2_5 "Enable TBBBind_2_5 static usage in OpenVINO runtime" ${ENABLE_TBBBIND_2_5_DEFAULT} "THREADING MATCHES TBB" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_INTEL_GNA "GNA support for inference engine" ON
|
||||
"NOT APPLE;NOT ANDROID;X86_64;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.4" OFF)
|
||||
@@ -136,6 +136,17 @@ ie_dependent_option(ENABLE_TBB_RELEASE_ONLY "Only Release TBB libraries are link
|
||||
|
||||
ie_dependent_option (ENABLE_SYSTEM_PUGIXML "use the system copy of pugixml" OFF "BUILD_SHARED_LIBS" OFF)
|
||||
|
||||
get_linux_name(LINUX_OS_NAME)
|
||||
if(LINUX_OS_NAME MATCHES "^Ubuntu [0-9]+\.[0-9]+$" AND NOT DEFINED ENV{TBBROOT})
|
||||
# Debian packages are enabled on Ubuntu systems
|
||||
# so, system TBB can be tried for usage
|
||||
set(ENABLE_SYSTEM_TBB_DEFAULT ON)
|
||||
else()
|
||||
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
ie_dependent_option (ENABLE_SYSTEM_TBB "use the system version of TBB" ${ENABLE_SYSTEM_TBB_DEFAULT} "THREADING MATCHES TBB;LINUX" OFF)
|
||||
|
||||
ie_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS" OFF)
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(PACKAGE_VERSION_MAJOR @IE_VERSION_MAJOR@)
|
||||
set(PACKAGE_VERSION_MINOR @IE_VERSION_MINOR@)
|
||||
set(PACKAGE_VERSION_PATCH @IE_VERSION_PATCH@)
|
||||
set(PACKAGE_VERSION_MAJOR @OpenVINO_VERSION_MAJOR@)
|
||||
set(PACKAGE_VERSION_MINOR @OpenVINO_VERSION_MINOR@)
|
||||
set(PACKAGE_VERSION_PATCH @OpenVINO_VERSION_PATCH@)
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
|
||||
set(PACKAGE_VERSION_EXACT False)
|
||||
|
||||
@@ -12,19 +12,20 @@ set_and_check(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_SOURCE_DIR@") # KMB
|
||||
|
||||
# Variables to export in plugin's projects
|
||||
|
||||
set(ie_options "@IE_OPTIONS@;CMAKE_BUILD_TYPE;CMAKE_SKIP_RPATH")
|
||||
list(APPEND ie_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER)
|
||||
set(ie_options "@IE_OPTIONS@")
|
||||
list(APPEND ie_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER
|
||||
CMAKE_BUILD_TYPE CMAKE_SKIP_RPATH CMAKE_INSTALL_PREFIX)
|
||||
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path)
|
||||
|
||||
message(STATUS "The following CMake options are exported from Inference Engine Developer package")
|
||||
message("")
|
||||
message(" ")
|
||||
foreach(option IN LISTS ie_options)
|
||||
if(NOT DEFINED "${option}")
|
||||
load_cache("${cache_path}" READ_WITH_PREFIX "" ${option})
|
||||
endif()
|
||||
message(" ${option}: ${${option}}")
|
||||
endforeach()
|
||||
message("")
|
||||
message(" ")
|
||||
|
||||
# for samples in 3rd party projects
|
||||
set_and_check(gflags_DIR "@gflags_BINARY_DIR@")
|
||||
@@ -44,11 +45,6 @@ find_dependency(InferenceEngine
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
find_dependency(ngraph
|
||||
PATHS "${CMAKE_CURRENT_LIST_DIR}/src/core"
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
find_dependency(OpenVINODeveloperPackage
|
||||
PATHS "${CMAKE_CURRENT_LIST_DIR}"
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
@@ -70,6 +66,18 @@ foreach(component @openvino_export_components@)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/${component}_dev_targets.cmake")
|
||||
endforeach()
|
||||
|
||||
if(TARGET IE::ov_core_dev AND NOT TARGET openvino::core::dev)
|
||||
add_library(openvino::core::dev INTERFACE IMPORTED)
|
||||
set_target_properties(openvino::core::dev PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES IE::ov_core_dev)
|
||||
endif()
|
||||
|
||||
if(TARGET IE::runtime::dev AND NOT TARGET openvino::runtime::dev)
|
||||
add_library(openvino::runtime::dev INTERFACE IMPORTED)
|
||||
set_target_properties(openvino::runtime::dev PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES IE::runtime::dev)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SYSTEM_PUGIXML)
|
||||
find_dependency(PugiXML)
|
||||
set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE)
|
||||
@@ -86,13 +94,11 @@ endif()
|
||||
# Extra Compile Flags
|
||||
#
|
||||
|
||||
if(NOT MSVC)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ie_add_compiler_flags(-Wno-error=unused-variable)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ie_add_compiler_flags(-Wno-error=unused-but-set-variable)
|
||||
if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
||||
endif()
|
||||
ie_add_compiler_flags(-Wno-error=unused-but-set-variable)
|
||||
if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(PACKAGE_VERSION_MAJOR @IE_VERSION_MAJOR@)
|
||||
set(PACKAGE_VERSION_MINOR @IE_VERSION_MINOR@)
|
||||
set(PACKAGE_VERSION_PATCH @IE_VERSION_PATCH@)
|
||||
set(PACKAGE_VERSION_MAJOR @OpenVINO_VERSION_MAJOR@)
|
||||
set(PACKAGE_VERSION_MINOR @OpenVINO_VERSION_MINOR@)
|
||||
set(PACKAGE_VERSION_PATCH @OpenVINO_VERSION_PATCH@)
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
|
||||
set(PACKAGE_VERSION_EXACT False)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# * `Runtime`: OpenVINO C++ and C Core & Inference Runtime, frontend common
|
||||
# * `ONNX`: OpenVINO ONNX frontend
|
||||
# * `Paddle`: OpenVINO Paddle frontend
|
||||
# * `TensorFlow`: OpenVINO TensorFlow frontend
|
||||
#
|
||||
# If no components are specified, `Runtime` component is provided:
|
||||
#
|
||||
@@ -146,14 +147,29 @@ set(_ov_package_prefix_dir "${PACKAGE_PREFIX_DIR}")
|
||||
|
||||
set(THREADING "@THREADING@")
|
||||
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND NOT TBB_FOUND)
|
||||
set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@")
|
||||
set(enable_system_tbb "@ENABLE_SYSTEM_TBB@")
|
||||
if(NOT enable_system_tbb)
|
||||
set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@")
|
||||
set(find_package_tbb_extra_args
|
||||
CONFIG
|
||||
PATHS
|
||||
# oneTBB case exposed via export TBBROOT=<custom TBB root>
|
||||
"$ENV{TBBROOT}/lib64/cmake/TBB"
|
||||
"$ENV{TBBROOT}/lib/cmake/TBB"
|
||||
# "$ENV{TBB_DIR}"
|
||||
# for custom TBB exposed via cmake -DTBBROOT=<custom TBB root>
|
||||
"${TBBROOT}/cmake"
|
||||
# _tbb_dir points to TBB_DIR (custom | temp | system) used to build OpenVINO
|
||||
${_tbb_dir}
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
unset(_tbb_dir)
|
||||
endif()
|
||||
unset(enable_system_tbb)
|
||||
|
||||
_ov_find_dependency(TBB
|
||||
COMPONENTS tbb tbbmalloc
|
||||
CONFIG
|
||||
PATHS ${TBBROOT}/cmake
|
||||
${_tbb_dir}
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
${find_package_tbb_extra_args})
|
||||
|
||||
set(install_tbbbind "@install_tbbbind@")
|
||||
if(install_tbbbind)
|
||||
@@ -164,6 +180,7 @@ if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND NOT TBB_FOUND
|
||||
NO_DEFAULT_PATH)
|
||||
set_target_properties(${TBBBIND_2_5_IMPORTED_TARGETS} PROPERTIES IMPORTED_GLOBAL ON)
|
||||
endif()
|
||||
unset(install_tbbbind)
|
||||
endif()
|
||||
|
||||
_ov_find_dependency(Threads)
|
||||
@@ -175,7 +192,7 @@ if(ENABLE_INTEL_GNA AND NOT ENABLE_INTEL_GNA_SHARED AND NOT libGNA_FOUND)
|
||||
_ov_find_dependency(libGNA
|
||||
COMPONENTS KERNEL
|
||||
CONFIG
|
||||
PATHS ${CMAKE_CURRENT_LIST_DIR}
|
||||
PATHS "${CMAKE_CURRENT_LIST_DIR}"
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
@@ -184,7 +201,8 @@ if(NOT TARGET openvino)
|
||||
set(_ov_as_external_package ON)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake")
|
||||
|
||||
# TODO: WA for cmake version < 3.16
|
||||
# WA for cmake version < 3.16 which does not export
|
||||
# IMPORTED_LINK_DEPENDENT_LIBRARIES_** properties if no PUBLIC dependencies for the library
|
||||
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND TBB_FOUND)
|
||||
foreach (type RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
|
||||
set_property(TARGET openvino::runtime APPEND PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES_${type} "TBB::tbb;TBB::tbbmalloc")
|
||||
|
||||
@@ -10,19 +10,20 @@ set_and_check(OpenVINO_SOURCE_DIR "@OpenVINO_SOURCE_DIR@")
|
||||
|
||||
# Variables to export in plugin's projects
|
||||
|
||||
set(ie_options "@IE_OPTIONS@;CMAKE_BUILD_TYPE;CMAKE_SKIP_RPATH")
|
||||
list(APPEND ie_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER)
|
||||
set(ov_options "@IE_OPTIONS@")
|
||||
list(APPEND ov_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER
|
||||
CMAKE_BUILD_TYPE CMAKE_SKIP_RPATH CMAKE_INSTALL_PREFIX)
|
||||
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path)
|
||||
|
||||
message(STATUS "The following CMake options are exported from OpenVINO Developer package")
|
||||
message("")
|
||||
foreach(option IN LISTS ie_options)
|
||||
message(" ")
|
||||
foreach(option IN LISTS ov_options)
|
||||
if(NOT DEFINED "${option}")
|
||||
load_cache("${cache_path}" READ_WITH_PREFIX "" ${option})
|
||||
endif()
|
||||
message(" ${option}: ${${option}}")
|
||||
endforeach()
|
||||
message("")
|
||||
message(" ")
|
||||
|
||||
# for samples in 3rd party projects
|
||||
set_and_check(gflags_DIR "@gflags_BINARY_DIR@")
|
||||
@@ -51,10 +52,10 @@ endforeach()
|
||||
if(ENABLE_SYSTEM_PUGIXML)
|
||||
find_dependency(PugiXML)
|
||||
set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE)
|
||||
add_library(IE::pugixml ALIAS pugixml)
|
||||
add_library(openvino::pugixml ALIAS pugixml)
|
||||
endif()
|
||||
|
||||
# inherit OpenCV from main IE project if enabled
|
||||
# inherit OpenCV from main OpenVINO project if enabled
|
||||
if ("@OpenCV_FOUND@")
|
||||
load_cache("${cache_path}" READ_WITH_PREFIX "" OpenCV_DIR)
|
||||
find_dependency(OpenCV)
|
||||
@@ -64,13 +65,11 @@ endif()
|
||||
# Extra Compile Flags
|
||||
#
|
||||
|
||||
if(NOT MSVC)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ie_add_compiler_flags(-Wno-error=unused-variable)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ie_add_compiler_flags(-Wno-error=unused-but-set-variable)
|
||||
if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
||||
endif()
|
||||
ie_add_compiler_flags(-Wno-error=unused-but-set-variable)
|
||||
if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -86,11 +86,6 @@ ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/onnx_import"
|
||||
ie_onnx_import_out_files)
|
||||
|
||||
set(rel_path "docs/onnx_custom_op")
|
||||
ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/docs/models"
|
||||
docs_onnx_out_files)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
if(ENABLE_OV_ONNX_FRONTEND AND ENABLE_REQUIREMENTS_INSTALL)
|
||||
find_package(PythonInterp 3 REQUIRED)
|
||||
|
||||
@@ -25,7 +25,7 @@ endif()
|
||||
if(use_static_runtime)
|
||||
foreach(lang C CXX)
|
||||
foreach(build_type "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO")
|
||||
set(flag_var "CMAKE_${lang}_FLAGS${build_type}")
|
||||
set(flag_var "CMAKE_${lang}_FLAGS${build_type}_INIT")
|
||||
string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
# Copyright (C) 2018-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if(DEFINED OECORE_BASE_DIR)
|
||||
# OECORE_BASE_DIR was passed via CMake command line, nothing to do
|
||||
elseif(DEFINED ENV{OECORE_BASE_DIR})
|
||||
# User sets OECORE_BASE_DIR environment variable
|
||||
set(OECORE_BASE_DIR $ENV{OECORE_BASE_DIR})
|
||||
elseif(DEFINED ENV{OECORE_NATIVE_SYSROOT})
|
||||
# OECORE_NATIVE_SYSROOT is a default environment variable for the OECore toolchain
|
||||
set(OECORE_BASE_DIR "$ENV{OECORE_NATIVE_SYSROOT}/../..")
|
||||
else()
|
||||
# Use default value
|
||||
set(OECORE_BASE_DIR "/usr/local/oecore-x86_64")
|
||||
endif()
|
||||
|
||||
set(OECORE_TARGET_NAME "aarch64-ese-linux")
|
||||
set(OECORE_TARGET_SYSROOT "${OECORE_BASE_DIR}/sysroots/${OECORE_TARGET_NAME}")
|
||||
set(OECORE_HOST_SYSROOT "${OECORE_BASE_DIR}/sysroots/x86_64-esesdk-linux")
|
||||
set(OECORE_HOST_COMPILER_BIN_DIR "${OECORE_HOST_SYSROOT}/usr/bin/${OECORE_TARGET_NAME}")
|
||||
|
||||
set(CMAKE_SYSTEM_NAME "Linux")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
|
||||
|
||||
set(CMAKE_SYSROOT "${OECORE_TARGET_SYSROOT}")
|
||||
|
||||
set(CMAKE_C_COMPILER "${OECORE_HOST_COMPILER_BIN_DIR}/aarch64-ese-linux-gcc")
|
||||
set(CMAKE_CXX_COMPILER "${OECORE_HOST_COMPILER_BIN_DIR}/aarch64-ese-linux-g++")
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "-mcpu=cortex-a53 -mtune=cortex-a53 --sysroot=${OECORE_TARGET_SYSROOT}")
|
||||
set(CMAKE_CXX_FLAGS_INIT "-mcpu=cortex-a53 -mtune=cortex-a53 --sysroot=${OECORE_TARGET_SYSROOT}")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=${OECORE_TARGET_SYSROOT}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=${OECORE_TARGET_SYSROOT}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=${OECORE_TARGET_SYSROOT}")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
@@ -35,14 +35,14 @@ if(_onecoreuap_arch STREQUAL "x64")
|
||||
# Forcefull make VS search for C++ libraries in these folders prior to other c++ standard libraries localizations.
|
||||
add_link_options("/LIBPATH:\"\$\(VC_LibraryPath_VC_x64_OneCore\)\"")
|
||||
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/\$\(Platform\)/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
elseif(_onecoreuap_arch STREQUAL "X86")
|
||||
add_link_options("/LIBPATH:\"\$\(VCInstallDir\)lib/onecore\"")
|
||||
add_link_options("/LIBPATH:\"\$\(VC_LibraryPath_VC_x86_OneCore\)\"")
|
||||
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported architecture ${_onecoreuap_arch}. Only X86 or X86_64 are supported")
|
||||
endif()
|
||||
@@ -52,8 +52,8 @@ unset(_onecoreuap_arch)
|
||||
# compile flags
|
||||
|
||||
set(includes "/I\"\$\(UniversalCRT_IncludePath\)\"")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${includes}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${includes}")
|
||||
set(CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} ${includes}")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} ${includes}")
|
||||
unset(includes)
|
||||
|
||||
# linker flags
|
||||
@@ -62,9 +62,9 @@ foreach(lib kernel32 user32 advapi32 ole32 mscoree combase)
|
||||
set(linker_flags "/NODEFAULTLIB:${lib}.lib ${linker_flags}")
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${linker_flags}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${linker_flags}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${linker_flags}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} ${linker_flags}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} ${linker_flags}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} ${linker_flags}")
|
||||
unset(linker_flags)
|
||||
|
||||
#
|
||||
|
||||
@@ -7,8 +7,6 @@ if(NOT ENABLE_DOCKER)
|
||||
ie_add_compiler_flags(-Wall)
|
||||
endif()
|
||||
|
||||
add_subdirectory(snippets)
|
||||
|
||||
# Detect OpenVINO
|
||||
find_package(OpenVINO QUIET
|
||||
PATHS "${CMAKE_BINARY_DIR}"
|
||||
@@ -17,9 +15,8 @@ if(NOT ENABLE_DOCKER)
|
||||
set(OpenVINO_DIR ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
if(ENABLE_OV_ONNX_FRONTEND)
|
||||
add_subdirectory(onnx_custom_op)
|
||||
endif()
|
||||
add_subdirectory(snippets)
|
||||
|
||||
add_subdirectory(template_extension)
|
||||
|
||||
set(all_docs_targets
|
||||
@@ -49,6 +46,7 @@ endif()
|
||||
set(LINKCHECKER_PY "" CACHE FILEPATH "Path to linkchecker.py for documentation check dir.")
|
||||
set(ENABLE_OPENVINO_NOTEBOOKS OFF CACHE BOOL "Build with openvino notebooks")
|
||||
set(OMZ_DOCS_DIR "" CACHE PATH "Path to open_model_zoo documentation dir.")
|
||||
set(OTE_DOCS_DIR "" CACHE PATH "Path to training_extensions documentation dir.")
|
||||
set(WORKBENCH_DOCS_DIR "" CACHE PATH "Path to workbench documentation dir.")
|
||||
set(OVMS_DOCS_DIR "" CACHE PATH "Path to model server documentation dir.")
|
||||
set(GRAPH_CSV_DIR "" CACHE PATH "Path to the folder containing csv data for rendering graphs.")
|
||||
@@ -133,6 +131,16 @@ function(build_docs)
|
||||
)
|
||||
endif()
|
||||
|
||||
list(APPEND commands
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${API_DOCS_IN}/api_reference.rst ${API_DOCS_OUT}/api_reference.rst
|
||||
)
|
||||
|
||||
if(ENABLE_PYTHON)
|
||||
list(APPEND commands
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${API_DOCS_IN}/ie_python_api ${API_DOCS_OUT}/ie_python_api
|
||||
)
|
||||
endif()
|
||||
|
||||
# omz doc files
|
||||
if(EXISTS "${OMZ_DOCS_DIR}")
|
||||
get_filename_component(OMZ_DOCS_DIR "${OMZ_DOCS_DIR}" ABSOLUTE)
|
||||
@@ -152,6 +160,15 @@ function(build_docs)
|
||||
--output_dir=${DOCS_BUILD_DIR}/workbench)
|
||||
endif()
|
||||
|
||||
# ote doc files
|
||||
if(EXISTS "${OTE_DOCS_DIR}")
|
||||
get_filename_component(WORKBENCH_DOCS_DIR "${OTE_DOCS_DIR}" ABSOLUTE)
|
||||
|
||||
list(APPEND commands COMMAND ${PYTHON_EXECUTABLE} ${DOXY_MD_FILTER}
|
||||
--input_dir=${OTE_DOCS_DIR}
|
||||
--output_dir=${DOCS_BUILD_DIR}/ote)
|
||||
endif()
|
||||
|
||||
# ovms doc files
|
||||
if(EXISTS "${OVMS_DOCS_DIR}")
|
||||
get_filename_component(OVMS_DOCS_DIR "${OVMS_DOCS_DIR}" ABSOLUTE)
|
||||
@@ -190,7 +207,6 @@ function(build_docs)
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${COPY_IMAGES_SCRIPT} ${XML_OUTPUT} ${RST_OUTPUT}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${DOXYGEN_MAPPING_SCRIPT} ${XML_OUTPUT} ${DOCS_BUILD_DIR} ${OpenVINO_SOURCE_DIR}/../
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${SPHINX_INDEX_IN} ${SPHINX_INDEX_OUT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${API_DOCS_IN} ${API_DOCS_OUT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SPHINX_TEMPLATES_IN} ${SPHINX_TEMPLATES_OUT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DOXYREST_IN} ${DOXYREST_OUT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DOXYREST_SPHINX_IN} ${DOXYREST_SPHINX_OUT}
|
||||
|
||||
@@ -264,6 +264,10 @@ TAB_SIZE = 4
|
||||
ALIASES = "ref_ie{1}=@ref InferenceEngine::\1 \"\1\""
|
||||
ALIASES += sphinxdirective="\n\xmlonly<sphinxdirective>"
|
||||
ALIASES += endsphinxdirective="</sphinxdirective>\endxmlonly"
|
||||
ALIASES += sphinxtabset="\n\xmlonly<sphinxtabset></sphinxtabset>\endxmlonly\n"
|
||||
ALIASES += endsphinxtabset="\n\xmlonly<endsphinxtabset></endsphinxtabset>\endxmlonly\n"
|
||||
ALIASES += sphinxtab{1}="\n\xmlonly<sphinxtab>\1</sphinxtab>\endxmlonly\n"
|
||||
ALIASES += endsphinxtab="\n\xmlonly<endsphinxtab></endsphinxtab>\endxmlonly\n"
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C. For
|
||||
@@ -719,7 +723,7 @@ SHOW_NAMESPACES = YES
|
||||
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
|
||||
# doxygen should invoke to get the current version for each file (typically from
|
||||
# the version control system). Doxygen will invoke the program by executing (via
|
||||
# popen()) the command command input-file, where command is the value of the
|
||||
# popen()) the command input-file, where command is the value of the
|
||||
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
|
||||
# by doxygen. Whatever the program writes to standard output is used as the file
|
||||
# version. For an example see the documentation.
|
||||
@@ -843,16 +847,6 @@ INPUT = "@MARKDOWN_INPUT@" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/common/transformations/include/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/common/util/include/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/descriptor" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/op/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/op/util" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/opsets/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/pass/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/pattern/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/pattern/op/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/runtime/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/ngraph/type/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/openvino/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/openvino/core/" \
|
||||
"@OpenVINO_SOURCE_DIR@/src/core/include/openvino/core/descriptor/" \
|
||||
@@ -917,7 +911,9 @@ RECURSIVE = YES
|
||||
# Note that relative paths are relative to the directory from which doxygen is
|
||||
# run.
|
||||
|
||||
EXCLUDE =
|
||||
EXCLUDE = "@OpenVINO_SOURCE_DIR@/thirdparty" \
|
||||
"@OpenVINO_SOURCE_DIR@/temp" \
|
||||
"@OpenVINO_SOURCE_DIR@/bin"
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
@@ -936,7 +932,6 @@ EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = */temp/* \
|
||||
*/bin/* \
|
||||
*/tests/* \
|
||||
*/openvx/* \
|
||||
*/thirdparty/* \
|
||||
"@DOXYREST_OUT@" \
|
||||
"@XML_OUTPUT@" \
|
||||
@@ -1045,7 +1040,6 @@ EXCLUDE_SYMBOLS = InferenceEngine::details \
|
||||
EXAMPLE_PATH = "@OpenVINO_SOURCE_DIR@" \
|
||||
"@OpenVINO_SOURCE_DIR@/docs/HOWTO/" \
|
||||
"@OpenVINO_SOURCE_DIR@/docs/" \
|
||||
"@OpenVINO_SOURCE_DIR@/docs/onnx_custom_op/" \
|
||||
"@OpenVINO_SOURCE_DIR@/docs/template_extension/" \
|
||||
"@OpenVINO_SOURCE_DIR@/docs/template_extension/old/" \
|
||||
"@OpenVINO_SOURCE_DIR@/docs/template_extension/new/" \
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
# How to Implement Custom GPU Operations {#openvino_docs_IE_DG_Extensibility_DG_GPU_Kernel}
|
||||
# How to Implement Custom GPU Operations {#openvino_docs_Extensibility_UG_GPU}
|
||||
|
||||
To enable operations not supported by OpenVINO™ out of the box, you need a custom extension for Model Optimizer, a custom nGraph operation set, and a custom kernel for the device you will target. This page describes custom kernel support for the GPU device.
|
||||
To enable operations not supported by OpenVINO out of the box, you may need an extension for an OpenVINO operation set, and a custom kernel for the device you will target. This page describes custom kernel support for the GPU device.
|
||||
|
||||
The GPU codepath abstracts many details about OpenCL\*. You need to provide the kernel code in OpenCL C and an XML configuration file that connects the kernel and its parameters to the parameters of the operation.
|
||||
The GPU codepath abstracts many details about OpenCL. You need to provide the kernel code in OpenCL C and an XML configuration file that connects the kernel and its parameters to the parameters of the operation.
|
||||
|
||||
There are two options for using the custom operation configuration file:
|
||||
|
||||
* Include a section with your kernels into the global automatically-loaded `cldnn_global_custom_kernels/cldnn_global_custom_kernels.xml` file, which is hosted in the `<INSTALL_DIR>/runtime/bin` folder
|
||||
* Call the `InferenceEngine::Core::SetConfig()` method from your application with the `InferenceEngine::PluginConfigParams::KEY_CONFIG_FILE` key and the configuration file name as a value before loading the network that uses custom operations to the plugin:
|
||||
* Include a section with your kernels into the automatically-loaded `<lib_path>/cldnn_global_custom_kernels/cldnn_global_custom_kernels.xml` file.
|
||||
* Call the `ov::Core::set_property()` method from your application with the `"CONFIG_FILE"` key and the configuration file name as a value before loading the network that uses custom operations to the plugin:
|
||||
|
||||
@snippet snippets/GPU_Kernel.cpp part0
|
||||
@sphinxtabset
|
||||
|
||||
All Inference Engine samples, except the trivial `hello_classification`, and most Open Model Zoo demos
|
||||
@sphinxtab{C++}
|
||||
@snippet docs/snippets/gpu/custom_kernels_api.cpp part0
|
||||
@endsphinxtab
|
||||
|
||||
@sphinxtab{Python}
|
||||
@snippet docs/snippets/gpu/custom_kernels_api.py part0
|
||||
@endsphinxtab
|
||||
|
||||
@endsphinxtabset
|
||||
|
||||
All OpenVINO samples, except the trivial `hello_classification`, and most Open Model Zoo demos
|
||||
feature a dedicated command-line option `-c` to load custom kernels. For example, to load custom operations for the classification sample, run the command below:
|
||||
```sh
|
||||
$ ./classification_sample -m <path_to_model>/bvlc_alexnet_fp16.xml -i ./validation_set/daily/227x227/apron.bmp -d GPU
|
||||
@@ -21,7 +31,7 @@ $ ./classification_sample -m <path_to_model>/bvlc_alexnet_fp16.xml -i ./validati
|
||||
## Configuration File Format <a name="config-file-format"></a>
|
||||
|
||||
The configuration file is expected to follow the `.xml` file structure
|
||||
with a node of the type `CustomLayer` for every custom operation you provide.
|
||||
with a node of the `CustomLayer` type for every custom operation you provide.
|
||||
|
||||
The definitions described in the sections below use the following notations:
|
||||
|
||||
@@ -47,8 +57,7 @@ Notation | Description
|
||||
|
||||
### Kernel Node and Sub-Node Structure
|
||||
|
||||
`Kernel` node contains all kernel source code configuration. No kernel
|
||||
node structure exists.
|
||||
`Kernel` node contains all kernel source code configuration.
|
||||
|
||||
**Sub-nodes**: `Source` (1+), `Define` (0+)
|
||||
|
||||
@@ -134,7 +143,7 @@ queuing an OpenCL program for execution.
|
||||
|
||||
## Example Configuration File
|
||||
|
||||
The following code sample provides an example configuration file in XML
|
||||
The following code sample provides an example configuration file in XML
|
||||
format. For information on the configuration file structure, see
|
||||
[Configuration File Format](#config-file-format).
|
||||
```xml
|
||||
@@ -155,8 +164,7 @@ format. For information on the configuration file structure, see
|
||||
## Built-In Definitions for Custom Layers
|
||||
|
||||
The following table includes definitions that are attached before
|
||||
user sources, where `<TENSOR>` is the actual input and output, for
|
||||
example, `INPUT0` or `OUTPUT0`.
|
||||
user sources.
|
||||
|
||||
For an example, see [Example Kernel](#example-kernel).
|
||||
|
||||
@@ -170,19 +178,20 @@ For an example, see [Example Kernel](#example-kernel).
|
||||
| `<TENSOR>_DIMS`| An array of the tensor dimension sizes. Always ordered as `BFYX` |
|
||||
| `<TENSOR>_DIMS_SIZE`| The size of the `<TENSOR>_DIMS` array.|
|
||||
| `<TENSOR>_TYPE`| The datatype of the tensor: `float`, `half`, or `char`|
|
||||
| `<TENSOR>_FORMAT_` | The format of the tensor, BFYX, BYXF, YXFB , FYXB, or ANY. The format is concatenated to the defined name. You can use the tensor format to define codepaths in your code with `#‍ifdef/#‍endif`. |
|
||||
| `<TENSOR>_FORMAT_<TENSOR_FORMAT>` | The format of the tensor, BFYX, BYXF, YXFB , FYXB, or ANY. The format is concatenated to the defined name. You can use the tensor format to define codepaths in your code with `#‍ifdef/#‍endif`. |
|
||||
| `<TENSOR>_LOWER_PADDING` | An array of padding elements used for the tensor dimensions before they start. Always ordered as BFYX.|
|
||||
| `<TENSOR>_ LOWER_PADDING_SIZE` | The size of the `<TENSOR>_LOWER_PADDING` array |
|
||||
| `<TENSOR>_LOWER_PADDING_SIZE` | The size of the `<TENSOR>_LOWER_PADDING` array |
|
||||
| `<TENSOR>_UPPER_PADDING` | An array of padding elements used for the tensor dimensions after they end. Always ordered as BFYX. |
|
||||
| `<TENSOR>_UPPER_PADDING_SIZE` | The size of the `<TENSOR>_UPPER_PADDING` array |
|
||||
| `<TENSOR>_PITCHES` | The number of elements between adjacent elements in each dimension. Always ordered as BFYX.|
|
||||
| `<TENSOR>_PITCHES` | The offset (in elements) between adjacent elements in each dimension. Always ordered as BFYX.|
|
||||
| `<TENSOR>_PITCHES_SIZE`| The size of the `<TENSOR>_PITCHES` array |
|
||||
| `<TENSOR>_OFFSET`| The number of elements from the start of the tensor to the first valid element, bypassing the lower padding. |
|
||||
|
||||
All `<TENSOR>` values are automatically defined for every tensor
|
||||
bound to this operation, such as `INPUT0`, `INPUT1`, and `OUTPUT0`, as shown
|
||||
in the following example:
|
||||
|
||||
```sh
|
||||
```c
|
||||
#define INPUT0_DIMS_SIZE 4
|
||||
#define INPUT0_DIMS (int []){ 1,96,55,55, }
|
||||
```
|
||||
@@ -197,28 +206,25 @@ __kernel void example_relu_kernel(
|
||||
{
|
||||
const uint idx = get_global_id(0);
|
||||
const uint idy = get_global_id(1);
|
||||
const uint idbf = get_global_id(2);//batches*features, as OpenCL supports 3D nd-ranges only
|
||||
const uint feature = idbf%OUTPUT0_DIMS[1];
|
||||
const uint batch = idbf/OUTPUT0_DIMS[1];
|
||||
const uint idbf = get_global_id(2); // batches*features, as OpenCL supports 3D nd-ranges only
|
||||
const uint feature = idbf % OUTPUT0_DIMS[1];
|
||||
const uint batch = idbf / OUTPUT0_DIMS[1];
|
||||
//notice that pitches are in elements, not in bytes!
|
||||
const uint in_id = batch*INPUT0_PITCHES[0] + feature*INPUT0_PITCHES[1] + idy*INPUT0_PITCHES[2] + idx*INPUT0_PITCHES[3] + INPUT0_OFFSET;
|
||||
const uint out_id = batch*OUTPUT0_PITCHES[0] + feature*OUTPUT0_PITCHES[1] + idy*OUTPUT0_PITCHES[2] + idx*OUTPUT0_PITCHES[3] + OUTPUT0_OFFSET;
|
||||
|
||||
INPUT0_TYPE value = input0[in_id];
|
||||
//neg_slope (which is non-zero for leaky ReLU) is put automatically as #define, refer to the config xml
|
||||
// neg_slope (which is non-zero for leaky ReLU) is put automatically as #define, refer to the config xml
|
||||
output[out_id] = value < 0 ? value * neg_slope : value;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
> **NOTE**: As described in the previous section, all items like
|
||||
> `INPUT0_TYPE` are actually defined as OpenCL (pre-)compiler inputs by
|
||||
> the Inference Engine for efficiency reasons. See [Debugging
|
||||
> OpenVINO for efficiency reasons. See [Debugging
|
||||
> Tips](#debugging-tips) for information on debugging the results.
|
||||
|
||||
> **NOTE**: Several GPU-targeted kernels are also added to the binaries upon compilation of samples
|
||||
> so that the sample application can easy load them.
|
||||
> Refer to the `cldnn_global_custom_kernels` folder in the GPU plugin installation directory.
|
||||
|
||||
## Debugging Tips<a name="debugging-tips"></a>
|
||||
|
||||
* **Using `printf` in the OpenCL™ Kernels**.
|
||||
171
docs/Extensibility_UG/Intro.md
Normal file
171
docs/Extensibility_UG/Intro.md
Normal file
@@ -0,0 +1,171 @@
|
||||
# OpenVINO Extensibility Mechanism {#openvino_docs_Extensibility_UG_Intro}
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_Extensibility_UG_add_openvino_ops
|
||||
openvino_docs_Extensibility_UG_Frontend_Extensions
|
||||
openvino_docs_Extensibility_UG_GPU
|
||||
openvino_docs_IE_DG_Extensibility_DG_VPU_Kernel
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
The Intel® Distribution of OpenVINO™ toolkit supports neural network models trained with various frameworks, including
|
||||
TensorFlow, PyTorch, ONNX, PaddlePaddle, MXNet, Caffe, and Kaldi. The list of supported operations is different for
|
||||
each of the supported frameworks. To see the operations supported by your framework, refer to
|
||||
[Supported Framework Operations](../MO_DG/prepare_model/Supported_Frameworks_Layers.md).
|
||||
|
||||
Custom operations, that is those not included in the list, are not recognized by OpenVINO™ out-of-the-box. The need for a custom operation may appear in two main cases:
|
||||
|
||||
1. A regular framework operation that is new or rarely used, which is why it hasn’t been implemented in OpenVINO yet.
|
||||
|
||||
2. A new user operation that was created for some specific model topology by a model author using framework extension capabilities.
|
||||
|
||||
Importing models with such operations requires additional steps. This guide illustrates the workflow for running inference on models featuring custom operations, allowing you to plug in your own implementation for them. OpenVINO™ Extensibility API lets you add support for those custom operations and use one implementation for Model Optimizer and OpenVINO™ Runtime.
|
||||
|
||||
Defining a new custom operation basically consist of two parts:
|
||||
|
||||
1. Definition of operation semantics in OpenVINO, the code that describes how this operation should be inferred consuming input tensor(s) and producing output tensor(s). How to implement execution kernels for [GPU](./GPU_Extensibility.md) and [VPU](./VPU_Extensibility.md) is described in separate guides.
|
||||
|
||||
2. Mapping rule that facilitates conversion of framework operation representation to OpenVINO defined operation semantics.
|
||||
|
||||
The first part is required for inference, the second part is required for successful import of a model containing such operations from the original framework model format. There are several options to implement each part, the next sections will describe them in detail.
|
||||
|
||||
## Definition of Operation Semantics
|
||||
|
||||
|
||||
If the custom operation can be mathematically represented as a combination of exiting OpenVINO operations and such decomposition gives desired performance, then low-level operation implementation is not required. When deciding feasibility of such decomposition refer to the latest OpenVINO operation set. You can use any valid combination of exiting operations. How to map a custom operation is described in the next section of this document.
|
||||
|
||||
If such decomposition is not possible or appears too bulky with lots of consisting operations that are not performing well, then a new class for the custom operation should be implemented as described in the [Custom Operation Guide](add_openvino_ops.md).
|
||||
|
||||
Prefer implementing a custom operation class if you already have a generic C++ implementation of operation kernel. Otherwise try to decompose the operation first as described above and then after verifying correctness of inference and resulting performance, optionally invest to implementing bare metal C++ implementation.
|
||||
|
||||
## Mapping from Framework Operation
|
||||
|
||||
Depending on model format used for import, mapping of custom operation is implemented differently, choose one of:
|
||||
|
||||
1. If model is represented in ONNX (including models exported from Pytorch in ONNX) or PaddlePaddle formats, then one of the classes from [Frontend Extension API](frontend_extensions.md) should be used. It consists of several classes available in C++ which can be used with Model Optimizer `--extensions` option or when model is imported directly to OpenVINO run-time using read_model method. Python API is also available for run-time model importing.
|
||||
|
||||
2. If model is represented in TensorFlow, Caffe, Kaldi or MXNet formats, then [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) should be used. This approach is available for model conversion in Model Optimizer only.
|
||||
|
||||
Existing of two approaches simultaneously is explained by two different types of frontends used for model conversion in OpenVINO: new frontends (ONNX, PaddlePaddle) and legacy frontends (TensorFlow, Caffe, Kaldi and MXNet). Model Optimizer can use both front-ends in contrast to the direct import of model with `read_model` method which can use new frontends only. Follow one of the appropriate guides referenced above to implement mappings depending on framework frontend.
|
||||
|
||||
If you are implementing extensions for ONNX or PaddlePaddle new frontends and plan to use Model Optimizer `--extension` option for model conversion, then the extensions should be
|
||||
|
||||
1. Implemented in C++ only
|
||||
|
||||
2. Compiled as a separate shared library (see details how to do that later in this guide).
|
||||
|
||||
You cannot write new frontend extensions using Python API if you plan to use them with Model Optimizer.
|
||||
|
||||
Remaining part of this guide uses Frontend Extension API applicable for new frontends.
|
||||
|
||||
## Registering Extensions
|
||||
|
||||
A custom operation class and a new mapping frontend extension class object should be registered to be usable in OpenVINO runtime.
|
||||
|
||||
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
|
||||
|
||||
To load the extensions to the `ov::Core` object, use the `ov::Core::add_extension` method, this method allows to load library with extensions or extensions from the code.
|
||||
|
||||
### Load extensions to core
|
||||
|
||||
Extensions can be loaded from code with `ov::Core::add_extension` method:
|
||||
|
||||
@sphinxtabset
|
||||
|
||||
@sphinxtab{C++}
|
||||
|
||||
@snippet docs/snippets/ov_extensions.cpp add_extension
|
||||
|
||||
@endsphinxtab
|
||||
|
||||
@sphinxtab{Python}
|
||||
|
||||
@snippet docs/snippets/ov_extensions.py add_extension
|
||||
|
||||
@endsphinxtab
|
||||
|
||||
@endsphinxtabset
|
||||
|
||||
`Identity` is custom operation class defined in [Custom Operation Guide](add_openvino_ops.md). This is enough to enable reading IR which uses `Identity` extension operation emitted by Model Optimizer. To be able to load original model directly to the runtime, you need to add also a mapping extension:
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
.. tab:: C++
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
|
||||
:language: cpp
|
||||
:fragment: add_frontend_extension
|
||||
|
||||
.. tab:: Python
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_extensions.py
|
||||
:language: python
|
||||
:fragment: add_frontend_extension
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
When Python API is used there is no way to implement a custom OpenVINO operation. Also, even if custom OpenVINO operation is implemented in C++ and loaded to the runtime through a shared library, there is still no way to add a frontend mapping extension that refers to this custom operation. Use C++ shared library approach to implement both operations semantics and framework mapping in this case.
|
||||
|
||||
You still can use Python for operation mapping and decomposition in case if operations from the standard OpenVINO operation set is used only.
|
||||
|
||||
### Create library with extensions
|
||||
|
||||
You need to create extension library in the following cases:
|
||||
- Convert model with custom operations in Model Optimizer
|
||||
- Load model with custom operations in Python application. It is applicable for both framework model and IR.
|
||||
- Loading models with custom operations in tools that support loading extensions from a library, for example `benchmark_app`.
|
||||
|
||||
If you want to create an extension library, for example in order to load these extensions to the Model Optimizer, you need to do next steps:
|
||||
Create an entry point for extension library. OpenVINO™ provides an `OPENVINO_CREATE_EXTENSIONS()` macro, which allows to define an entry point to a library with OpenVINO™ Extensions.
|
||||
This macro should have a vector of all OpenVINO™ Extensions as an argument.
|
||||
|
||||
Based on that, the declaration of an extension class can look as follows:
|
||||
|
||||
@snippet template_extension/new/ov_extension.cpp ov_extension:entry_point
|
||||
|
||||
To configure the build of your extension library, use the following CMake script:
|
||||
|
||||
@snippet template_extension/new/CMakeLists.txt cmake:extension
|
||||
|
||||
This CMake script finds the OpenVINO™ using the `find_package` CMake command.
|
||||
|
||||
To build the extension library, run the commands below:
|
||||
|
||||
```sh
|
||||
$ cd docs/template_extension/new
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake -DOpenVINO_DIR=<OpenVINO_DIR> ../
|
||||
$ cmake --build .
|
||||
```
|
||||
|
||||
After the build you can use path to your extension library to load your extensions to OpenVINO™ Runtime:
|
||||
|
||||
@sphinxtabset
|
||||
|
||||
@sphinxtab{C++}
|
||||
|
||||
@snippet docs/snippets/ov_extensions.cpp add_extension_lib
|
||||
|
||||
@endsphinxtab
|
||||
|
||||
@sphinxtab{Python}
|
||||
|
||||
@snippet docs/snippets/ov_extensions.py add_extension_lib
|
||||
|
||||
@endsphinxtab
|
||||
|
||||
@endsphinxtabset
|
||||
|
||||
## See Also
|
||||
|
||||
* [OpenVINO Transformations](./ov_transformations.md)
|
||||
* [Using OpenVINO Runtime Samples](../OV_Runtime_UG/Samples_Overview.md)
|
||||
* [Hello Shape Infer SSD sample](../../samples/cpp/hello_reshape_ssd/README.md)
|
||||
|
||||
@@ -5,28 +5,25 @@ To enable operations not supported by OpenVINO™ out of the box, you need a cus
|
||||
> **NOTES:**
|
||||
> * OpenCL\* custom layer support is available in the preview mode.
|
||||
> * This section assumes you are familiar with developing kernels using OpenCL.
|
||||
|
||||
To customize your topology with an OpenCL layer, carry out the tasks described on this page:
|
||||
|
||||
1. Write and compile your OpenCL code with the standalone offline OpenCL compiler (`clc`).
|
||||
2. Write a configuration file to bind the OpenCL kernel to the topology file (`.xml`) of the model IR.
|
||||
3. Pass the configuration file to the Inference Engine with the model IR.
|
||||
3. Pass the configuration file to the OpenVINO™ Runtime with the model IR.
|
||||
|
||||
## Compile OpenCL code for VPU (Intel® Neural Compute Stick 2)
|
||||
|
||||
> **NOTE**: OpenCL compiler, targeting Intel® Neural Compute Stick 2 for the SHAVE* processor only, is redistributed with OpenVINO.
|
||||
OpenCL support is provided by ComputeAorta* and is distributed under a license agreement between Intel® and Codeplay* Software Ltd.
|
||||
|
||||
The OpenCL toolchain for the Intel® Neural Compute Stick 2 supports offline compilation only, so first compile OpenCL C code using the standalone `clc` compiler. You can find the compiler binary at `<INSTALL_DIR>/tools/cl_compiler`.
|
||||
|
||||
> **NOTE**: By design, custom OpenCL layers support any OpenCL kernels written assuming OpenCL version 1.2. It also supports half float extension and is optimized for this type, because it is a native type for Intel® Movidius™ VPUs.
|
||||
|
||||
1. Prior to running a compilation, make sure that the following variables are set:
|
||||
* `SHAVE_MA2X8XLIBS_DIR=<INSTALL_DIR>/tools/cl_compiler/lib/`
|
||||
* `SHAVE_LDSCRIPT_DIR=<INSTALL_DIR>/tools/cl_compiler/ldscripts/`
|
||||
* `SHAVE_MYRIAD_LD_DIR=<INSTALL_DIR>/tools/cl_compiler/bin/`
|
||||
* `SHAVE_MOVIASM_DIR=<INSTALL_DIR>/tools/cl_compiler/bin/`
|
||||
2. Run the compilation with the command below. You should use `--strip-binary-header` to make an OpenCL runtime-agnostic binary runnable with the Inference Engine.
|
||||
2. Run the compilation with the command below. You should use `--strip-binary-header` to make an OpenCL runtime-agnostic binary runnable with the OpenVINO™ Runtime.
|
||||
```bash
|
||||
cd <INSTALL_DIR>/tools/cl_compiler/bin
|
||||
./clc --strip-binary-header custom_layer.cl -o custom_layer.bin
|
||||
@@ -34,7 +31,7 @@ The OpenCL toolchain for the Intel® Neural Compute Stick 2 supports offline com
|
||||
|
||||
## Write a Configuration File
|
||||
|
||||
To tie the topology IR for a layer you customize, prepare a configuration file, so that the Inference Engine can find parameters for your kernel and the execution work grid is described.
|
||||
To tie the topology IR for a layer you customize, prepare a configuration file, so that the OpenVINO™ Runtime can find parameters for your kernel and the execution work grid is described.
|
||||
For example, consider the following OpenCL kernel signature:
|
||||
```cpp
|
||||
__kernel void reorg_nhwc(__global const half *src, __global half *out, int w, int h, int c, int stride);
|
||||
@@ -58,7 +55,7 @@ A configuration file for this kernel might be the following:
|
||||
```
|
||||
Each custom layer is described with the `CustomLayer` node. It has the following nodes and attributes:
|
||||
- Root node `CustomLayer` contains the following attributes:
|
||||
- `name` – (Required) The name of the Inference Engine layer to bind the kernel with.
|
||||
- `name` – (Required) The name of the OpenVINO™ Runtime layer to bind the kernel with.
|
||||
- `type` and `version` – (Required) Reserved for future use. Set them to `MVCL` and `1` respectively.
|
||||
- `max-shaves` – (Optional) The maximum number of SHAVE cores that should be dedicated for the layer. It is useful for debugging concurrency issues or for resource saving that memory bound kernel does not scale well with the number of cores, so more resources can be left for the rest of a topology.
|
||||
- Sub-node `Kernel` must contain the following attributes:
|
||||
@@ -158,25 +155,12 @@ Each custom layer is described with the `CustomLayer` node. It has the following
|
||||
</CustomLayer>
|
||||
```
|
||||
|
||||
## Pass Configuration File to Inference Runtime
|
||||
## Pass Configuration File to OpenVINO™ Runtime
|
||||
|
||||
> **NOTE**: If both native and custom layer implementations are present, the custom kernel has a priority over the native one.
|
||||
Before loading the network that features the custom layers, provide a separate configuration file and load it using the ov::Core::set_property() method with the "CONFIG_KEY" key and the configuration file name as a value before loading the network that uses custom operations to the plugin:
|
||||
|
||||
Before loading the network that features the custom layers, provide a separate configuration file and load it using the InferenceEngine::Core::SetConfig() method with the PluginConfigParams::KEY_CONFIG_FILE key and the configuration file name as a value:
|
||||
```cpp
|
||||
InferenceEngine::Core core;
|
||||
// Load custom layers
|
||||
core.SetConfig({ { InferenceEngine::PluginConfigParams::KEY_CONFIG_FILE, "<path to the xml file>" } }, "MYRIAD");
|
||||
```
|
||||
Optionally, set a path to a custom layers description with a pair of `VPU_CUSTOM_LAYERS` and `/path/to/your/customLayers.xml`
|
||||
as a network configuration:
|
||||
```cpp
|
||||
InferenceEngine::Core core;
|
||||
std::map<std::string, std::string> networkConfig;
|
||||
config["VPU_CUSTOM_LAYERS"] = "/path/to/your/customLayers.xml";
|
||||
// Load custom layers in network config
|
||||
auto exeNetwork = core.LoadNetwork(cnnNetwork, "MYRIAD", networkConfig);
|
||||
```
|
||||
@snippet docs/snippets/vpu/custom_op.cpp part0
|
||||
|
||||
## Optimizing Kernels with OpenCL for VPU (Intel® Neural Compute Stick 2)
|
||||
|
||||
@@ -233,15 +217,11 @@ __kernel void ocl_grn(__global const half* restrict src_data, __global half* res
|
||||
int W = get_global_size(0);
|
||||
int y = get_global_id(1);
|
||||
int H = get_global_size(1);
|
||||
|
||||
float variance = bias + 1e-9f;
|
||||
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
variance += (float)(src_data[c*H*W + y*W + x] * src_data[c*H*W + y*W + x]);
|
||||
|
||||
variance = 1.f / native_sqrt(variance);
|
||||
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
dst_data[c*H*W + y*W + x] = (half)((float)src_data[c*H*W + y*W + x] * variance);
|
||||
@@ -253,11 +233,9 @@ __kernel void ocl_grn_line(__global const half* restrict src_data, __global hal
|
||||
{
|
||||
int y = get_global_id(1);
|
||||
int H = get_global_size(1);
|
||||
|
||||
for (int x = 0; x < W/8; x++)
|
||||
{
|
||||
float8 variance = (float8)(bias+1e-9f);
|
||||
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
{
|
||||
@@ -265,15 +243,12 @@ __kernel void ocl_grn_line(__global const half* restrict src_data, __global hal
|
||||
half8 sh = src_line[x];
|
||||
variance += convert_float8(sh*sh);
|
||||
}
|
||||
|
||||
variance = 1.f/native_sqrt(variance);
|
||||
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
{
|
||||
__global const half8* restrict src_line = ((__global const half8 * restrict)(src_data + c*H*W + y*W));
|
||||
__global half8* restrict dst_line = ((__global half8 * restrict)(dst_data + c*H*W + y*W));
|
||||
|
||||
dst_line[x] = convert_half8(convert_float8(src_line[x])*variance);
|
||||
}
|
||||
}
|
||||
@@ -283,9 +258,7 @@ __kernel void ocl_grn_line(__global const half* restrict src_data, __global hal
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
variance += (float)(src_data[c*H*W + y*W + x]*src_data[c*H*W + y*W + x]);
|
||||
|
||||
variance = 1.f/native_sqrt(variance);
|
||||
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
dst_data[c*H*W + y*W + x] = (float)src_data[c*H*W + y*W + x]*variance;
|
||||
@@ -314,23 +287,17 @@ The kernel example below demonstrates the impact of early exits on kernel perfor
|
||||
{
|
||||
int w = get_global_id(0);
|
||||
int W = get_global_size(0);
|
||||
|
||||
int h = get_global_id(1);
|
||||
int H = get_global_size(1);
|
||||
|
||||
int c = get_global_id(2);
|
||||
int C = get_global_size(2);
|
||||
|
||||
int C2 = C/(stride*stride);
|
||||
int offset = c / C2;
|
||||
int c2 = c - C2 * offset;
|
||||
|
||||
int H2 = H*stride;
|
||||
int W2 = W*stride;
|
||||
|
||||
int h2 = h*stride + offset / stride;
|
||||
int w2 = w*stride + offset - stride * (offset / stride);
|
||||
|
||||
out[W*H*c + W*h + w] = src[W2*H2*c2 + W2*h2 + w2];
|
||||
}
|
||||
```
|
||||
@@ -343,23 +310,17 @@ Since the auto-vectorized version is faster, it makes sense to enable it for the
|
||||
{
|
||||
int w = get_global_id(0);
|
||||
w = min(w, W-1);
|
||||
|
||||
int h = get_global_id(1);
|
||||
int H = get_global_size(1);
|
||||
|
||||
int c = get_global_id(2);
|
||||
int C = get_global_size(2);
|
||||
|
||||
int C2 = C/(stride*stride);
|
||||
int offset = c / C2;
|
||||
int c2 = c - C2 * offset;
|
||||
|
||||
int H2 = H*stride;
|
||||
int W2 = W*stride;
|
||||
|
||||
int h2 = h*stride + offset / stride;
|
||||
int w2 = w*stride + offset - stride * (offset / stride);
|
||||
|
||||
out[W*H*c + W*h + w] = src[W2*H2*c2 + W2*h2 + w2];
|
||||
}
|
||||
```
|
||||
@@ -370,21 +331,17 @@ If branching is inevitable for your element-based kernel, it is recommended to c
|
||||
__kernel void reorg(const __global half* restrict src, __global half* restrict out, int H, int W, int stride)
|
||||
{
|
||||
int h = min((int)get_global_id(0), H-1);
|
||||
|
||||
int c = get_global_id(1);
|
||||
int C = get_global_size(1);
|
||||
int C2 = C/(stride*stride);
|
||||
int offset = c / C2;
|
||||
int c2 = c - C2 * offset;
|
||||
|
||||
int H2 = H*stride;
|
||||
int W2 = W*stride;
|
||||
|
||||
for (int w = 0; w < W; ++w)
|
||||
{
|
||||
int h2 = h*stride + offset / stride;
|
||||
int w2 = w*stride + offset - stride * (offset / stride);
|
||||
|
||||
out[W*H*c + W*h + w] = src[W2*H2*c2 + W2*h2 + w2];
|
||||
}
|
||||
}
|
||||
@@ -398,14 +355,11 @@ This decreases the execution time up to 40% against the best performing vectoriz
|
||||
int H, int W, int stride)
|
||||
{
|
||||
int h = min((int)get_global_id(0), H-1);
|
||||
|
||||
int c2 = get_global_id(1);
|
||||
int C2 = get_global_size(1);
|
||||
int C = C2*stride*stride;
|
||||
|
||||
int H2 = H*stride;
|
||||
int W2 = W*stride;
|
||||
|
||||
for (int stride_y = 0; stride_y < stride; stride_y++)
|
||||
for (int stride_x = 0; stride_x < stride; stride_x++)
|
||||
for (int w2 = 0, w = 0; w < W; w2 += stride, w++)
|
||||
@@ -428,16 +382,13 @@ from/to a `__blobal` pointer since work-group copying could be done in a vector
|
||||
float bias)
|
||||
{
|
||||
float variance = bias + 1e-9f;
|
||||
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
{
|
||||
float val = (float) src_data[c*get_global_size(1)*get_global_size(0) + get_global_id(1)*get_global_size(0) + get_global_id(0)];
|
||||
variance += val*val;
|
||||
}
|
||||
|
||||
half hvariance = (half)(native_rsqrt((half)(variance/16.f))*0.25f);
|
||||
|
||||
#pragma unroll 4
|
||||
for (int c = 0; c < C; c++)
|
||||
{
|
||||
@@ -446,7 +397,7 @@ from/to a `__blobal` pointer since work-group copying could be done in a vector
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
This kernel can be rewritten to introduce special data binding `__dma_preload` and `__dma_postwrite intrinsics`. This means that instead of one kernel, a group of three kernels should be implemented: `kernelName`, `__dma_preload_kernelName`, and `__dma_postwrite_kernelName`. `__dma_preload_kernelName` for a particular work group `n` is guaranteed to be executed before the `n`-th work group itself, while `__dma_postwrite_kernelName` is guaranteed to be executed after a corresponding work group. You can define one of those functions that are intended to be used to copy data from-to `__global` and `__local` memory. The syntactics requires exact functional signature match. The example below illustrates how to prepare your kernel for manual-DMA.
|
||||
|
||||
```cpp
|
||||
@@ -498,8 +449,6 @@ event_t WorkGroupDmaCreateStrideTransaction(
|
||||
size_t dst_stride, // stride between corresponding 2 consecutive lines of destination in bytes
|
||||
size_t size, // total number of bytes loaded for all lines from source to destination
|
||||
event_t event) __OVERLOAD;
|
||||
|
||||
|
||||
event_t WorkGroupDmaCreateStrideTransaction(
|
||||
const global T *src,
|
||||
local T *dst,
|
||||
@@ -509,7 +458,6 @@ event_t WorkGroupDmaCreateStrideTransaction(
|
||||
size_t dst_stride, // stride between corresponding 2 consecutive lines of destination in bytes
|
||||
size_t size, // total number of bytes loaded for all lines from source to destination
|
||||
event_t event) __OVERLOAD;
|
||||
|
||||
// 3D sub-tensor copy
|
||||
event_t WorkGroupDmaCreate3DTransaction(
|
||||
const local T *src,
|
||||
@@ -523,7 +471,6 @@ event_t WorkGroupDmaCreate3DTransaction(
|
||||
size_t dst_plane_stride, // stride between corresponding 2 consecutive planes of destination in bytes
|
||||
size_t size, // size of the loaded plane in bytes, analogues to the size in 2D case
|
||||
event_t event) __OVERLOAD;
|
||||
|
||||
event_t WorkGroupDmaCreate3DTransaction(
|
||||
const global T *src,
|
||||
local T *dst,
|
||||
@@ -563,7 +510,6 @@ __kernel void __dma_preload_grn_NCHW(
|
||||
get_local_size(0) * get_local_size(1) * sizeof(half), // plane size
|
||||
0);
|
||||
}
|
||||
|
||||
__kernel void __dma_postwrite_grn_NCHW(
|
||||
__global const half* restrict src,
|
||||
__global half* restrict dst,
|
||||
@@ -586,7 +532,6 @@ __kernel void __dma_postwrite_grn_NCHW(
|
||||
get_local_size(0) * get_local_size(1) * sizeof(half), // plane size
|
||||
0);
|
||||
}
|
||||
|
||||
__kernel void grn_NCHW(
|
||||
__global const half* restrict src_data,
|
||||
__global half* restrict dst_data,
|
||||
@@ -596,16 +541,13 @@ __kernel void grn_NCHW(
|
||||
float bias)
|
||||
{
|
||||
float variance = bias + 1e-9f;
|
||||
|
||||
#pragma unroll 8
|
||||
for (int c = 0; c < C; c++)
|
||||
{
|
||||
float val = (float) src[c*get_local_size(1)*get_local_size(0) + get_local_id(1)*get_local_size(0) + get_local_id(0)];
|
||||
variance += val*val;
|
||||
}
|
||||
|
||||
half hvariance = (half)(native_rsqrt((half)(variance/16.f))*0.25f);
|
||||
|
||||
#pragma unroll 8
|
||||
for (int c = 0; c < C; c++)
|
||||
{
|
||||
@@ -626,13 +568,11 @@ item_dma_event_t WorkItemDmaCreateTransaction(
|
||||
private T *dst,
|
||||
size_t size,
|
||||
item_dma_event_t event) __OVERLOAD;
|
||||
|
||||
item_dma_event_t WorkItemDmaCreateTransaction(
|
||||
const private T *src,
|
||||
global T *dst,
|
||||
size_t size,
|
||||
item_dma_event_t event) __OVERLOAD;
|
||||
|
||||
item_dma_event_t WorkItemDmaCreateStrideTransaction(
|
||||
const global T *src,
|
||||
private T *dst,
|
||||
@@ -642,7 +582,6 @@ item_dma_event_t WorkItemDmaCreateStrideTransaction(
|
||||
size_t dst_stride,
|
||||
size_t size,
|
||||
item_dma_event_t event) __OVERLOAD;
|
||||
|
||||
item_dma_event_t WorkItemDmaCreateStrideTransaction(
|
||||
const private T *src,
|
||||
global T *dst,
|
||||
@@ -652,7 +591,6 @@ item_dma_event_t WorkItemDmaCreateStrideTransaction(
|
||||
size_t dst_stride,
|
||||
size_t size,
|
||||
item_dma_event_t event) __OVERLOAD;
|
||||
|
||||
item_dma_event_t WorkItemDmaCreate3DTransaction(
|
||||
const global T *src,
|
||||
private T *dst,
|
||||
@@ -665,7 +603,6 @@ item_dma_event_t WorkItemDmaCreate3DTransaction(
|
||||
size_t dst_plane_stride,
|
||||
size_t size,
|
||||
item_dma_event_t event) __OVERLOAD;
|
||||
|
||||
item_dma_event_t WorkItemDmaCreate3DTransaction(
|
||||
const private T *src,
|
||||
global T *dst,
|
||||
59
docs/Extensibility_UG/add_openvino_ops.md
Normal file
59
docs/Extensibility_UG/add_openvino_ops.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# Custom OpenVINO™ Operations {#openvino_docs_Extensibility_UG_add_openvino_ops}
|
||||
|
||||
OpenVINO™ Extension API allows you to register custom operations to support models with operations which OpenVINO™ does not support out-of-the-box.
|
||||
|
||||
## Operation Class
|
||||
|
||||
To add your custom operation, create a new class that extends `ov::Op`, which is in turn derived from `ov::Node`, the base class for all graph operations in OpenVINO™. To add `ov::Op` please include next file:
|
||||
|
||||
@snippet template_extension/new/identity.hpp op:common_include
|
||||
|
||||
Follow the steps below to add a custom operation:
|
||||
|
||||
1. Add the `OPENVINO_OP` macro which defines a `NodeTypeInfo` object that identifies the type of the operation to the graph users and helps with dynamic type resolution. The type info of an operation currently consists of a string operation identifier and a string for operation version.
|
||||
|
||||
2. Implement default constructor and constructors that optionally take the operation inputs and attributes as parameters.
|
||||
|
||||
3. Override the shape inference method `validate_and_infer_types`. This method is called multiple times during graph manipulations to determine the shapes and element types of the operations outputs. To access the input shapes and input element types, use the `get_input_partial_shape()` and `get_input_element_type()` methods of `ov::Node`. Set the inferred shape and element type of the output using `set_output_type`.
|
||||
|
||||
4. Override the `clone_with_new_inputs` method, which enables graph manipulation routines to create copies of this operation and connect it to different nodes during optimization.
|
||||
|
||||
5. Override the `visit_attributes` method, which enables serialization and deserialization of operation attributes. An `AttributeVisitor` is passed to the method, and the implementation is expected to walk over all the attributes in the op using the type-aware `on_attribute` helper. Helpers are already implemented for standard C++ types like `int64_t`, `float`, `bool`, `vector`, and for existing OpenVINO defined types.
|
||||
|
||||
6. Override `evaluate`, which is an optional method that enables fallback of some devices to this implementation and the application of constant folding if there is a custom operation on the constant branch. If your operation contains `evaluate` method you also need to override the `has_evaluate` method, this method allows to get information about availability of `evaluate` method for the operation.
|
||||
|
||||
Based on that, declaration of an operation class can look as follows:
|
||||
|
||||
|
||||
### Operation Constructors
|
||||
|
||||
OpenVINO™ operation contains two constructors:
|
||||
* Default constructor, which enables you to create an operation without attributes
|
||||
* Constructor that creates and validates an operation with specified inputs and attributes
|
||||
|
||||
@snippet template_extension/new/identity.cpp op:ctor
|
||||
|
||||
### `validate_and_infer_types()`
|
||||
|
||||
`ov::Node::validate_and_infer_types` method validates operation attributes and calculates output shapes using attributes of the operation.
|
||||
|
||||
@snippet template_extension/new/identity.cpp op:validate
|
||||
|
||||
### `clone_with_new_inputs()`
|
||||
|
||||
`ov::Node::clone_with_new_inputs` method creates a copy of the operation with new inputs.
|
||||
|
||||
@snippet template_extension/new/identity.cpp op:copy
|
||||
|
||||
### `visit_attributes()`
|
||||
|
||||
`ov::Node::visit_attributes` method enables you to visit all operation attributes.
|
||||
|
||||
@snippet template_extension/new/identity.cpp op:visit_attributes
|
||||
|
||||
### evaluate() and has_evaluate()
|
||||
|
||||
`ov::Node::evaluate` method enables you to apply constant folding to an operation.
|
||||
|
||||
@snippet template_extension/new/identity.cpp op:evaluate
|
||||
|
||||
105
docs/Extensibility_UG/frontend_extensions.md
Normal file
105
docs/Extensibility_UG/frontend_extensions.md
Normal file
@@ -0,0 +1,105 @@
|
||||
# Frontend Extensions {#openvino_docs_Extensibility_UG_Frontend_Extensions}
|
||||
|
||||
The goal of this chapter is to explain how to use Frontend extension classes to facilitate mapping of custom operations from framework model representation to OpenVINO representation. Refer to [Introduction to OpenVINO Extension](Intro.md) to understand entire flow.
|
||||
|
||||
This API is applicable for new frontends only, which exist for ONNX and PaddlePaddle. If a different model format is used, follow legacy [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) guide.
|
||||
|
||||
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
|
||||
|
||||
## Single Operation Mapping with OpExtension
|
||||
|
||||
This section covers the case when a single operation in framework representation is mapped to a single operation in OpenVINO representation. This is called *one-to-one mapping*. There is `OpExtension` class that works well if all the following conditions are satisfied:
|
||||
|
||||
1. Number of inputs to operation in the Framework representation is the same as in the OpenVINO representation.
|
||||
|
||||
2. Number of outputs is also the same in both representations.
|
||||
|
||||
3. Inputs can be indexed and are mapped in order correspondingly, e.g. input with index 0 in framework representation maps to input with index 0 in OpenVINO representation and so on.
|
||||
|
||||
4. The same for outputs.
|
||||
|
||||
5. Each attribute in OpenVINO operation can be initialized from one of the attributes of original operation or by some predefined constant value. Value of copied attributes cannot contain expressions, value is accepted as-is, so type of a value should be compatible.
|
||||
|
||||
> **NOTE**: `OpExtension` class is currently available for ONNX frontend only. PaddlePaddle frontend has named inputs and outputs for operation (not indexed) therefore OpExtension mapping is not applicable for this case.
|
||||
|
||||
The next example maps ONNX operation with type [“Identity”]( https://github.com/onnx/onnx/blob/main/docs/Operators.md#Identity) to OpenVINO template extension `Identity` class.
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_Identity_header
|
||||
@snippet ov_extensions.cpp frontend_extension_Identity
|
||||
|
||||
The mapping doesn’t involve any attributes, as operation Identity doesn’t have them.
|
||||
|
||||
Extension objects, like just constructed `extension` can be used to add to the OpenVINO runtime just before the loading a model that contains custom operations:
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_read_model
|
||||
|
||||
Or extensions can be constructed in a separately compiled shared library. Separately compiled library can be used in Model Optimizer or `benchmark_app`. Read about how to build and load such library in chapter “Create library with extensions” in [Introduction to OpenVINO Extension](Intro.md).
|
||||
|
||||
If operation have multiple inputs and/or outputs they will be mapped in order. The type of elements in input/output tensors should match expected types in the surrounding operations. For example, if custom operation produces `f32` data type then operation that consumes this output should also support `f32`. Otherwise, model conversion fails with an error, there are no automatic type conversion happens.
|
||||
|
||||
### Converting to Standard OpenVINO Operation
|
||||
|
||||
`OpExtension` class can be used when mapping to one of the operations from standard OpenVINO operation set is what you need and there is no class like `TemplateExtension::Identity` implemented.
|
||||
|
||||
Here is an example for a custom framework operation “MyRelu”. Suppose it is mathematically equivalent to standard `Relu` that exists in OpenVINO operation set, but for some reason has type name “MyRelu”. In this case you can directly say that “MyRelu” -> `Relu` mapping should be used:
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_MyRelu
|
||||
|
||||
In the resulting converted OpenVINO model, “MyRelu” operation will be replaced by the standard operation `Relu` from the latest available OpenVINO operation set. Notice that when standard operation is used, it can be specified using just a type string (“Relu”) instead of using a `ov::opset8::Relu` class name as a template parameter for `OpExtension`. This method is available for operations from the standard operation set only. For a user custom OpenVINO operation the corresponding class should be always specified as a template parameter as it was demonstrated with `TemplateExtension::Identity`.
|
||||
|
||||
### Attributes Mapping
|
||||
|
||||
As described above, `OpExtension` is useful when attributes can be mapped one by one or initialized by a constant. If the set of attributes in framework representation and OpenVINO representation completely match by their names and types, nothing should be specified in OpExtension constructor parameters. The attributes are discovered and mapped automatically based on `visit_attributes` method that should be defined for any OpenVINO operation.
|
||||
|
||||
Imagine you have CustomOperation class implementation that has two attributes with names `attr1` and `attr2`:
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_CustomOperation
|
||||
|
||||
And original model in framework representation also has operation with name “CustomOperatoin” with the same `attr1` and `attr2` attributes. Then with the following code:
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_CustomOperation_as_is
|
||||
|
||||
both `attr1` and `attr2` are copied from framework representation to OpenVINO representation automatically. If for some reason names of attributes are different but values still can be copied “as-is” you can pass attribute names mapping in `OpExtension` constructor:
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_CustomOperation_rename
|
||||
|
||||
Where `fw_attr1` and `fw_attr2` are names for corresponding attributes in framework operation representation.
|
||||
|
||||
If copying of an attribute is not what you need, `OpExtension` also can set attribute to predefined constant value. For the same `CustomOperation`, imagine you want to set `attr2` to value 5 instead of copying from `fw_attr2`, to achieve that do the following:
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_CustomOperation_rename_set
|
||||
|
||||
So the conclusion is that each attribute of target OpenVINO operation should be initialized either by
|
||||
|
||||
1. Setting automatically due to name matching
|
||||
|
||||
2. Mapped by attribute name
|
||||
|
||||
3. Set to a constant value
|
||||
|
||||
This is achieved by specifying maps as arguments for `OpExtension` constructor.
|
||||
|
||||
|
||||
## Mapping to Multiple Operations with ConversionExtension
|
||||
|
||||
Previous sections cover the case when a single operation is mapped to a single operation with optional adjustment in names and attribute values. That is likely enough for your own custom operation with existing C++ kernel implementation. In this case your framework representation and OpenVINO representation for the operation are under your control and inputs/outpus/attributes can be aligned to make `OpExtension` usable.
|
||||
|
||||
In case if one-to-one mapping is not possible, *decomposition to multiple operations* should be considered. It is achieved by using more verbose and less automated `ConversionExtension` class. It enables writing arbitrary code to replace a single framework operation by multiple connected OpenVINO operations constructing dependency graph of any complexity.
|
||||
|
||||
`ConversionExtension` maps a single operation to a function which builds a graph using OpenVINO operation classes. Follow chapter [Build a Model in OpenVINO Runtime](@ref ov_ug_build_model) to learn how to use OpenVINO operation classes to build a fragment of model for replacement.
|
||||
|
||||
The next example illustrates using `ConversionExtension` for conversion of “ThresholdedRelu” from ONNX according to the formula: `ThresholdedRelu(x, alpha) -> Multiply(x, Convert(Greater(x, alpha), type=float))`.
|
||||
|
||||
> **NOTE**: `ThresholdedRelu` is one of the standard ONNX operators which is supported by ONNX frontend natively out-of-the-box. Here we are re-implementing it to illustrate how you can add a similar support for your custom operation instead of `ThresholdedRelu`.
|
||||
|
||||
@snippet ov_extensions.cpp frontend_extension_ThresholdedReLU_header
|
||||
@snippet ov_extensions.cpp frontend_extension_ThresholdedReLU
|
||||
|
||||
To access original framework operation attribute value and connect to inputs, `node` object of type `NodeContext` is used. It has two main methods:
|
||||
|
||||
* `NodeContext::get_input` to get input with a given index,
|
||||
|
||||
* `NodeContext::get_attribute` to get attribute value with a given name.
|
||||
|
||||
The conversion function should return a vector of node outputs that are mapped to corresponding outputs of the original framework operation in the same order.
|
||||
|
||||
28
docs/Extensibility_UG/graph_rewrite_pass.md
Normal file
28
docs/Extensibility_UG/graph_rewrite_pass.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# OpenVINO Graph Rewrite Pass {#openvino_docs_Extensibility_UG_graph_rewrite_pass}
|
||||
|
||||
`ov::pass::GraphRewrite` serves for running multiple matcher passes on `ov::Model` in a single graph traversal.
|
||||
Example:
|
||||
|
||||
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:graph_rewrite
|
||||
|
||||
In addition, GraphRewrite handles nodes that were registered by MatcherPasses during their execution. This nodes will be added to the beginning of the sequence with nodes for pattern matching.
|
||||
|
||||
> **NOTE**: when using `ov::pass::Manager` temporary GraphRewrite is used to execute single MatcherPass.
|
||||
|
||||
GraphRewrite has two algorithms for MatcherPasses execution. First algorithm is straightforward. It applies each MatcherPass in registration order to current node.
|
||||
|
||||
![graph_rewrite_execution]
|
||||
|
||||
But it is not really efficient when you have a lot of registered passes. So first of all GraphRewrite checks that all MatcherPass patterns has type-based root node (it means that type of this node is not hidden into predicate).
|
||||
And then creates map from registered MatcherPasses. That helps to avoid additional cost of applying each MatcherPass for each node.
|
||||
|
||||
![graph_rewrite_efficient_search]
|
||||
|
||||
> **NOTE**: GraphRewrite execution algorithm cannot be set manually and depends only on root nodes registered inside MatcherPasses.
|
||||
|
||||
## See Also
|
||||
|
||||
* [OpenVINO™ Transformations](./ov_transformations.md)
|
||||
|
||||
[graph_rewrite_execution]: ./img/graph_rewrite_execution.png
|
||||
[graph_rewrite_efficient_search]: ./img/graph_rewrite_efficient_search.png
|
||||
101
docs/Extensibility_UG/matcher_pass.md
Normal file
101
docs/Extensibility_UG/matcher_pass.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# OpenVINO Matcher Pass {#openvino_docs_Extensibility_UG_matcher_pass}
|
||||
|
||||
`ov::pass::MatcherPass` is used for pattern-based transformations.
|
||||
|
||||
Template for MatcherPass transformation class
|
||||
@snippet src/transformations/template_pattern_transformation.hpp graph_rewrite:template_transformation_hpp
|
||||
|
||||
@snippet src/transformations/template_pattern_transformation.cpp graph_rewrite:template_transformation_cpp
|
||||
|
||||
To use `ov::pass::MatcherPass`, you need to complete these steps:
|
||||
1. Create a pattern
|
||||
2. Implement a callback
|
||||
3. Register the pattern and Matcher
|
||||
4. Execute MatcherPass
|
||||
|
||||
So let's go through each of these steps.
|
||||
|
||||
## Create a pattern
|
||||
|
||||
Pattern is a single root `ov::Model`. But the only difference is that you do not need to create a model object, you just need to create and connect opset or special pattern operations.
|
||||
Then you need to take the last created operation and put it as a root of the pattern. This root node will be used as a root node in pattern matching.
|
||||
> **NOTE**: Any nodes in a pattern that have no consumers and are not registered as root will not be used in pattern matching.
|
||||
|
||||
@snippet ov_model_snippets.cpp pattern:simple_example
|
||||
|
||||
The `Parameter` operation in the example above has type and shape specified. These attributes are needed only to create Parameter operation class and will not be used in pattern matching.
|
||||
|
||||
For more pattern examples, refer to the [pattern matching](#pattern_matching) section.
|
||||
|
||||
## Implement callback
|
||||
|
||||
Callback is an action applied to every pattern entrance. In general, callback is the lambda function that takes Matcher object with detected subgraph.
|
||||
|
||||
@snippet ov_model_snippets.cpp pattern:callback_example
|
||||
|
||||
The example above shows the callback structure and how Matcher can be used for accessing nodes detected by pattern.
|
||||
Callback return value is `true` if root node was replaced and another pattern cannot be applied to the same root node; otherwise, it is `false`.
|
||||
> **NOTE**: It is not recommended to manipulate with nodes that are under root node. This may affect GraphRewrite execution as it is expected that all nodes that come after root node in topological order are valid and can be used in pattern matching.
|
||||
|
||||
MatcherPass also provides functionality that allows reporting of the newly created nodes that can be used in additional pattern matching.
|
||||
If MatcherPass was registered in `ov::pass::Manager` or `ov::pass::GraphRewrite`, these registered nodes will be added for additional pattern matching.
|
||||
That means that matcher passes registered in `ov::pass::GraphRewrite` will be applied to these nodes.
|
||||
|
||||
The example below shows how single MatcherPass can fuse sequence of operations using the `register_new_node` method.
|
||||
|
||||
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:relu_fusion
|
||||
|
||||
> **NOTE**: If you register multiple nodes, please add them in topological order. We do not topologically sort these nodes as it is a time-consuming operation.
|
||||
|
||||
## Register pattern and Matcher
|
||||
|
||||
The last step is to register Matcher and callback inside the MatcherPass pass. To do this, call the `register_matcher` method.
|
||||
> **NOTE**: Only one matcher can be registered for a single MatcherPass class.
|
||||
|
||||
```cpp
|
||||
// Register matcher and callback
|
||||
register_matcher(m, callback);
|
||||
```
|
||||
## Execute MatcherPass
|
||||
|
||||
MatcherPass has multiple ways to be executed:
|
||||
* Run on a single node - it can be useful if you want to run MatcherPass inside another transformation.
|
||||
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:run_on_node
|
||||
* Run on `ov::Model` using GraphRewrite - this approach gives ability to run MatcherPass on whole `ov::Model`. Moreover, multiple MatcherPass transformation can be registered in a single GraphRewite to be executed in a single graph traversal.
|
||||
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:graph_rewrite
|
||||
* Run on `ov::Model` using `ov::pass::Manager` - this approach helps you to register MatcherPass for execution on `ov::Model` as another transformation types.
|
||||
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:manager
|
||||
|
||||
## Pattern Matching <a name="pattern_matching"></a>
|
||||
|
||||
Sometimes patterns cannot be expressed via regular operations or it is too complicated.
|
||||
For example, if you want to detect **Convolution->Add** sub-graph without specifying particular input type for Convolution operation or you want to create a pattern where some of operations can have different types.
|
||||
And for these cases OpenVINO™ provides additional helpers to construct patterns for GraphRewrite transformations.
|
||||
|
||||
There are two main helpers:
|
||||
1. `ov::pass::pattern::any_input` - helps to express inputs if their types are undefined.
|
||||
2. `ov::pass::pattern::wrap_type<T>` - helps to express nodes of pattern without specifying node attributes.
|
||||
|
||||
Let's go through the example to have better understanding of how it works:
|
||||
|
||||
> **NOTE**: Node attributes do not participate in pattern matching and are needed only for operations creation. Only operation types participate in pattern matching.
|
||||
|
||||
The example below shows basic usage of `ov::passpattern::any_input`.
|
||||
Here we construct Multiply pattern with arbitrary first input and Constant as a second input.
|
||||
Also as Multiply is commutative operation, it does not matter in which order we set inputs (any_input/Constant or Constant/any_input) because both cases will be matched.
|
||||
|
||||
@snippet ov_model_snippets.cpp pattern:label_example
|
||||
|
||||
This example shows how we can construct a pattern when operation has arbitrary number of inputs.
|
||||
|
||||
@snippet ov_model_snippets.cpp pattern:concat_example
|
||||
|
||||
This example shows how to use predicate to construct a pattern. Also it shows how to match pattern manually on given node.
|
||||
|
||||
@snippet ov_model_snippets.cpp pattern:predicate_example
|
||||
|
||||
> **NOTE**: Be careful with manual matching because Matcher object holds matched nodes. To clear a match, use the m->clear_state() method.
|
||||
|
||||
## See Also
|
||||
|
||||
* [OpenVINO™ Transformations](./ov_transformations.md)
|
||||
17
docs/Extensibility_UG/model_pass.md
Normal file
17
docs/Extensibility_UG/model_pass.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# OpenVINO Model Pass {#openvino_docs_Extensibility_UG_model_pass}
|
||||
|
||||
`ov::pass::ModelPass` is used for transformations that take entire `ov::Model` as an input and process it.
|
||||
|
||||
Template for ModelPass transformation class
|
||||
|
||||
@snippet src/transformations/template_model_transformation.hpp model_pass:template_transformation_hpp
|
||||
|
||||
@snippet src/transformations/template_model_transformation.cpp model_pass:template_transformation_cpp
|
||||
|
||||
Using `ov::pass::ModelPass`, you need to override the `run_on_model` method where you will write the transformation code.
|
||||
Return value is `true` if the original model has changed during transformation (new operation was added, or operations replacement was made, or node attributes were changed); otherwise, it is `false`.
|
||||
Also `ov::pass::ModelPass` based transformations can be executed via `ov::pass::Manager`.
|
||||
|
||||
## See Also
|
||||
|
||||
* [OpenVINO™ Transformations](./ov_transformations.md)
|
||||
173
docs/Extensibility_UG/ov_transformations.md
Normal file
173
docs/Extensibility_UG/ov_transformations.md
Normal file
@@ -0,0 +1,173 @@
|
||||
# Overview of Transformations API {#openvino_docs_transformations}
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_Extensibility_UG_model_pass
|
||||
openvino_docs_Extensibility_UG_matcher_pass
|
||||
openvino_docs_Extensibility_UG_graph_rewrite_pass
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
OpenVINO Transformation mechanism allows to develop transformation passes to modify `ov::Model`. You can use this mechanism to apply additional optimizations to the original Model or transform unsupported subgraphs and operations to new operations which are supported by the plugin.
|
||||
This guide contains all necessary information that you need to start implementing OpenVINO™ transformations.
|
||||
|
||||
## Working with Model
|
||||
|
||||
Before the moving to transformation part it is needed to say several words about functions which allow to modify `ov::Model`.
|
||||
This chapter extends the [model representation guide](../OV_Runtime_UG/model_representation.md) and shows an API that allows us to manipulate with `ov::Model`.
|
||||
|
||||
### Working with node input and output ports
|
||||
|
||||
First of all let's talk about `ov::Node` input/output ports. Each OpenVINO™ operation has input and output ports except cases when operation has `Parameter` or `Constant` type.
|
||||
|
||||
Every port belongs to its node, so using a port we can access parent node, get shape and type for particular input/output, get all consumers in case of output port, and get producer node in case of input port.
|
||||
With output port we can set inputs for newly created operations.
|
||||
|
||||
Lets look at the code example.
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:ports_example
|
||||
|
||||
### Node replacement
|
||||
|
||||
OpenVINO™ provides two ways for node replacement: via OpenVINO™ helper function and directly via port methods. We are going to review both of them.
|
||||
|
||||
Let's start with OpenVINO™ helper functions. The most popular function is `ov::replace_node(old_node, new_node)`.
|
||||
|
||||
We will review real replacement case where Negative operation is replaced with Multiply.
|
||||
|
||||
![ngraph_replace_node]
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:replace_node
|
||||
|
||||
`ov::replace_node` has a constraint that number of output ports for both of ops must be the same; otherwise, it raises an exception.
|
||||
|
||||
|
||||
The alternative way to do the same replacement is the following:
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:manual_replace
|
||||
|
||||
Another transformation example is insertion.
|
||||
|
||||
![ngraph_insert_node]
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:insert_node
|
||||
|
||||
The alternative way to the insert operation is to make a node copy and use `ov::replace_node()`:
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:insert_node_with_copy
|
||||
|
||||
### Node elimination
|
||||
|
||||
Another type of node replacement is its elimination.
|
||||
|
||||
To eliminate operation, OpenVINO™ has special method that considers all limitations related to OpenVINO™ Runtime.
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:eliminate_node
|
||||
|
||||
`ov::replace_output_update_name()` in case of successful replacement it automatically preserves friendly name and runtime info.
|
||||
|
||||
## Transformations types <a name="transformations_types"></a>
|
||||
|
||||
OpenVINO™ Runtime has three main transformation types:
|
||||
|
||||
* [Model pass](./model_pass.md) - straightforward way to work with `ov::Model` directly
|
||||
* [Matcher pass](./matcher_pass.md) - pattern-based transformation approach
|
||||
* [Graph rewrite pass](./graph_rewrite_pass.md) - container for matcher passes needed for efficient execution
|
||||
|
||||
![transformations_structure]
|
||||
|
||||
## Transformation conditional compilation
|
||||
|
||||
Transformation library has two internal macros to support conditional compilation feature.
|
||||
|
||||
* `MATCHER_SCOPE(region)` - allows to disable the MatcherPass if matcher isn't used. The region name should be unique. This macro creates a local variable `matcher_name` which you should use as a matcher name.
|
||||
* `RUN_ON_MODEL_SCOPE(region)` - allows to disable run_on_model pass if it isn't used. The region name should be unique.
|
||||
|
||||
## Transformation writing essentials <a name="transformation_writing_essentials"></a>
|
||||
|
||||
When developing a transformation, you need to follow these transformation rules:
|
||||
|
||||
###1. Friendly Names
|
||||
|
||||
Each `ov::Node` has an unique name and a friendly name. In transformations we care only about friendly name because it represents the name from the model.
|
||||
To avoid losing friendly name when replacing node with other node or subgraph, set the original friendly name to the latest node in replacing subgraph. See the example below.
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:replace_friendly_name
|
||||
|
||||
In more advanced cases, when replaced operation has several outputs and we add additional consumers to its outputs, we make a decision how to set friendly name by arrangement.
|
||||
|
||||
###2. Runtime Info
|
||||
|
||||
Runtime info is a map `std::map<std::string, ov::Any>` located inside `ov::Node` class. It represents additional attributes in `ov::Node`.
|
||||
These attributes can be set by users or by plugins and when executing transformation that changes `ov::Model` we need to preserve these attributes as they will not be automatically propagated.
|
||||
In most cases, transformations have the following types: 1:1 (replace node with another node), 1:N (replace node with a sub-graph), N:1 (fuse sub-graph into a single node), N:M (any other transformation).
|
||||
Currently, there is no mechanism that automatically detects transformation types, so we need to propagate this runtime information manually. See the examples below.
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:copy_runtime_info
|
||||
|
||||
When transformation has multiple fusions or decompositions, `ov::copy_runtime_info` must be called multiple times for each case.
|
||||
|
||||
**Note**: copy_runtime_info removes rt_info from destination nodes. If you want to keep it, you need to specify them in source nodes like this: copy_runtime_info({a, b, c}, {a, b})
|
||||
|
||||
###3. Constant Folding
|
||||
|
||||
If your transformation inserts constant sub-graphs that need to be folded, do not forget to use `ov::pass::ConstantFolding()` after your transformation or call constant folding directly for operation.
|
||||
The example below shows how constant subgraph can be constructed.
|
||||
|
||||
@snippet ov_model_snippets.cpp ov:constant_subgraph
|
||||
|
||||
Manual constant folding is more preferable than `ov::pass::ConstantFolding()` because it is much faster.
|
||||
|
||||
Below you can find an example of manual constant folding:
|
||||
|
||||
@snippet src/transformations/template_pattern_transformation.cpp manual_constant_folding
|
||||
|
||||
## Common mistakes in transformations <a name="common_mistakes"></a>
|
||||
|
||||
In transformation development process:
|
||||
|
||||
* Do not use deprecated OpenVINO™ API. Deprecated methods has the `OPENVINO_DEPRECATED` macros in its definition.
|
||||
* Do not pass `shared_ptr<Node>` as an input for other node if type of node is unknown or it has multiple outputs. Use explicit output port.
|
||||
* If you replace node with another node that produces different shape, remember that new shape will not be propagated until the first `validate_nodes_and_infer_types` call for `ov::Model`. If you are using `ov::pass::Manager`, it will automatically call this method after each transformation execution.
|
||||
* Do not forget to call the `ov::pass::ConstantFolding` pass if your transformation creates constant subgraphs.
|
||||
* Use latest OpSet if you are not developing downgrade transformation pass.
|
||||
* When developing a callback for `ov::pass::MatcherPass`, do not change nodes that come after the root node in topological order.
|
||||
|
||||
## Using pass manager <a name="using_pass_manager"></a>
|
||||
|
||||
`ov::pass::Manager` is a container class that can store the list of transformations and execute them. The main idea of this class is to have high-level representation for grouped list of transformations.
|
||||
It can register and apply any [transformation pass](#transformations_types) on model.
|
||||
In addition, `ov::pass::Manager` has extended debug capabilities (find more information in the [how to debug transformations](#how_to_debug_transformations) section).
|
||||
|
||||
The example below shows basic usage of `ov::pass::Manager`
|
||||
|
||||
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:manager3
|
||||
|
||||
Another example shows how multiple matcher passes can be united into single GraphRewrite.
|
||||
|
||||
@snippet src/transformations/template_pattern_transformation.cpp matcher_pass:manager2
|
||||
|
||||
## How to debug transformations <a name="how_to_debug_transformations"></a>
|
||||
|
||||
If you are using `ngraph::pass::Manager` to run sequence of transformations, you can get additional debug capabilities by using the following environment variables:
|
||||
|
||||
```
|
||||
OV_PROFILE_PASS_ENABLE=1 - enables performance measurement for each transformation and prints execution status
|
||||
OV_ENABLE_VISUALIZE_TRACING=1 - enables visualization after each transformation. By default, it saves dot and svg files.
|
||||
```
|
||||
|
||||
> **Note**: Make sure that you have dot installed on your machine; otherwise, it will silently save only dot file without svg file.
|
||||
|
||||
## See Also
|
||||
|
||||
* [OpenVINO™ Model Representation](../OV_Runtime_UG/model_representation.md)
|
||||
* [OpenVINO™ Extensions](./Intro.md)
|
||||
|
||||
[ngraph_replace_node]: ./img/ngraph_replace_node.png
|
||||
[ngraph_insert_node]: ./img/ngraph_insert_node.png
|
||||
[transformations_structure]: ./img/transformations_structure.png
|
||||
[register_new_node]: ./img/register_new_node.png
|
||||
@@ -1,349 +0,0 @@
|
||||
# Custom Operations Guide {#openvino_docs_HOWTO_Custom_Layers_Guide}
|
||||
|
||||
The Intel® Distribution of OpenVINO™ toolkit supports neural network models trained with multiple frameworks including
|
||||
TensorFlow*, Caffe*, MXNet*, Kaldi* and ONNX* file format. The list of supported operations (layers) is different for
|
||||
each of the supported frameworks. To see the operations supported by your framework, refer to
|
||||
[Supported Framework Layers](../MO_DG/prepare_model/Supported_Frameworks_Layers.md).
|
||||
|
||||
Custom operations, that is those not included in the list, are not recognized by Model Optimizer out-of-the-box. Therefore, creating Intermediate Representation (IR) for a model using them requires additional steps. This guide illustrates the workflow for running inference on topologies featuring custom operations, allowing you to plug in your own implementation for existing or completely new operations.
|
||||
|
||||
> **NOTE**: *Layer* is a legacy term for *operation* which came from Caffe\* framework. Currently it is not used.
|
||||
> Refer to the [Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™](../MO_DG/IR_and_opsets.md)
|
||||
> for more information on the topic.
|
||||
|
||||
## Terms Used in This Guide
|
||||
|
||||
- *Intermediate Representation (IR)* — OpenVINO's Neural Network format used by Inference Engine. It abstracts different frameworks and describs model topology, operations parameters, and weights.
|
||||
|
||||
- *Operation* — an abstract concept of a math function selected for a specific purpose. Operations supported by
|
||||
OpenVINO™ are listed in the supported operation set provided in the [Available Operations Sets](../ops/opset.md).
|
||||
Examples of the operations are: [ReLU](../ops/activation/ReLU_1.md), [Convolution](../ops/convolution/Convolution_1.md),
|
||||
[Add](../ops/arithmetic/Add_1.md), etc.
|
||||
|
||||
- *Kernel* — The implementation of an operation function in the OpenVINO™ plugin, in this case, the math programmed (in
|
||||
C++ and OpenCL) to perform the operation for a target hardware (CPU or GPU).
|
||||
|
||||
- *Inference Engine Extension* — Device-specific module implementing custom operations (a set of kernels).
|
||||
|
||||
## Custom Operation Support Overview
|
||||
|
||||
There are three steps to support inference of a model with custom operation(s):
|
||||
1. Add support for a custom operation in the [Model Optimizer](../MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md) so
|
||||
the Model Optimizer can generate the IR with the operation.
|
||||
2. Create an operation set and implement a custom nGraph operation in it as described in the
|
||||
[Custom nGraph Operation](../OV_Runtime_UG/Extensibility_DG/AddingNGraphOps.md).
|
||||
3. Implement a customer operation in one of the [Inference Engine](../OV_Runtime_UG/Deep_Learning_Inference_Engine_DevGuide.md)
|
||||
plugins to support inference of this operation using a particular target hardware (CPU, GPU or VPU).
|
||||
|
||||
To see the operations that are supported by each device plugin for the Inference Engine, refer to the
|
||||
[Supported Devices](../OV_Runtime_UG/supported_plugins/Supported_Devices.md).
|
||||
|
||||
> **NOTE**: If a device doesn't support a particular operation, an alternative to creating a new operation is to target
|
||||
> an additional device using the HETERO plugin. The [Heterogeneous Plugin](../OV_Runtime_UG/supported_plugins/HETERO.md) may be
|
||||
> used to run an inference model on multiple devices allowing the unsupported operations on one device to "fallback" to
|
||||
> run on another device (e.g., CPU) that does support those operations.
|
||||
|
||||
### Custom Operation Support for the Model Optimizer
|
||||
|
||||
Model Optimizer model conversion pipeline is described in detail in "Model Conversion Pipeline" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md). It is best to read that article first for a better understanding of the following material.
|
||||
|
||||
Model Optimizer provides an extensions mechanism to support new operations and implement custom model transformations to generate optimized IR. This mechanism is described in the "Model Optimizer Extensions" section of
|
||||
[Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md).
|
||||
|
||||
Two types of Model Optimizer extensions should be implemented to support custom operations, at a minimum:
|
||||
1. Operation class for a new operation. This class stores information about the operation, its attributes, shape inference function, attributes to be saved to an IR and some others internally used attributes. Refer to the "Model Optimizer Operation" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for detailed instructions on how to implement it.
|
||||
2. Operation attributes extractor. The extractor is responsible for parsing framework-specific representation of the
|
||||
operation and uses corresponding operation class to update graph node attributes with necessary attributes of the
|
||||
operation. Refer to the "Operation Extractor" section of
|
||||
[Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for detailed instructions on how to implement it.
|
||||
|
||||
> **NOTE**: In some cases you may need to implement some transformation to support the operation. This topic is covered in the "Graph Transformation Extensions" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md).
|
||||
|
||||
## Custom Operations Extensions for the Inference Engine
|
||||
|
||||
Inference Engine provides an extension mechanism to support new operations. This mechanism is described in [Inference Engine Extensibility Mechanism](../OV_Runtime_UG/Extensibility_DG/Intro.md).
|
||||
|
||||
Each device plugin includes a library of optimized implementations to execute known operations which must be extended to execute a custom operation. The custom operation extension is implemented according to the target device:
|
||||
|
||||
- Custom Operation CPU Extension
|
||||
- A compiled shared library (`.so` or `.dll`) needed by the CPU Plugin for executing the custom operation
|
||||
on a CPU. Refer to the [How to Implement Custom CPU Operations](../OV_Runtime_UG/Extensibility_DG/CPU_Kernel.md) for more
|
||||
details.
|
||||
- Custom Operation GPU Extension
|
||||
- OpenCL source code (.cl) for the custom operation kernel that will be compiled to execute on the GPU along with an operation description file (.xml) needed by the GPU Plugin for the custom operation kernel. Refer to the [How to Implement Custom GPU Operations](../OV_Runtime_UG/Extensibility_DG/GPU_Kernel.md) for more details.
|
||||
- Custom Operation VPU Extension
|
||||
- OpenCL source code (.cl) for the custom operation kernel that will be compiled to execute on the VPU along with an operation description file (.xml) needed by the VPU Plugin for the custom operation kernel. Refer to [How to Implement Custom Operations for VPU](../OV_Runtime_UG/Extensibility_DG/VPU_Kernel.md) for more details.
|
||||
|
||||
Also, it is necessary to implement nGraph custom operation according to [Custom nGraph Operation](../OV_Runtime_UG/Extensibility_DG/AddingNGraphOps.md) so the Inference Engine can read an IR with this
|
||||
operation and correctly infer output tensor shape and type.
|
||||
|
||||
## Enabling Magnetic Resonance Image Reconstruction Model
|
||||
This chapter provides step-by-step instructions on how to enable the magnetic resonance image reconstruction model implemented in the [repository](https://github.com/rmsouza01/Hybrid-CS-Model-MRI/) using a custom operation on CPU. The example is prepared for a model generated from the repository with hash `2ede2f96161ce70dcdc922371fe6b6b254aafcc8`.
|
||||
|
||||
### Download and Convert the Model to a Frozen TensorFlow\* Model Format
|
||||
The original pre-trained model is provided in the hdf5 format which is not supported by OpenVINO directly and needs to be converted to TensorFlow\* frozen model format first.
|
||||
|
||||
1. Download repository `https://github.com/rmsouza01/Hybrid-CS-Model-MRI`:<br>
|
||||
```bash
|
||||
git clone https://github.com/rmsouza01/Hybrid-CS-Model-MRI
|
||||
git checkout 2ede2f96161ce70dcdc922371fe6b6b254aafcc8
|
||||
```
|
||||
|
||||
2. Convert pre-trained `.hdf5` to a frozen `.pb` graph using the following script (tested with TensorFlow==1.15.0 and
|
||||
Keras==2.2.4) which should be executed from the root of the cloned repository:<br>
|
||||
```py
|
||||
import keras as K
|
||||
import numpy as np
|
||||
import Modules.frequency_spatial_network as fsnet
|
||||
import tensorflow as tf
|
||||
|
||||
under_rate = '20'
|
||||
|
||||
stats = np.load("Data/stats_fs_unet_norm_" + under_rate + ".npy")
|
||||
var_sampling_mask = np.load("Data/sampling_mask_" + under_rate + "perc.npy")
|
||||
|
||||
model = fsnet.wnet(stats[0], stats[1], stats[2], stats[3], kshape = (5,5), kshape2=(3,3))
|
||||
model_name = "Models/wnet_" + under_rate + ".hdf5"
|
||||
model.load_weights(model_name)
|
||||
|
||||
inp = np.random.standard_normal([1, 256, 256, 2]).astype(np.float32)
|
||||
np.save('inp', inp)
|
||||
|
||||
sess = K.backend.get_session()
|
||||
sess.as_default()
|
||||
graph_def = sess.graph.as_graph_def()
|
||||
graph_def = tf.graph_util.convert_variables_to_constants(sess, graph_def, ['conv2d_44/BiasAdd'])
|
||||
with tf.gfile.FastGFile('wnet_20.pb', 'wb') as f:
|
||||
f.write(graph_def.SerializeToString())
|
||||
```
|
||||
|
||||
As a result the TensorFlow\* frozen model file "wnet_20.pb" is generated.
|
||||
|
||||
### Convert the Frozen TensorFlow\* Model to Intermediate Representation
|
||||
|
||||
Firstly, open the model in TensorBoard or other TensorFlow* model visualization tool. The model supports dynamic
|
||||
batch dimension because the value for the batch dimension is not hardcoded in the model. Model Optimizer need to set all
|
||||
dynamic dimensions to some specific value to create the IR, therefore specify the command line parameter `-b 1` to set
|
||||
the batch dimension equal to 1. The actual batch size dimension can be changed at runtime using the Inference Engine API
|
||||
described in the [Using Shape Inference](../OV_Runtime_UG/ShapeInference.md). Also refer to the General Conversion Parameters section in [Converting a Model to Intermediate Representation (IR)](../MO_DG/prepare_model/convert_model/Converting_Model.md) and [Convert Your TensorFlow* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_TensorFlow.md)
|
||||
for more details and command line parameters used for the model conversion.
|
||||
|
||||
```sh
|
||||
mo --input_model <PATH_TO_MODEL>/wnet_20.pb -b 1
|
||||
```
|
||||
|
||||
> **NOTE**: This conversion guide is applicable for the 2021.3 release of OpenVINO and that starting from 2021.4
|
||||
> the OpenVINO supports this model out of the box.
|
||||
|
||||
Model Optimizer produces the following error:
|
||||
```bash
|
||||
[ ERROR ] List of operations that cannot be converted to Inference Engine IR:
|
||||
[ ERROR ] Complex (1)
|
||||
[ ERROR ] lambda_2/Complex
|
||||
[ ERROR ] IFFT2D (1)
|
||||
[ ERROR ] lambda_2/IFFT2D
|
||||
[ ERROR ] ComplexAbs (1)
|
||||
[ ERROR ] lambda_2/Abs
|
||||
[ ERROR ] Part of the nodes was not converted to IR. Stopped.
|
||||
```
|
||||
|
||||
The error means that the Model Optimizer doesn't know how to handle 3 types of TensorFlow\* operations: "Complex",
|
||||
"IFFT2D" and "ComplexAbs". In order to see more details about the conversion process run the model conversion with
|
||||
additional parameter `--log_level DEBUG`. It is worth to mention the following lines from the detailed output:
|
||||
|
||||
```bash
|
||||
[ INFO ] Called "tf_native_tf_node_infer" for node "lambda_2/Complex"
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ tf:228 ] Added placeholder with name 'lambda_2/lambda_3/strided_slice_port_0_ie_placeholder'
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ tf:228 ] Added placeholder with name 'lambda_2/lambda_4/strided_slice_port_0_ie_placeholder'
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ tf:241 ] update_input_in_pbs: replace input 'lambda_2/lambda_3/strided_slice' with input 'lambda_2/lambda_3/strided_slice_port_0_ie_placeholder'
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ tf:249 ] Replacing input '0' of the node 'lambda_2/Complex' with placeholder 'lambda_2/lambda_3/strided_slice_port_0_ie_placeholder'
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ tf:241 ] update_input_in_pbs: replace input 'lambda_2/lambda_4/strided_slice' with input 'lambda_2/lambda_4/strided_slice_port_0_ie_placeholder'
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ tf:249 ] Replacing input '1' of the node 'lambda_2/Complex' with placeholder 'lambda_2/lambda_4/strided_slice_port_0_ie_placeholder'
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ tf:148 ] Inferred shape of the output tensor with index '0' of the node 'lambda_2/Complex': '[ 1 256 256]'
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ infer:145 ] Outputs:
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ infer:32 ] output[0]: shape = [ 1 256 256], value = <UNKNOWN>
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ infer:129 ] --------------------
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ infer:130 ] Partial infer for lambda_2/IFFT2D
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ infer:131 ] Op: IFFT2D
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ infer:132 ] Inputs:
|
||||
[ <TIMESTAMP> ] [ DEBUG ] [ infer:32 ] input[0]: shape = [ 1 256 256], value = <UNKNOWN>
|
||||
```
|
||||
|
||||
This is a part of the log of the partial inference phase of the model conversion. See the "Partial Inference" section on
|
||||
the [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for
|
||||
more information about this phase. Model Optimizer inferred output shape for the unknown operation of type "Complex"
|
||||
using a "fallback" to TensorFlow\*. However, it is not enough to generate the IR because Model Optimizer doesn't know
|
||||
which attributes of the operation should be saved to IR. So it is necessary to implement Model Optimizer extensions to
|
||||
support these operations.
|
||||
|
||||
Before going into the extension development it is necessary to understand what these unsupported operations do according
|
||||
to the TensorFlow\* framework specification.
|
||||
|
||||
* "Complex" - returns a tensor of complex type constructed from two real input tensors specifying real and imaginary
|
||||
part of a complex number.
|
||||
* "IFFT2D" - returns a tensor with inverse 2-dimensional discrete Fourier transform over the inner-most 2 dimensions of
|
||||
an input.
|
||||
* "ComplexAbs" - returns a tensor with absolute values of input tensor with complex numbers.
|
||||
|
||||
The part of the model with all three unsupported operations is depicted below:
|
||||
|
||||

|
||||
|
||||
This model uses complex numbers during the inference but Inference Engine does not support tensors of this data type. So
|
||||
it is necessary to find a way how to avoid using tensors of such a type in the model. Fortunately, the complex tensor
|
||||
appear as a result of "Complex" operation, is used as input in the "IFFT2D" operation then is passed to "ComplexAbs"
|
||||
which produces real value tensor as output. So there are just 3 operations consuming/producing complex tensors in the
|
||||
model.
|
||||
|
||||
Let's design an OpenVINO operation "FFT" which get a single real number tensor describing the complex number and
|
||||
produces a single real number tensor describing output complex tensor. This way the fact that the model uses complex
|
||||
numbers is hidden inside the "FFT" operation implementation. The operation gets a tensor of shape `[N, H, W, 2]` and
|
||||
produces the output tensor with the same shape, where the innermost dimension contains pairs of real numbers describing
|
||||
the complex number (its real and imaginary part). As we will see further this operation will allow us to support the
|
||||
model. The implementation of the Model Optimizer operation should be saved to `mo_extensions/ops/FFT.py` file:
|
||||
|
||||
@snippet FFT.py fft:operation
|
||||
|
||||
The attribute `inverse` is a flag specifying type of the FFT to apply: forward or inverse.
|
||||
|
||||
See the "Model Optimizer Operation" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for detailed instructions on how to implement the operation.
|
||||
|
||||
Now it is necessary to implement extractor for the "IFFT2D" operation according to the
|
||||
"Operation Extractor" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md). The
|
||||
following snippet provides two extractors: one for "IFFT2D", another one for "FFT2D", however only on of them is used in this example. The implementation should be saved to the file `mo_extensions/front/tf/FFT_ext.py`.
|
||||
|
||||
@snippet FFT_ext.py fft_ext:extractor
|
||||
|
||||
> **NOTE**: The graph is in inconsistent state after extracting node attributes because according to original operation
|
||||
> "IFFT2D" semantic it should have an input consuming a tensor of complex numbers, but the extractor instantiated an
|
||||
> operation "FFT" which expects a real tensor with specific layout. But the inconsistency will be resolved during
|
||||
> applying front phase transformations discussed below.
|
||||
|
||||
The output shape of the operation "AddV2" from the picture above is `[N, H, W, 2]`. Where the innermost dimension
|
||||
contains pairs of real numbers describing the complex number (its real and imaginary part). The following "StridedSlice"
|
||||
operations split the input tensor into 2 parts to get a tensor of real and a tensor of imaginary parts which are then
|
||||
consumed with the "Complex" operation to produce a tensor of complex numbers. These "StridedSlice" and "Complex"
|
||||
operations can be removed so the "FFT" operation will get a real value tensor encoding complex numbers. To achieve this
|
||||
we implement the front phase transformation which searches for a pattern of two "StridedSlice" operations with specific
|
||||
attributes producing data to "Complex" operation and removes it from the graph. Refer to the
|
||||
"Pattern-Defined Front Phase Transformations" section of [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) for more
|
||||
information on how this type of transformation works. The code snippet should be saved to the file
|
||||
`mo_extensions/front/tf/Complex.py`.
|
||||
|
||||
@snippet Complex.py complex:transformation
|
||||
|
||||
> **NOTE**: The graph is in inconsistent state because the "ComplexAbs" operation consumes complex value tensor but
|
||||
> "FFT" produces real value tensor.
|
||||
|
||||
Now lets implement a transformation which replace a "ComplexAbs" operation with a sub-graph of primitive operations
|
||||
which calculate the result using the following formulae: \f$module(z) = \sqrt{real(z) \cdot real(z) + imag(z) \cdot imag(z)}\f$.
|
||||
Original "IFFT2D" operation produces tensor of complex values, but the "FFT" operation produces a real value tensor with
|
||||
the same format and shape as the input for the operation. So the input shape for the "ComplexAbs" will be `[N, H, W, 2]`
|
||||
with the innermost dimension containing tuple with real and imaginary part of a complex number. In order to calculate
|
||||
absolute values for the complex tensor we do the following:
|
||||
1. Raise all elements in the power of 2.
|
||||
2. Calculate a reduced sum over the innermost dimension.
|
||||
3. Calculate a square root.
|
||||
|
||||
The implementation should be saved to the file `mo_extensions/front/tf/ComplexAbs.py` and provided below:
|
||||
|
||||
@snippet ComplexAbs.py complex_abs:transformation
|
||||
|
||||
Now it is possible to convert the model using the following command line:
|
||||
```sh
|
||||
mo --input_model <PATH_TO_MODEL>/wnet_20.pb -b 1 --extensions mo_extensions/
|
||||
```
|
||||
|
||||
The sub-graph corresponding to the originally non-supported one is depicted in the image below:
|
||||
|
||||

|
||||
|
||||
> **NOTE**: Model Optimizer performed conversion of the model from NHWC to NCHW layout that is why the dimension with
|
||||
> the value 2 moved to another position.
|
||||
|
||||
### Inference Engine Extension Implementation
|
||||
Now it is necessary to implement the extension for the CPU plugin with operation "FFT" introduced previously. The code
|
||||
below is based on the template extension described in [Inference Engine Extensibility Mechanism](../OV_Runtime_UG/Extensibility_DG/Intro.md).
|
||||
|
||||
#### CMake Build File
|
||||
The first step is to create a CMake configuration file which builds the extension. The content of the "CMakeLists.txt"
|
||||
file is the following:
|
||||
|
||||
@snippet template_extension/old/CMakeLists.txt cmake:extension
|
||||
|
||||
The CPU FFT kernel implementation uses OpenCV to perform the FFT that is why the extension library is linked with
|
||||
`opencv_core` which comes with the OpenVINO.
|
||||
|
||||
#### Custom nGraph Operation "FFT" Implementation
|
||||
The next step is to create the nGraph operation FFT. The header file "fft_op.hpp" has the following content:
|
||||
|
||||
@snippet template_extension/old/fft_op.hpp fft_op:header
|
||||
|
||||
The operation has just one boolean attribute `inverse`. Implementation of the necessary nGraph operation functions are
|
||||
in the `fft_op.cpp` file with the following content:
|
||||
|
||||
@snippet template_extension/old/fft_op.cpp fft_op:implementation
|
||||
|
||||
Refer to the [Custom nGraph Operation](../OV_Runtime_UG/Extensibility_DG/AddingNGraphOps.md) for more details.
|
||||
|
||||
#### CPU FFT Kernel Implementation
|
||||
The operation implementation for CPU plugin uses OpenCV to perform the FFT. The header file "fft_kernel.hpp" has the
|
||||
following content:
|
||||
|
||||
@snippet template_extension/old/fft_kernel.hpp fft_kernel:header
|
||||
|
||||
The "fft_kernel.cpp" with the implementation of the CPU has the following content:
|
||||
|
||||
@snippet template_extension/old/fft_kernel.cpp fft_kernel:implementation
|
||||
|
||||
Refer to the [How to Implement Custom CPU Operations](../OV_Runtime_UG/Extensibility_DG/CPU_Kernel.md) for more details.
|
||||
|
||||
#### Extension Library Implementation
|
||||
The last step is to create an extension library "extension.cpp" and "extension.hpp" which will include the FFT
|
||||
operation for the CPU plugin. The code of the library is described in the [Extension Library](../OV_Runtime_UG/Extensibility_DG/Extension.md).
|
||||
|
||||
### Building and Running the Custom Extension
|
||||
To build the extension, run the following:<br>
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
source /opt/intel/openvino_2022/setupvars.sh
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
make --jobs=$(nproc)
|
||||
```
|
||||
|
||||
The result of this command is a compiled shared library (`.so` or `.dll`). It should be loaded in the
|
||||
application using `Core` class instance method `AddExtension` like this
|
||||
`core.AddExtension(std::make_shared<Extension>(compiled_library_file_name), "CPU");`.
|
||||
|
||||
To test that the extension is implemented correctly we can run the "mri_reconstruction_demo" with the following content:
|
||||
|
||||
@snippet mri_reconstruction_demo.py mri_demo:demo
|
||||
|
||||
The script can be executed using the following command line:
|
||||
```bash
|
||||
python3 mri_reconstruction_demo.py \
|
||||
-m <PATH_TO_IR>/wnet_20.xml \
|
||||
-i <PATH_TO_SAMPLE_MRI_IMAGE>.npy \
|
||||
-p <Hybrid-CS-Model-MRI_repo>/Data/sampling_mask_20perc.npy \
|
||||
-l <PATH_TO_BUILD_DIR>/libtemplate_extension.so \
|
||||
-d CPU
|
||||
```
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- Intel® Distribution of OpenVINO™ toolkit home page: [https://software.intel.com/en-us/openvino-toolkit](https://software.intel.com/en-us/openvino-toolkit)
|
||||
- OpenVINO™ toolkit online documentation: [https://docs.openvino.ai](https://docs.openvino.ai)
|
||||
- [Model Optimizer Developer Guide](../MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md)
|
||||
- [Model Optimizer Extensibility](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md)
|
||||
- [Inference Engine Extensibility Mechanism](../OV_Runtime_UG/Extensibility_DG/Intro.md)
|
||||
- [OpenVINO™ Toolkit Samples Overview](../OV_Runtime_UG/Samples_Overview.md)
|
||||
- [Overview of OpenVINO™ Toolkit Pre-Trained Models](@ref omz_models_group_intel)
|
||||
- For IoT Libraries and Code Samples see the [Intel® IoT Developer Kit](https://github.com/intel-iot-devkit).
|
||||
|
||||
## Converting Models:
|
||||
|
||||
- [Convert Your Caffe* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Caffe.md)
|
||||
- [Convert Your TensorFlow* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_TensorFlow.md)
|
||||
- [Convert Your MXNet* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_MxNet.md)
|
||||
- [Convert Your Kaldi* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Kaldi.md)
|
||||
- [Convert Your ONNX* Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_ONNX.md)
|
||||
@@ -1,7 +1,7 @@
|
||||
# Asynchronous Inference Request {#openvino_docs_ie_plugin_dg_async_infer_request}
|
||||
|
||||
Asynchronous Inference Request runs an inference pipeline asynchronously in one or several task executors depending on a device pipeline structure.
|
||||
Inference Engine Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class:
|
||||
OpenVINO Runtime Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class:
|
||||
|
||||
- The class has the `_pipeline` field of `std::vector<std::pair<ITaskExecutor::Ptr, Task> >`, which contains pairs of an executor and executed task.
|
||||
- All executors are passed as arguments to a class constructor and they are in the running state and ready to run tasks.
|
||||
@@ -10,7 +10,7 @@ Inference Engine Plugin API provides the base InferenceEngine::AsyncInferRequest
|
||||
`AsyncInferRequest` Class
|
||||
------------------------
|
||||
|
||||
Inference Engine Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class for a custom asynchronous inference request implementation:
|
||||
OpenVINO Runtime Plugin API provides the base InferenceEngine::AsyncInferRequestThreadSafeDefault class for a custom asynchronous inference request implementation:
|
||||
|
||||
@snippet src/template_async_infer_request.hpp async_infer_request:header
|
||||
|
||||
|
||||
@@ -675,7 +675,7 @@ SHOW_NAMESPACES = YES
|
||||
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
|
||||
# doxygen should invoke to get the current version for each file (typically from
|
||||
# the version control system). Doxygen will invoke the program by executing (via
|
||||
# popen()) the command command input-file, where command is the value of the
|
||||
# popen()) the command input-file, where command is the value of the
|
||||
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
|
||||
# by doxygen. Whatever the program writes to standard output is used as the file
|
||||
# version. For an example see the documentation.
|
||||
|
||||
@@ -37,8 +37,8 @@ The implementation `CompileNetwork` is fully device-specific.
|
||||
|
||||
The function accepts a const shared pointer to `ngraph::Function` object and performs the following steps:
|
||||
|
||||
1. Applies ngraph passes using `TransformNetwork` function, which defines plugin-specific conversion pipeline. To support low precision inference, the pipeline can include Low Precision Transformations. These transformations are usually hardware specific. You can find how to use and configure Low Precisions Transformations in [Low Precision Transformations](@ref openvino_docs_IE_DG_lpt) guide.
|
||||
2. Maps the transformed graph to a backend specific graph representation (for example, to MKLDNN graph for Intel CPU).
|
||||
1. Applies nGraph passes using `TransformNetwork` function, which defines plugin-specific conversion pipeline. To support low precision inference, the pipeline can include Low Precision Transformations. These transformations are usually hardware specific. You can find how to use and configure Low Precisions Transformations in [Low Precision Transformations](@ref openvino_docs_OV_UG_lpt) guide.
|
||||
2. Maps the transformed graph to a backend specific graph representation (for example, to CPU plugin internal graph representation).
|
||||
3. Allocates and fills memory for graph weights, backend specific memory handles and so on.
|
||||
|
||||
@snippet src/template_executable_network.cpp executable_network:map_graph
|
||||
|
||||
@@ -54,7 +54,7 @@ Decrements a number of created inference requests:
|
||||
|
||||
#### 1. `inferPreprocess`
|
||||
|
||||
Below is the code of the the `inferPreprocess` method to demonstrate Inference Engine common preprocessing step handling:
|
||||
Below is the code of the `inferPreprocess` method to demonstrate Inference Engine common preprocessing step handling:
|
||||
|
||||
@snippet src/template_infer_request.cpp infer_request:infer_preprocess
|
||||
|
||||
|
||||
@@ -9,11 +9,12 @@
|
||||
|
||||
Implement Plugin Functionality <openvino_docs_ie_plugin_dg_plugin>
|
||||
Implement Executable Network Functionality <openvino_docs_ie_plugin_dg_executable_network>
|
||||
openvino_docs_ie_plugin_dg_quantized_networks
|
||||
Implement Synchronous Inference Request <openvino_docs_ie_plugin_dg_infer_request>
|
||||
Implement Asynchronous Inference Request <openvino_docs_ie_plugin_dg_async_infer_request>
|
||||
openvino_docs_ie_plugin_dg_plugin_build
|
||||
openvino_docs_ie_plugin_dg_plugin_testing
|
||||
openvino_docs_ie_plugin_detailed_guides
|
||||
openvino_docs_ie_plugin_api_references
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
@@ -55,11 +56,11 @@ Detailed guides
|
||||
* [Build](@ref openvino_docs_ie_plugin_dg_plugin_build) a plugin library using CMake\*
|
||||
* Plugin and its components [testing](@ref openvino_docs_ie_plugin_dg_plugin_testing)
|
||||
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks)
|
||||
* [Low precision transformations](@ref openvino_docs_IE_DG_lpt) guide
|
||||
* [Writing nGraph transformations](@ref ngraph_transformation) guide
|
||||
* [Low precision transformations](@ref openvino_docs_OV_UG_lpt) guide
|
||||
* [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide
|
||||
|
||||
API References
|
||||
-----------------------
|
||||
|
||||
* [Inference Engine Plugin API](groupie_dev_api.html)
|
||||
* [Inference Engine Transformation API](groupie_transformation_api.html)
|
||||
* [Inference Engine Plugin API](@ref ie_dev_api)
|
||||
* [Inference Engine Transformation API](@ref ie_transformation_api)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Inference Engine Plugin usually represents a wrapper around a backend. Backends can be:
|
||||
- OpenCL-like backend (e.g. clDNN library) for GPU devices.
|
||||
- MKLDNN backend for Intel CPU devices.
|
||||
- oneDNN backend for Intel CPU devices.
|
||||
- NVIDIA cuDNN for NVIDIA GPUs.
|
||||
|
||||
The responsibility of Inference Engine Plugin:
|
||||
@@ -30,7 +30,7 @@ Based on that, declaration of a plugin class can look as follows:
|
||||
|
||||
The provided plugin class also has several fields:
|
||||
|
||||
* `_backend` - a backend engine that is used to perform actual computations for network inference. For `Template` plugin `ngraph::runtime::Backend` is used which performs computations using ngraph reference implementations.
|
||||
* `_backend` - a backend engine that is used to perform actual computations for network inference. For `Template` plugin `ngraph::runtime::Backend` is used which performs computations using OpenVINO™ reference implementations.
|
||||
* `_waitExecutor` - a task executor that waits for a response from a device about device tasks completion.
|
||||
* `_cfg` of type `Configuration`:
|
||||
|
||||
@@ -67,7 +67,7 @@ which holds a backend-dependent compiled graph in an internal representation:
|
||||
Before a creation of an `ExecutableNetwork` instance via a constructor, a plugin may check if a provided
|
||||
InferenceEngine::ICNNNetwork object is supported by a device. In the example above, the plugin checks precision information.
|
||||
|
||||
The very important part before creation of `ExecutableNetwork` instance is to call `TransformNetwork` method which applies ngraph transformation passes.
|
||||
The very important part before creation of `ExecutableNetwork` instance is to call `TransformNetwork` method which applies OpenVINO™ transformation passes.
|
||||
|
||||
Actual graph compilation is done in the `ExecutableNetwork` constructor. Refer to the [ExecutableNetwork Implementation Guide](@ref openvino_docs_ie_plugin_dg_executable_network) for details.
|
||||
|
||||
@@ -77,27 +77,27 @@ Actual graph compilation is done in the `ExecutableNetwork` constructor. Refer t
|
||||
|
||||
### `TransformNetwork()`
|
||||
|
||||
The function accepts a const shared pointer to `ngraph::Function` object and performs the following steps:
|
||||
The function accepts a const shared pointer to `ov::Model` object and performs the following steps:
|
||||
|
||||
1. Deep copies a const object to a local object, which can later be modified.
|
||||
2. Applies common and plugin-specific transformations on a copied graph to make the graph more friendly to hardware operations. For details how to write custom plugin-specific transformation, please, refer to [Writing ngraph transformations](@ref ngraph_transformation) guide. See detailed topics about network representation:
|
||||
2. Applies common and plugin-specific transformations on a copied graph to make the graph more friendly to hardware operations. For details how to write custom plugin-specific transformation, please, refer to [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide. See detailed topics about network representation:
|
||||
* [Intermediate Representation and Operation Sets](../_docs_MO_DG_IR_and_opsets.html)
|
||||
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks).
|
||||
|
||||
@snippet template_plugin/src/template_plugin.cpp plugin:transform_network
|
||||
|
||||
> **NOTE**: After all these transformations, a `ngraph::Function` object contains operations which can be perfectly mapped to backend kernels. E.g. if backend has kernel computing `A + B` operations at once, the `TransformNetwork` function should contain a pass which fuses operations `A` and `B` into a single custom operation `A + B` which fits backend kernels set.
|
||||
> **NOTE**: After all these transformations, a `ov::Model` object contains operations which can be perfectly mapped to backend kernels. E.g. if backend has kernel computing `A + B` operations at once, the `TransformNetwork` function should contain a pass which fuses operations `A` and `B` into a single custom operation `A + B` which fits backend kernels set.
|
||||
|
||||
### `QueryNetwork()`
|
||||
|
||||
Use the method with the `HETERO` mode, which allows to distribute network execution between different
|
||||
devices based on the `ngraph::Node::get_rt_info()` map, which can contain the `"affinity"` key.
|
||||
devices based on the `ov::Node::get_rt_info()` map, which can contain the `"affinity"` key.
|
||||
The `QueryNetwork` method analyzes operations of provided `network` and returns a list of supported
|
||||
operations via the InferenceEngine::QueryNetworkResult structure. The `QueryNetwork` firstly applies `TransformNetwork` passes to input `ngraph::Function` argument. After this, the transformed network in ideal case contains only operations are 1:1 mapped to kernels in computational backend. In this case, it's very easy to analyze which operations is supposed (`_backend` has a kernel for such operation or extensions for the operation is provided) and not supported (kernel is missed in `_backend`):
|
||||
operations via the InferenceEngine::QueryNetworkResult structure. The `QueryNetwork` firstly applies `TransformNetwork` passes to input `ov::Model` argument. After this, the transformed network in ideal case contains only operations are 1:1 mapped to kernels in computational backend. In this case, it's very easy to analyze which operations is supposed (`_backend` has a kernel for such operation or extensions for the operation is provided) and not supported (kernel is missed in `_backend`):
|
||||
|
||||
1. Store original names of all operations in input `ngraph::Function`
|
||||
1. Store original names of all operations in input `ov::Model`
|
||||
2. Apply `TransformNetwork` passes. Note, the names of operations in a transformed network can be different and we need to restore the mapping in the steps below.
|
||||
3. Construct `supported` and `unsupported` maps which contains names of original operations. Note, that since the inference is performed using ngraph reference backend, the decision whether the operation is supported or not depends on whether the latest OpenVINO opset contains such operation.
|
||||
3. Construct `supported` and `unsupported` maps which contains names of original operations. Note, that since the inference is performed using OpenVINO™ reference backend, the decision whether the operation is supported or not depends on whether the latest OpenVINO opset contains such operation.
|
||||
4. `QueryNetworkResult.supportedLayersMap` contains only operations which are fully supported by `_backend`.
|
||||
|
||||
@snippet template_plugin/src/template_plugin.cpp plugin:query_network
|
||||
|
||||
@@ -26,7 +26,7 @@ Engine concepts: plugin creation, multiple executable networks support, multiple
|
||||
@snippet single_layer_tests/convolution.cpp test_convolution:instantiate
|
||||
|
||||
3. **Sub-graph tests** (`subgraph_tests` sub-folder). This group of tests is designed to tests small patterns or combination of layers. E.g. when a particular topology is being enabled in a plugin e.g. TF ResNet-50, there is no need to add the whole topology to test tests. In opposite way, a particular repetitive subgraph or pattern can be extracted from `ResNet-50` and added to the tests. The instantiation of the sub-graph tests is done in the same way as for single layer tests.
|
||||
> **Note**, such sub-graphs or patterns for sub-graph tests should be added to `IE::ngraphFunctions` library first (this library is a pre-defined set of small `ngraph::Function`) and re-used in sub-graph tests after.
|
||||
> **Note**, such sub-graphs or patterns for sub-graph tests should be added to `IE::ngraphFunctions` library first (this library is a pre-defined set of small `ov::Model`) and re-used in sub-graph tests after.
|
||||
|
||||
4. **HETERO tests** (`subgraph_tests` sub-folder) contains tests for `HETERO` scenario (manual or automatic affinities settings, tests for `QueryNetwork`).
|
||||
|
||||
@@ -41,18 +41,14 @@ To use these tests for your own plugin development, link the `IE::funcSharedTest
|
||||
To build test binaries together with other build artifacts, use the `make all` command. For details, see
|
||||
[Build Plugin Using CMake*](@ref openvino_docs_ie_plugin_dg_plugin_build).
|
||||
|
||||
### Tests for plugin-specific ngraph transformations
|
||||
|
||||
Please, refer to [Transformation testing](@ref ngraph_transformation) guide.
|
||||
|
||||
### How to Extend Inference Engine Plugin Tests
|
||||
|
||||
Inference Engine Plugin tests are open for contribution.
|
||||
Add common test case definitions applicable for all plugins to the `IE::funcSharedTests` target within the DLDT repository. Then, any other plugin supporting corresponding functionality can instantiate the new test.
|
||||
|
||||
All Inference Engine per-layer tests check test layers functionality. They are developed using nGraph functions
|
||||
All Inference Engine per-layer tests check test layers functionality. They are developed using ov::Model.
|
||||
as input graphs used by tests. In this case, to test a new layer with layer tests, extend
|
||||
the `IE::ngraphFunctions` library, which is also included in the Inference Engine Developer package, with a new nGraph function
|
||||
the `IE::ngraphFunctions` library, which is also included in the Inference Engine Developer package, with a new model.
|
||||
including the corresponding operation.
|
||||
|
||||
> **NOTE**: When implementing a new subgraph test, add new single-layer tests for each operation of the subgraph if such test does not exist.
|
||||
|
||||
@@ -9,7 +9,7 @@ For more details about low-precision model representation please refer to this [
|
||||
During the model load each plugin can interpret quantization rules expressed in *FakeQuantize* operations:
|
||||
- Independently based on the definition of *FakeQuantize* operation.
|
||||
- Using a special library of low-precision transformations (LPT) which applies common rules for generic operations,
|
||||
such as Convolution, Fully-Connected, Eltwise, etc., and translates "fake-quantized" models into the models with low-precision operations. For more information about low-precision flow please refer to the following [document](@ref openvino_docs_IE_DG_Int8Inference).
|
||||
such as Convolution, Fully-Connected, Eltwise, etc., and translates "fake-quantized" models into models with low-precision operations.
|
||||
|
||||
Here we provide only a high-level overview of the interpretation rules of FakeQuantize.
|
||||
At runtime each FakeQuantize can be split into two independent operations: **Quantize** and **Dequantize**.
|
||||
|
||||
18
docs/IE_PLUGIN_DG/detailed_guides.md
Normal file
18
docs/IE_PLUGIN_DG/detailed_guides.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Advanced Topics {#openvino_docs_ie_plugin_detailed_guides}
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_ie_plugin_dg_quantized_networks
|
||||
openvino_docs_OV_UG_lpt
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
The guides below provides extra information about specific features of OpenVINO needed for understanding during OpenVINO plugin development:
|
||||
|
||||
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks)
|
||||
* [Low precision transformations](@ref openvino_docs_OV_UG_lpt) guide
|
||||
* [Writing OpenVINO™ transformations](@ref openvino_docs_transformations) guide
|
||||
17
docs/IE_PLUGIN_DG/dev_api_references.md
Normal file
17
docs/IE_PLUGIN_DG/dev_api_references.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Plugin API Reference {#openvino_docs_ie_plugin_api_references}
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
../groupie_dev_api
|
||||
../groupie_transformation_api
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
The guides below provides extra API references needed for OpenVINO plugin development:
|
||||
|
||||
* [OpenVINO Plugin API](@ref ie_dev_api)
|
||||
* [OpenVINO Transformation API](@ref ie_transformation_api)
|
||||
@@ -5,74 +5,74 @@
|
||||
<tab type="usergroup" url="index.html" title="Developer Guide for Inference Engine Plugin Library">
|
||||
<tab type="user" url="@ref plugin" visibile="yes" title="Implement Plugin Functionality"/>
|
||||
<tab type="user" url="@ref executable_network" visibile="yes" title="Implement Executable Network Functionality">
|
||||
<tab type="usergroup" title="Low Precision Transformations" url="@ref openvino_docs_IE_DG_lpt">
|
||||
<tab type="user" title="Attributes" url="@ref openvino_docs_IE_DG_lpt_attributes">
|
||||
<tab type="user" title="AvgPoolPrecisionPreserved" url="@ref openvino_docs_IE_DG_lpt_AvgPoolPrecisionPreserved"/>
|
||||
<tab type="user" title="IntervalsAlignment" url="@ref openvino_docs_IE_DG_lpt_IntervalsAlignment"/>
|
||||
<tab type="user" title="PerTensorQuantization" url="@ref openvino_docs_IE_DG_lpt_PerTensorQuantization"/>
|
||||
<tab type="user" title="PrecisionPreserved" url="@ref openvino_docs_IE_DG_lpt_PrecisionPreserved"/>
|
||||
<tab type="user" title="Precisions" url="@ref openvino_docs_IE_DG_lpt_Precisions"/>
|
||||
<tab type="user" title="QuantizationAlignment" url="@ref openvino_docs_IE_DG_lpt_QuantizationAlignment"/>
|
||||
<tab type="usergroup" title="Low Precision Transformations" url="@ref openvino_docs_OV_UG_lpt">
|
||||
<tab type="user" title="Attributes" url="@ref openvino_docs_OV_UG_lpt_attributes">
|
||||
<tab type="user" title="AvgPoolPrecisionPreserved" url="@ref openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved"/>
|
||||
<tab type="user" title="IntervalsAlignment" url="@ref openvino_docs_OV_UG_lpt_IntervalsAlignment"/>
|
||||
<tab type="user" title="PrecisionPreserved" url="@ref openvino_docs_OV_UG_lpt_PrecisionPreserved"/>
|
||||
<tab type="user" title="Precisions" url="@ref openvino_docs_OV_UG_lpt_Precisions"/>
|
||||
<tab type="user" title="QuantizationAlignment" url="@ref openvino_docs_OV_UG_lpt_QuantizationAlignment"/>
|
||||
<tab type="user" title="QuantizationGranularity" url="@ref openvino_docs_OV_UG_lpt_QuantizationGranularity"/>
|
||||
</tab>
|
||||
<tab type="user" title="Step 1. Prerequisites transformations" url="@ref openvino_docs_IE_DG_lpt_step1_prerequisites">
|
||||
<tab type="user" title="LinOpSequenceFusion" url="@ref openvino_docs_IE_DG_lpt_LinOpSequenceFusion"/>
|
||||
<tab type="user" title="PullReshapeThroughDequantization" url="@ref openvino_docs_IE_DG_lpt_PullReshapeThroughDequantization"/>
|
||||
<tab type="user" title="PullTransposeThroughDequantization" url="@ref openvino_docs_IE_DG_lpt_PullTransposeThroughDequantization"/>
|
||||
<tab type="user" title="Step 1. Prerequisites transformations" url="@ref openvino_docs_OV_UG_lpt_step1_prerequisites">
|
||||
<tab type="user" title="LinOpSequenceFusion" url="@ref openvino_docs_OV_UG_lpt_LinOpSequenceFusion"/>
|
||||
<tab type="user" title="PullReshapeThroughDequantization" url="@ref openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization"/>
|
||||
<tab type="user" title="PullTransposeThroughDequantization" url="@ref openvino_docs_OV_UG_lpt_PullTransposeThroughDequantization"/>
|
||||
</tab>
|
||||
<tab type="user" title="Step 2. Markup transformations" url="@ref openvino_docs_IE_DG_lpt_step2_markup">
|
||||
<tab type="user" title="AlignQuantizationIntervals" url="@ref openvino_docs_IE_DG_lpt_AlignQuantizationIntervals"/>
|
||||
<tab type="user" title="AlignQuantizationParameters" url="@ref openvino_docs_IE_DG_lpt_AlignQuantizationParameters"/>
|
||||
<tab type="user" title="CreateAttribute" url="@ref openvino_docs_IE_DG_lpt_CreateAttribute"/>
|
||||
<tab type="user" title="CreatePrecisionsDependentAttribute" url="@ref openvino_docs_IE_DG_lpt_CreatePrecisionsDependentAttribute"/>
|
||||
<tab type="user" title="MarkupAvgPoolPrecisionPreserved" url="@ref openvino_docs_IE_DG_lpt_MarkupAvgPoolPrecisionPreserved"/>
|
||||
<tab type="user" title="MarkupCanBeQuantized" url="@ref openvino_docs_IE_DG_lpt_MarkupCanBeQuantized"/>
|
||||
<tab type="user" title="MarkupPerTensorQuantization" url="@ref openvino_docs_IE_DG_lpt_MarkupPerTensorQuantization"/>
|
||||
<tab type="user" title="MarkupPrecisions" url="@ref openvino_docs_IE_DG_lpt_MarkupPrecisions"/>
|
||||
<tab type="user" title="PropagatePrecisions" url="@ref openvino_docs_IE_DG_lpt_PropagatePrecisions"/>
|
||||
<tab type="user" title="PropagateThroughPrecisionPreserved" url="@ref openvino_docs_IE_DG_lpt_PropagateThroughPrecisionPreserved"/>
|
||||
<tab type="user" title="PropagateToInput" url="@ref openvino_docs_IE_DG_lpt_PropagateToInput"/>
|
||||
<tab type="user" title="UpdateSharedPrecisionPreserved" url="@ref openvino_docs_IE_DG_lpt_UpdateSharedPrecisionPreserved"/>
|
||||
<tab type="user" title="Step 2. Markup transformations" url="@ref openvino_docs_OV_UG_lpt_step2_markup">
|
||||
<tab type="user" title="AlignQuantizationIntervals" url="@ref openvino_docs_OV_UG_lpt_AlignQuantizationIntervals"/>
|
||||
<tab type="user" title="AlignQuantizationParameters" url="@ref openvino_docs_OV_UG_lpt_AlignQuantizationParameters"/>
|
||||
<tab type="user" title="CreateAttribute" url="@ref openvino_docs_OV_UG_lpt_CreateAttribute"/>
|
||||
<tab type="user" title="CreatePrecisionsDependentAttribute" url="@ref openvino_docs_OV_UG_lpt_CreatePrecisionsDependentAttribute"/>
|
||||
<tab type="user" title="MarkupAvgPoolPrecisionPreserved" url="@ref openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved"/>
|
||||
<tab type="user" title="MarkupCanBeQuantized" url="@ref openvino_docs_OV_UG_lpt_MarkupCanBeQuantized"/>
|
||||
<tab type="user" title="MarkupPerTensorQuantization" url="@ref openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization"/>
|
||||
<tab type="user" title="MarkupPrecisions" url="@ref openvino_docs_OV_UG_lpt_MarkupPrecisions"/>
|
||||
<tab type="user" title="PropagatePrecisions" url="@ref openvino_docs_OV_UG_lpt_PropagatePrecisions"/>
|
||||
<tab type="user" title="PropagateThroughPrecisionPreserved" url="@ref openvino_docs_OV_UG_lpt_PropagateThroughPrecisionPreserved"/>
|
||||
<tab type="user" title="PropagateToInput" url="@ref openvino_docs_OV_UG_lpt_PropagateToInput"/>
|
||||
<tab type="user" title="UpdateSharedPrecisionPreserved" url="@ref openvino_docs_OV_UG_lpt_UpdateSharedPrecisionPreserved"/>
|
||||
</tab>
|
||||
<tab type="user" title="Step 3. Main transformations" url="@ref openvino_docs_IE_DG_lpt_step3_main">
|
||||
<tab type="user" title="AddTransformation" url="@ref openvino_docs_IE_DG_lpt_AddTransformation"/>
|
||||
<tab type="user" title="AvgPoolTransformation" url="@ref openvino_docs_IE_DG_lpt_AvgPoolTransformation"/>
|
||||
<tab type="user" title="ClampTransformation" url="@ref openvino_docs_IE_DG_lpt_ClampTransformation"/>
|
||||
<tab type="user" title="ConcatTransformation" url="@ref openvino_docs_IE_DG_lpt_ConcatTransformation"/>
|
||||
<tab type="user" title="ConvolutionTransformation" url="@ref openvino_docs_IE_DG_lpt_ConvolutionTransformation"/>
|
||||
<tab type="user" title="ConvolutionBackpropDataTransformation" url="@ref openvino_docs_IE_DG_lpt_ConvolutionBackpropDataTransformation"/>
|
||||
<tab type="user" title="DepthToSpaceTransformation" url="@ref openvino_docs_IE_DG_lpt_DepthToSpaceTransformation"/>
|
||||
<tab type="user" title="FakeQuantizeDecompositionTransformation" url="@ref openvino_docs_IE_DG_lpt_FakeQuantizeDecompositionTransformation"/>
|
||||
<tab type="user" title="FakeQuantizeTransformation" url="@ref openvino_docs_IE_DG_lpt_FakeQuantizeTransformation"/>
|
||||
<tab type="user" title="InterpolateTransformation" url="@ref openvino_docs_IE_DG_lpt_InterpolateTransformation"/>
|
||||
<tab type="user" title="GroupConvolutionTransformation" url="@ref openvino_docs_IE_DG_lpt_GroupConvolutionTransformation"/>
|
||||
<tab type="user" title="MatMulTransformation" url="@ref openvino_docs_IE_DG_lpt_MatMulTransformation"/>
|
||||
<tab type="user" title="MaxPoolTransformation" url="@ref openvino_docs_IE_DG_lpt_MaxPoolTransformation"/>
|
||||
<tab type="user" title="MultiplyTransformation" url="@ref openvino_docs_IE_DG_lpt_MultiplyTransformation"/>
|
||||
<tab type="user" title="MVNTransformation" url="@ref openvino_docs_IE_DG_lpt_MVNTransformation"/>
|
||||
<tab type="user" title="NormalizeL2Transformation" url="@ref openvino_docs_IE_DG_lpt_NormalizeL2Transformation"/>
|
||||
<tab type="user" title="PadTransformation" url="@ref openvino_docs_IE_DG_lpt_PadTransformation"/>
|
||||
<tab type="user" title="PReluTransformation" url="@ref openvino_docs_IE_DG_lpt_PReluTransformation"/>
|
||||
<tab type="user" title="ReduceMaxTransformation" url="@ref openvino_docs_IE_DG_lpt_ReduceMaxTransformation"/>
|
||||
<tab type="user" title="ReduceMeanTransformation" url="@ref openvino_docs_IE_DG_lpt_ReduceMeanTransformation"/>
|
||||
<tab type="user" title="ReduceMinTransformation" url="@ref openvino_docs_IE_DG_lpt_ReduceMinTransformation"/>
|
||||
<tab type="user" title="ReduceSumTransformation" url="@ref openvino_docs_IE_DG_lpt_ReduceSumTransformation"/>
|
||||
<tab type="user" title="ReluTransformation" url="@ref openvino_docs_IE_DG_lpt_ReluTransformation"/>
|
||||
<tab type="user" title="ReshapeTransformation" url="@ref openvino_docs_IE_DG_lpt_ReshapeTransformation"/>
|
||||
<tab type="user" title="SqueezeTransformation" url="@ref openvino_docs_IE_DG_lpt_SqueezeTransformation"/>
|
||||
<tab type="user" title="ShuffleChannelsTransformation" url="@ref openvino_docs_IE_DG_lpt_ShuffleChannelsTransformation"/>
|
||||
<tab type="user" title="SplitTransformation" url="@ref openvino_docs_IE_DG_lpt_SplitTransformation"/>
|
||||
<tab type="user" title="StridedSliceTransformation" url="@ref openvino_docs_IE_DG_lpt_StridedSliceTransformation"/>
|
||||
<tab type="user" title="TransposeTransformation" url="@ref openvino_docs_IE_DG_lpt_TransposeTransformation"/>
|
||||
<tab type="user" title="UnsqueezeTransformation" url="@ref openvino_docs_IE_DG_lpt_UnsqueezeTransformation"/>
|
||||
<tab type="user" title="VariadicSplitTransformation" url="@ref openvino_docs_IE_DG_lpt_VariadicSplitTransformation"/>
|
||||
<tab type="user" title="Step 3. Main transformations" url="@ref openvino_docs_OV_UG_lpt_step3_main">
|
||||
<tab type="user" title="AddTransformation" url="@ref openvino_docs_OV_UG_lpt_AddTransformation"/>
|
||||
<tab type="user" title="AvgPoolTransformation" url="@ref openvino_docs_OV_UG_lpt_AvgPoolTransformation"/>
|
||||
<tab type="user" title="ClampTransformation" url="@ref openvino_docs_OV_UG_lpt_ClampTransformation"/>
|
||||
<tab type="user" title="ConcatTransformation" url="@ref openvino_docs_OV_UG_lpt_ConcatTransformation"/>
|
||||
<tab type="user" title="ConvolutionTransformation" url="@ref openvino_docs_OV_UG_lpt_ConvolutionTransformation"/>
|
||||
<tab type="user" title="ConvolutionBackpropDataTransformation" url="@ref openvino_docs_OV_UG_lpt_ConvolutionBackpropDataTransformation"/>
|
||||
<tab type="user" title="DepthToSpaceTransformation" url="@ref openvino_docs_OV_UG_lpt_DepthToSpaceTransformation"/>
|
||||
<tab type="user" title="FakeQuantizeDecompositionTransformation" url="@ref openvino_docs_OV_UG_lpt_FakeQuantizeDecompositionTransformation"/>
|
||||
<tab type="user" title="FakeQuantizeTransformation" url="@ref openvino_docs_OV_UG_lpt_FakeQuantizeTransformation"/>
|
||||
<tab type="user" title="InterpolateTransformation" url="@ref openvino_docs_OV_UG_lpt_InterpolateTransformation"/>
|
||||
<tab type="user" title="GroupConvolutionTransformation" url="@ref openvino_docs_OV_UG_lpt_GroupConvolutionTransformation"/>
|
||||
<tab type="user" title="MatMulTransformation" url="@ref openvino_docs_OV_UG_lpt_MatMulTransformation"/>
|
||||
<tab type="user" title="MaxPoolTransformation" url="@ref openvino_docs_OV_UG_lpt_MaxPoolTransformation"/>
|
||||
<tab type="user" title="MultiplyTransformation" url="@ref openvino_docs_OV_UG_lpt_MultiplyTransformation"/>
|
||||
<tab type="user" title="MVNTransformation" url="@ref openvino_docs_OV_UG_lpt_MVNTransformation"/>
|
||||
<tab type="user" title="NormalizeL2Transformation" url="@ref openvino_docs_OV_UG_lpt_NormalizeL2Transformation"/>
|
||||
<tab type="user" title="PadTransformation" url="@ref openvino_docs_OV_UG_lpt_PadTransformation"/>
|
||||
<tab type="user" title="PReluTransformation" url="@ref openvino_docs_OV_UG_lpt_PReluTransformation"/>
|
||||
<tab type="user" title="ReduceMaxTransformation" url="@ref openvino_docs_OV_UG_lpt_ReduceMaxTransformation"/>
|
||||
<tab type="user" title="ReduceMeanTransformation" url="@ref openvino_docs_OV_UG_lpt_ReduceMeanTransformation"/>
|
||||
<tab type="user" title="ReduceMinTransformation" url="@ref openvino_docs_OV_UG_lpt_ReduceMinTransformation"/>
|
||||
<tab type="user" title="ReduceSumTransformation" url="@ref openvino_docs_OV_UG_lpt_ReduceSumTransformation"/>
|
||||
<tab type="user" title="ReluTransformation" url="@ref openvino_docs_OV_UG_lpt_ReluTransformation"/>
|
||||
<tab type="user" title="ReshapeTransformation" url="@ref openvino_docs_OV_UG_lpt_ReshapeTransformation"/>
|
||||
<tab type="user" title="SqueezeTransformation" url="@ref openvino_docs_OV_UG_lpt_SqueezeTransformation"/>
|
||||
<tab type="user" title="ShuffleChannelsTransformation" url="@ref openvino_docs_OV_UG_lpt_ShuffleChannelsTransformation"/>
|
||||
<tab type="user" title="SplitTransformation" url="@ref openvino_docs_OV_UG_lpt_SplitTransformation"/>
|
||||
<tab type="user" title="StridedSliceTransformation" url="@ref openvino_docs_OV_UG_lpt_StridedSliceTransformation"/>
|
||||
<tab type="user" title="TransposeTransformation" url="@ref openvino_docs_OV_UG_lpt_TransposeTransformation"/>
|
||||
<tab type="user" title="UnsqueezeTransformation" url="@ref openvino_docs_OV_UG_lpt_UnsqueezeTransformation"/>
|
||||
<tab type="user" title="VariadicSplitTransformation" url="@ref openvino_docs_OV_UG_lpt_VariadicSplitTransformation"/>
|
||||
</tab>
|
||||
<tab type="user" title="Step 4. Cleanup transformations" url="@ref openvino_docs_IE_DG_lpt_step4_cleanup">
|
||||
<tab type="user" title="FoldConvertTransformation" url="@ref openvino_docs_IE_DG_lpt_FoldConvertTransformation"/>
|
||||
<tab type="user" title="FoldFakeQuantizeTransformation" url="@ref openvino_docs_IE_DG_lpt_FoldFakeQuantizeTransformation"/>
|
||||
<tab type="user" title="FuseConvertTransformation" url="@ref openvino_docs_IE_DG_lpt_FuseConvertTransformation"/>
|
||||
<tab type="user" title="FuseMultiplyToFakeQuantizeTransformation" url="@ref openvino_docs_IE_DG_lpt_FuseMultiplyToFakeQuantizeTransformation"/>
|
||||
<tab type="user" title="FuseSubtractToFakeQuantizeTransformation" url="@ref openvino_docs_IE_DG_lpt_FuseSubtractToFakeQuantizeTransformation"/>
|
||||
<tab type="user" title="MultiplyToGroupConvolutionTransformation" url="@ref openvino_docs_IE_DG_lpt_MultiplyToGroupConvolutionTransformation"/>
|
||||
<tab type="user" title="Step 4. Cleanup transformations" url="@ref openvino_docs_OV_UG_lpt_step4_cleanup">
|
||||
<tab type="user" title="FoldConvertTransformation" url="@ref openvino_docs_OV_UG_lpt_FoldConvertTransformation"/>
|
||||
<tab type="user" title="FoldFakeQuantizeTransformation" url="@ref openvino_docs_OV_UG_lpt_FoldFakeQuantizeTransformation"/>
|
||||
<tab type="user" title="FuseConvertTransformation" url="@ref openvino_docs_OV_UG_lpt_FuseConvertTransformation"/>
|
||||
<tab type="user" title="FuseMultiplyToFakeQuantizeTransformation" url="@ref openvino_docs_OV_UG_lpt_FuseMultiplyToFakeQuantizeTransformation"/>
|
||||
<tab type="user" title="FuseSubtractToFakeQuantizeTransformation" url="@ref openvino_docs_OV_UG_lpt_FuseSubtractToFakeQuantizeTransformation"/>
|
||||
<tab type="user" title="MultiplyToGroupConvolutionTransformation" url="@ref openvino_docs_OV_UG_lpt_MultiplyToGroupConvolutionTransformation"/>
|
||||
</tab>
|
||||
</tab>
|
||||
</tab>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# Plugin Transformation Pipeline {#openvino_docs_IE_DG_plugin_transformation_pipeline}
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Executable Network
|
||||
:hidden:
|
||||
|
||||
Low Precision Transformations <openvino_docs_IE_DG_lpt>
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
Typical plugin transformation pipeline includes steps:
|
||||
1. Common transformations
|
||||
2. [Low precision transformations](@ref openvino_docs_IE_DG_lpt)
|
||||
3. Plugin specific transformations
|
||||
@@ -1,4 +1,4 @@
|
||||
# AvgPoolPrecisionPreserved attribute {#openvino_docs_IE_DG_lpt_AvgPoolPrecisionPreserved}
|
||||
# AvgPoolPrecisionPreserved attribute {#openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved}
|
||||
|
||||
ngraph::AvgPoolPrecisionPreservedAttribute class represents the `AvgPoolPrecisionPreserved` attribute.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# IntervalsAlignment attribute {#openvino_docs_IE_DG_lpt_IntervalsAlignment}
|
||||
# IntervalsAlignment attribute {#openvino_docs_OV_UG_lpt_IntervalsAlignment}
|
||||
|
||||
ngraph::IntervalsAlignmentAttribute class represents the `IntervalsAlignment` attribute.
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# PerTensorQuantization attribute {#openvino_docs_IE_DG_lpt_PerTensorQuantization}
|
||||
|
||||
ngraph::PerTensorQuantizationAttribute class represents the `PerTensorQuantization` attribute.
|
||||
|
||||
The attribute defines if the operation input port requires per-tensor quantization.
|
||||
|
||||
| Property name | Values |
|
||||
|---------------|----------------------------------------------|
|
||||
| Required | Yes |
|
||||
| Defined | Operation, input ports |
|
||||
| Properties | |
|
||||
@@ -1,4 +1,4 @@
|
||||
# PrecisionPreserved attribute {#openvino_docs_IE_DG_lpt_PrecisionPreserved}
|
||||
# PrecisionPreserved attribute {#openvino_docs_OV_UG_lpt_PrecisionPreserved}
|
||||
|
||||
ngraph::PrecisionPreservedAttribute class represents the `PrecisionPreserved` attribute.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Precisions attribute {#openvino_docs_IE_DG_lpt_Precisions}
|
||||
# Precisions attribute {#openvino_docs_OV_UG_lpt_Precisions}
|
||||
|
||||
ngraph::PrecisionsAttribute class represents the `Precisions` attribute.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# QuantizationAlignment attribute {#openvino_docs_IE_DG_lpt_QuantizationAlignment}
|
||||
# QuantizationAlignment attribute {#openvino_docs_OV_UG_lpt_QuantizationAlignment}
|
||||
|
||||
ngraph::QuantizationAlignmentAttribute class represents the `QuantizationAlignment` attribute.
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# QuantizationGranularity attribute {#openvino_docs_OV_UG_lpt_QuantizationGranularity}
|
||||
|
||||
ngraph::QuantizationAttribute class represents the `QuantizationGranularity` attribute.
|
||||
|
||||
The attribute defines quantization granularity of operation inputs.
|
||||
|
||||
| Property name | Values |
|
||||
|---------------|----------------------------------------------|
|
||||
| Required | No |
|
||||
| Defined | Input ports |
|
||||
| Properties | Quantization granularity |
|
||||
@@ -1,4 +1,4 @@
|
||||
# OpenVINO™ Low Precision Transformations {#openvino_docs_IE_DG_lpt}
|
||||
# OpenVINO™ Low Precision Transformations {#openvino_docs_OV_UG_lpt}
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
:caption: Low Precision Transformations
|
||||
:hidden:
|
||||
|
||||
Low Precision Transformations <openvino_docs_IE_DG_lpt>
|
||||
Low Precision Transformations <openvino_docs_OV_UG_lpt>
|
||||
|
||||
Attributes <openvino_docs_IE_DG_lpt_attributes>
|
||||
Step 1. Prerequisites transformations <openvino_docs_IE_DG_lpt_step1_prerequisites>
|
||||
Step 2. Markup transformations <openvino_docs_IE_DG_lpt_step2_markup>
|
||||
Step 3. Main transformations <openvino_docs_IE_DG_lpt_step3_main>
|
||||
Step 4. Cleanup transformations <openvino_docs_IE_DG_lpt_step4_cleanup>
|
||||
Attributes <openvino_docs_OV_UG_lpt_attributes>
|
||||
Step 1. Prerequisites transformations <openvino_docs_OV_UG_lpt_step1_prerequisites>
|
||||
Step 2. Markup transformations <openvino_docs_OV_UG_lpt_step2_markup>
|
||||
Step 3. Main transformations <openvino_docs_OV_UG_lpt_step3_main>
|
||||
Step 4. Cleanup transformations <openvino_docs_OV_UG_lpt_step4_cleanup>
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
@@ -72,11 +72,7 @@ For example, if you would like to infer a model with `Convolution` operation in
|
||||
> There are several supported quantization approaches on activations and on weights. All supported approaches are described in [Quantization approaches](#quantization-approaches) section below. In demonstrated model [FakeQuantize operation quantization](#fakequantize-operation) approach is used.
|
||||
|
||||
### Low precision tools
|
||||
There are two tools to quantize a model:
|
||||
1. [Post-Training Optimization Toolkit](@ref pot_docs_LowPrecisionOptimizationGuide) (POT)
|
||||
2. [Neural Network Compression Framework](https://github.com/openvinotoolkit/nncf) (NNCF)
|
||||
|
||||
Additionally, low precision transformations can handle ONNX quantized models.
|
||||
For more details on how to get a quantized model, refer to [Model Optimization](@ref openvino_docs_model_optimization_guide) document.
|
||||
|
||||
## Quantization approaches
|
||||
LPT transformations support two quantization approaches:
|
||||
@@ -115,63 +111,63 @@ Inside each step LPT transformations handle input model operation by operation,
|
||||
As result, usually all operations are inferred by plugin in low precision. If plugin doesn't support an operation inference in low precision, then corresponding LPT transformation can be disabled, and input tensor precisions for the operation will not be changed. In this case the operation is inferred in the original precision.
|
||||
|
||||
Low precision transformations pipeline includes four steps:
|
||||
* [Step #1: Prerequisites](@ref openvino_docs_IE_DG_lpt_step1_prerequisites)
|
||||
* [Step #2: Markup transformations](@ref openvino_docs_IE_DG_lpt_step2_markup)
|
||||
* [Step #3: Main transformations](@ref openvino_docs_IE_DG_lpt_step3_main)
|
||||
* [Step #4: Cleanup transformations](@ref openvino_docs_IE_DG_lpt_step4_cleanup)
|
||||
* [Step #1: Prerequisites](@ref openvino_docs_OV_UG_lpt_step1_prerequisites)
|
||||
* [Step #2: Markup transformations](@ref openvino_docs_OV_UG_lpt_step2_markup)
|
||||
* [Step #3: Main transformations](@ref openvino_docs_OV_UG_lpt_step3_main)
|
||||
* [Step #4: Cleanup transformations](@ref openvino_docs_OV_UG_lpt_step4_cleanup)
|
||||
|
||||
### Step 1. Prerequisites
|
||||
This step fuses and propagates some operations in the model to prepare for the next step. It is required for OpenVINO plugins. Transformations:
|
||||
* [PullReshapeThroughDequantization](@ref openvino_docs_IE_DG_lpt_PullReshapeThroughDequantization)
|
||||
* [PullTransposeThroughDequantization](@ref openvino_docs_IE_DG_lpt_PullTransposeThroughDequantization)
|
||||
* [LinOpSequenceFusion](@ref openvino_docs_IE_DG_lpt_LinOpSequenceFusion)
|
||||
* [PullReshapeThroughDequantization](@ref openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization)
|
||||
* [PullTransposeThroughDequantization](@ref openvino_docs_OV_UG_lpt_PullTransposeThroughDequantization)
|
||||
* [LinOpSequenceFusion](@ref openvino_docs_OV_UG_lpt_LinOpSequenceFusion)
|
||||
|
||||
The model on this step is changed. There are more details in developer guide [Prerequisites transformations](@ref openvino_docs_IE_DG_lpt_step1_prerequisites).
|
||||
The model on this step is changed. There are more details in developer guide [Prerequisites transformations](@ref openvino_docs_OV_UG_lpt_step1_prerequisites).
|
||||
|
||||
### Step 2. Markup
|
||||
This step creates runtime attributes for operations. These attributes will be used in next step. Transformations:
|
||||
* [MarkupCanBeQuantized](@ref openvino_docs_IE_DG_lpt_MarkupCanBeQuantized)
|
||||
* [MarkupPrecisions](@ref openvino_docs_IE_DG_lpt_MarkupPrecisions)
|
||||
* [MarkupPerTensorQuantization](@ref openvino_docs_IE_DG_lpt_MarkupPerTensorQuantization)
|
||||
* [MarkupAvgPoolPrecisionPreserved](@ref openvino_docs_IE_DG_lpt_MarkupAvgPoolPrecisionPreserved)
|
||||
* [PropagatePrecisions](@ref openvino_docs_IE_DG_lpt_PropagatePrecisions)
|
||||
* [AlignQuantizationIntervals](@ref openvino_docs_IE_DG_lpt_AlignQuantizationIntervals)
|
||||
* [AlignQuantizationParameters](@ref openvino_docs_IE_DG_lpt_AlignQuantizationParameters)
|
||||
* [MarkupCanBeQuantized](@ref openvino_docs_OV_UG_lpt_MarkupCanBeQuantized)
|
||||
* [MarkupPrecisions](@ref openvino_docs_OV_UG_lpt_MarkupPrecisions)
|
||||
* [MarkupPerTensorQuantization](@ref openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization)
|
||||
* [MarkupAvgPoolPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved)
|
||||
* [PropagatePrecisions](@ref openvino_docs_OV_UG_lpt_PropagatePrecisions)
|
||||
* [AlignQuantizationIntervals](@ref openvino_docs_OV_UG_lpt_AlignQuantizationIntervals)
|
||||
* [AlignQuantizationParameters](@ref openvino_docs_OV_UG_lpt_AlignQuantizationParameters)
|
||||
|
||||
The model on this step is changed: only new attributes are added to some operations. There are more details in developer guide [Markup transformations](@ref openvino_docs_IE_DG_lpt_step2_markup).
|
||||
The model on this step is changed: only new attributes are added to some operations. There are more details in developer guide [Markup transformations](@ref openvino_docs_OV_UG_lpt_step2_markup).
|
||||
|
||||
### Step 3. Main transformations, FakeQuantize decomposition and dequantization operations handling
|
||||
This step has the most transformations. These transformations can be separated in two groups: decomposition transformation and dequantization operations handling. There are more details in developer guide [Main transformations](@ref openvino_docs_IE_DG_lpt_step3_main). Transformations:
|
||||
* [AddTransformation](@ref openvino_docs_IE_DG_lpt_AddTransformation)
|
||||
* [AvgPoolTransformation](@ref openvino_docs_IE_DG_lpt_AvgPoolTransformation)
|
||||
* [ClampTransformation](@ref openvino_docs_IE_DG_lpt_AvgPoolTransformation)
|
||||
* [ConcatTransformation](@ref openvino_docs_IE_DG_lpt_ConcatTransformation)
|
||||
* [ConvolutionTransformation](@ref openvino_docs_IE_DG_lpt_ConvolutionTransformation)
|
||||
* [ConvolutionBackpropDataTransformation](@ref openvino_docs_IE_DG_lpt_ConvolutionBackpropDataTransformation)
|
||||
* [DepthToSpaceTransformation](@ref openvino_docs_IE_DG_lpt_DepthToSpaceTransformation)
|
||||
* [FakeQuantizeDecompositionTransformation](@ref openvino_docs_IE_DG_lpt_FakeQuantizeDecompositionTransformation)
|
||||
* [FakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FakeQuantizeTransformation)
|
||||
* [InterpolateTransformation](@ref openvino_docs_IE_DG_lpt_InterpolateTransformation)
|
||||
* [GroupConvolutionTransformation](@ref openvino_docs_IE_DG_lpt_GroupConvolutionTransformation)
|
||||
* [MatMulTransformation](@ref openvino_docs_IE_DG_lpt_MatMulTransformation)
|
||||
* [MaxPoolTransformation](@ref openvino_docs_IE_DG_lpt_MaxPoolTransformation)
|
||||
* [MultiplyTransformation](@ref openvino_docs_IE_DG_lpt_MultiplyTransformation)
|
||||
* [MVNTransformation](@ref openvino_docs_IE_DG_lpt_MVNTransformation)
|
||||
* [NormalizeL2Transformation](@ref openvino_docs_IE_DG_lpt_NormalizeL2Transformation)
|
||||
* [PReluTransformation](@ref openvino_docs_IE_DG_lpt_PReluTransformation)
|
||||
* [ReduceMaxTransformation](@ref openvino_docs_IE_DG_lpt_ReduceMaxTransformation)
|
||||
* [ReduceMeanTransformation](@ref openvino_docs_IE_DG_lpt_ReduceMeanTransformation)
|
||||
* [ReduceMinTransformation](@ref openvino_docs_IE_DG_lpt_ReduceMinTransformation)
|
||||
* [ReduceSumTransformation](@ref openvino_docs_IE_DG_lpt_ReduceSumTransformation)
|
||||
* [ReluTransformation](@ref openvino_docs_IE_DG_lpt_ReluTransformation)
|
||||
* [ReshapeTransformation](@ref openvino_docs_IE_DG_lpt_ReshapeTransformation)
|
||||
* [SqueezeTransformation](@ref openvino_docs_IE_DG_lpt_SqueezeTransformation)
|
||||
* [ShuffleChannelsTransformation](@ref openvino_docs_IE_DG_lpt_ShuffleChannelsTransformation)
|
||||
* [SplitTransformation](@ref openvino_docs_IE_DG_lpt_SplitTransformation)
|
||||
* [StridedSliceTransformation](@ref openvino_docs_IE_DG_lpt_StridedSliceTransformation)
|
||||
* [TransposeTransformation](@ref openvino_docs_IE_DG_lpt_TransposeTransformation)
|
||||
* [UnsqueezeTransformation](@ref openvino_docs_IE_DG_lpt_UnsqueezeTransformation)
|
||||
* [VariadicSplitTransformation](@ref openvino_docs_IE_DG_lpt_VariadicSplitTransformation)
|
||||
This step has the most transformations. These transformations can be separated in two groups: decomposition transformation and dequantization operations handling. There are more details in developer guide [Main transformations](@ref openvino_docs_OV_UG_lpt_step3_main). Transformations:
|
||||
* [AddTransformation](@ref openvino_docs_OV_UG_lpt_AddTransformation)
|
||||
* [AvgPoolTransformation](@ref openvino_docs_OV_UG_lpt_AvgPoolTransformation)
|
||||
* [ClampTransformation](@ref openvino_docs_OV_UG_lpt_AvgPoolTransformation)
|
||||
* [ConcatTransformation](@ref openvino_docs_OV_UG_lpt_ConcatTransformation)
|
||||
* [ConvolutionTransformation](@ref openvino_docs_OV_UG_lpt_ConvolutionTransformation)
|
||||
* [ConvolutionBackpropDataTransformation](@ref openvino_docs_OV_UG_lpt_ConvolutionBackpropDataTransformation)
|
||||
* [DepthToSpaceTransformation](@ref openvino_docs_OV_UG_lpt_DepthToSpaceTransformation)
|
||||
* [FakeQuantizeDecompositionTransformation](@ref openvino_docs_OV_UG_lpt_FakeQuantizeDecompositionTransformation)
|
||||
* [FakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FakeQuantizeTransformation)
|
||||
* [InterpolateTransformation](@ref openvino_docs_OV_UG_lpt_InterpolateTransformation)
|
||||
* [GroupConvolutionTransformation](@ref openvino_docs_OV_UG_lpt_GroupConvolutionTransformation)
|
||||
* [MatMulTransformation](@ref openvino_docs_OV_UG_lpt_MatMulTransformation)
|
||||
* [MaxPoolTransformation](@ref openvino_docs_OV_UG_lpt_MaxPoolTransformation)
|
||||
* [MultiplyTransformation](@ref openvino_docs_OV_UG_lpt_MultiplyTransformation)
|
||||
* [MVNTransformation](@ref openvino_docs_OV_UG_lpt_MVNTransformation)
|
||||
* [NormalizeL2Transformation](@ref openvino_docs_OV_UG_lpt_NormalizeL2Transformation)
|
||||
* [PReluTransformation](@ref openvino_docs_OV_UG_lpt_PReluTransformation)
|
||||
* [ReduceMaxTransformation](@ref openvino_docs_OV_UG_lpt_ReduceMaxTransformation)
|
||||
* [ReduceMeanTransformation](@ref openvino_docs_OV_UG_lpt_ReduceMeanTransformation)
|
||||
* [ReduceMinTransformation](@ref openvino_docs_OV_UG_lpt_ReduceMinTransformation)
|
||||
* [ReduceSumTransformation](@ref openvino_docs_OV_UG_lpt_ReduceSumTransformation)
|
||||
* [ReluTransformation](@ref openvino_docs_OV_UG_lpt_ReluTransformation)
|
||||
* [ReshapeTransformation](@ref openvino_docs_OV_UG_lpt_ReshapeTransformation)
|
||||
* [SqueezeTransformation](@ref openvino_docs_OV_UG_lpt_SqueezeTransformation)
|
||||
* [ShuffleChannelsTransformation](@ref openvino_docs_OV_UG_lpt_ShuffleChannelsTransformation)
|
||||
* [SplitTransformation](@ref openvino_docs_OV_UG_lpt_SplitTransformation)
|
||||
* [StridedSliceTransformation](@ref openvino_docs_OV_UG_lpt_StridedSliceTransformation)
|
||||
* [TransposeTransformation](@ref openvino_docs_OV_UG_lpt_TransposeTransformation)
|
||||
* [UnsqueezeTransformation](@ref openvino_docs_OV_UG_lpt_UnsqueezeTransformation)
|
||||
* [VariadicSplitTransformation](@ref openvino_docs_OV_UG_lpt_VariadicSplitTransformation)
|
||||
|
||||
#### Decomposition transformations
|
||||
Decomposition transformations decompose the `FakeQuantize` operation to: quantize (`FakeQuantize` with low precision output) and dequantization operations (opposite to quantize, with low precision input and the original precision output). For dequantization operations LPT uses three operations: `Convert`, `Subtract` and `Multiply`. Element-wise operations `Subtract` and `Multiply` have constants on the second branches. If dequantization operations are not handled at the end of LPT pipeline, then they will be fused back to the `FakeQuantize`.
|
||||
@@ -197,14 +193,14 @@ Original `Convolution` operation in FP32 with dequantization operations before:
|
||||
|
||||
### Step 4: Cleanup of the result model
|
||||
LPT cleanup transformations is final stage in LPT pipeline. In this step LPT transformations clean up the result model to avoid not handled dequantization operations: fuse dequantization operations if possible (fuse at least `Convert` operations if not) to other model operations to cleanup result model. Transformations:
|
||||
* [FoldConvertTransformation](@ref openvino_docs_IE_DG_lpt_FoldConvertTransformation)
|
||||
* [FoldFakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FoldFakeQuantizeTransformation)
|
||||
* [FuseConvertTransformation](@ref openvino_docs_IE_DG_lpt_FuseConvertTransformation)
|
||||
* [FuseMultiplyToFakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FuseMultiplyToFakeQuantizeTransformation)
|
||||
* [FuseSubtractToFakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FuseSubtractToFakeQuantizeTransformation)
|
||||
* [MultiplyToGroupConvolutionTransformation](@ref openvino_docs_IE_DG_lpt_MultiplyToGroupConvolutionTransformation)
|
||||
* [FoldConvertTransformation](@ref openvino_docs_OV_UG_lpt_FoldConvertTransformation)
|
||||
* [FoldFakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FoldFakeQuantizeTransformation)
|
||||
* [FuseConvertTransformation](@ref openvino_docs_OV_UG_lpt_FuseConvertTransformation)
|
||||
* [FuseMultiplyToFakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FuseMultiplyToFakeQuantizeTransformation)
|
||||
* [FuseSubtractToFakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FuseSubtractToFakeQuantizeTransformation)
|
||||
* [MultiplyToGroupConvolutionTransformation](@ref openvino_docs_OV_UG_lpt_MultiplyToGroupConvolutionTransformation)
|
||||
|
||||
There are more details in developer guide [Cleanup transformations](@ref openvino_docs_IE_DG_lpt_step4_cleanup).
|
||||
There are more details in developer guide [Cleanup transformations](@ref openvino_docs_OV_UG_lpt_step4_cleanup).
|
||||
|
||||
`FakeQuantize` operation with not handled dequantization operations:
|
||||

|
||||
@@ -220,27 +216,27 @@ Typical transformation pipeline described below.
|
||||
### Step 1. Common optimizations
|
||||
This step is optional for LPT but typically is presented in OpenVINO™ plugins. The step doesn't use any LPT transformation. Firstly, the step disables dequantization operations constant folding on constant subgraph on weights to prevent the lost of dequantization info on the next plugin transformations. After that, it optimizes nGraph function and convert operations to operation set 1. Typically, usage of this step is the simplest way to meet LPT requirements for the input quantized model. If plugin can guarantee that LPT input requirements are met, then this step can be skipped.
|
||||
|
||||
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_common
|
||||
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_common
|
||||
|
||||
### Step 2. Low precision transformations execution
|
||||
This step is mandatory. It configures and runs LPT transformations.
|
||||
|
||||
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_execution
|
||||
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_execution
|
||||
|
||||
### Step 3. Plugin-specific transformations
|
||||
This step is optional. It modifies the nGraph function to a device-specific operation set.
|
||||
|
||||
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_device
|
||||
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_device
|
||||
|
||||
## Result model overview
|
||||
|
||||
Let's explore quantized [TensorFlow* implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model. Use [Model Downloader](@ref omz_tools_downloader) tool to download the `fp16` model from [OpenVINO™ Toolkit - Open Model Zoo repository](https://github.com/openvinotoolkit/open_model_zoo):
|
||||
```sh
|
||||
./downloader.py --name resnet-50-tf --precisions FP16-INT8
|
||||
omz_downloader --name resnet-50-tf --precisions FP16-INT8
|
||||
```
|
||||
After that you should quantize model by the [Model Quantizer](@ref omz_tools_downloader) tool.
|
||||
```sh
|
||||
./quantizer.py --model_dir public/resnet-50-tf --dataset_dir <DATASET_DIR> --precisions=FP16-INT8
|
||||
omz_quantizer --model_dir public/resnet-50-tf --dataset_dir <DATASET_DIR> --precisions=FP16-INT8
|
||||
```
|
||||
|
||||
### Inference
|
||||
@@ -259,7 +255,7 @@ Result model depends on different factors:
|
||||
|
||||
|
||||
Information about layer precision is stored in the performance counters that are
|
||||
available from the Inference Engine API. For example, the part of performance counters table for quantized [TensorFlow* implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model inference on CPU Plugin looks as follows:
|
||||
available from the OpenVINO Runtime API. For example, the part of performance counters table for quantized [TensorFlow* implementation of ResNet-50](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf) model inference on CPU Plugin looks as follows:
|
||||
|
||||
|
||||
| layerName | execStatus | layerType | execType | realTime (ms) | cpuTime (ms) |
|
||||
@@ -298,14 +294,14 @@ Low Precision Transformations can be customizable. Build-in customization option
|
||||
### Operation precision restrictions
|
||||
This option defines precisions which allowed for the operation input ports. The option value is passed as input argument for `LowPrecision` constructor. For example:
|
||||
|
||||
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_supported_precisions
|
||||
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_supported_precisions
|
||||
|
||||
In provided example in result model `Convolution` operation inputs must have specific precisions: `u8` (unsigned int8) precision on input 0 (on activations) and `i8` (signed int8) precision on input 1 (on weights).
|
||||
|
||||
### Operation per tensor quantization restrictions
|
||||
This option defines if operation supports per-tensor quantization only. The option value is passed as input argument for `LowPrecision` constructor. For example:
|
||||
|
||||
@snippet snippets/lpt_mkldnn_plugin.cpp per_tensor_quantization
|
||||
@snippet snippets/lpt_intel_cpu_plugin.cpp per_tensor_quantization
|
||||
|
||||
In provided example in result model `Convolution` operations must have per-tensor quantization on input 0 (on activations).
|
||||
|
||||
@@ -316,4 +312,4 @@ This option defines if each LPT transformation updates precision or not. The opt
|
||||
|
||||
Plugin specific customization can be implemented via nGraph transformation callbacks. For example: asymmetric quantization support can be easily customizable via `LayerTransformation::isAsymmetricQuantization` and `WeightableLayerTransformation::isAsymmetricOnWeights` methods usage in callbacks. For example:
|
||||
|
||||
@snippet snippets/lpt_mkldnn_plugin.cpp asymmetric_quantization
|
||||
@snippet snippets/lpt_intel_cpu_plugin.cpp asymmetric_quantization
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Attributes {#openvino_docs_IE_DG_lpt_attributes}
|
||||
# Attributes {#openvino_docs_OV_UG_lpt_attributes}
|
||||
|
||||
@sphinxdirective
|
||||
|
||||
@@ -7,30 +7,31 @@
|
||||
:caption: Attributes
|
||||
:hidden:
|
||||
|
||||
AvgPoolPrecisionPreserved <openvino_docs_IE_DG_lpt_AvgPoolPrecisionPreserved>
|
||||
IntervalsAlignment <openvino_docs_IE_DG_lpt_IntervalsAlignment>
|
||||
PerTensorQuantization <openvino_docs_IE_DG_lpt_PerTensorQuantization>
|
||||
PrecisionPreserved <openvino_docs_IE_DG_lpt_PrecisionPreserved>
|
||||
Precisions <openvino_docs_IE_DG_lpt_Precisions>
|
||||
QuantizationAlignment <openvino_docs_IE_DG_lpt_QuantizationAlignment>
|
||||
AvgPoolPrecisionPreserved <openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved>
|
||||
IntervalsAlignment <openvino_docs_OV_UG_lpt_IntervalsAlignment>
|
||||
PrecisionPreserved <openvino_docs_OV_UG_lpt_PrecisionPreserved>
|
||||
Precisions <openvino_docs_OV_UG_lpt_Precisions>
|
||||
QuantizationAlignment <openvino_docs_OV_UG_lpt_QuantizationAlignment>
|
||||
QuantizationGranularity <openvino_docs_OV_UG_lpt_QuantizationGranularity>
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
## Introduction
|
||||
|
||||
| Name | Target | Required | Mutable |
|
||||
|-------------------------------------------------------------------------------------|------------------------|----------|---------|
|
||||
| [AvgPoolPrecisionPreserved](@ref openvino_docs_IE_DG_lpt_AvgPoolPrecisionPreserved) | Precision | No | Yes |
|
||||
| [IntervalsAlignment](@ref openvino_docs_IE_DG_lpt_IntervalsAlignment) | Quantization interval | Yes | Yes |
|
||||
| [PerTensorQuantization](@ref openvino_docs_IE_DG_lpt_PerTensorQuantization) | Precision | Yes | No |
|
||||
| [PrecisionPreserved](@ref openvino_docs_IE_DG_lpt_PrecisionPreserved) | Precision | Yes | Yes |
|
||||
| [Precisions](@ref openvino_docs_IE_DG_lpt_Precisions) | Precision | Yes | Yes |
|
||||
| [QuantizationAlignment](@ref openvino_docs_IE_DG_lpt_QuantizationAlignment) | Quantization alignment | Yes | Yes |
|
||||
| Name | Target | Required | Mutable |
|
||||
|-------------------------------------------------------------------------------------|--------------------------|----------|---------|
|
||||
| [AvgPoolPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved) | Precision | No | Yes |
|
||||
| [IntervalsAlignment](@ref openvino_docs_OV_UG_lpt_IntervalsAlignment) | Quantization interval | Yes | Yes |
|
||||
| [PrecisionPreserved](@ref openvino_docs_OV_UG_lpt_PrecisionPreserved) | Precision | Yes | Yes |
|
||||
| [Precisions](@ref openvino_docs_OV_UG_lpt_Precisions) | Precision | Yes | Yes |
|
||||
| [QuantizationAlignment](@ref openvino_docs_OV_UG_lpt_QuantizationAlignment) | Quantization granularity | Yes | Yes |
|
||||
| [QuantizationGranularity](@ref openvino_docs_OV_UG_lpt_QuantizationGranularity) | Quantization granularity | Yes | No |
|
||||
|
||||
> `Target` attribute group defines attribute usage during model transformation for the best performance:
|
||||
> - `Precision` - the attribute defines the most optimal output port precision.
|
||||
> - `Quantization interval` - the attribute defines quantization interval.
|
||||
> - `Quantization alignment` - the attribute defines quantization alignment: per-channel or per-tensor quantization.
|
||||
> - `Quantization alignment` - the attribute defines quantization granularity in runtime: per-channel or per-tensor quantization.
|
||||
> - `Quantization granularity` - the attribute is set by plugin to define quantization granularity: per-channel or per-tensor quantization.
|
||||
>
|
||||
> `Required` attribute group defines if attribute usage is required to get an optimal model during transformation:
|
||||
> - `Yes` - the attribute is used by all OpenVINO plugins for low-precision optimization.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Step 1. Prerequisites Transformations {#openvino_docs_IE_DG_lpt_step1_prerequisites}
|
||||
# Step 1. Prerequisites Transformations {#openvino_docs_OV_UG_lpt_step1_prerequisites}
|
||||
|
||||
Prerequisites transformations are optional. The transformations prepare a model before running other low precision transformations. The transformations do not operate with dequantization operations or update precisions. Prerequisites transformations include:
|
||||
* [PullReshapeThroughDequantization](@ref openvino_docs_IE_DG_lpt_PullReshapeThroughDequantization)
|
||||
* [PullTransposeThroughDequantization](@ref openvino_docs_IE_DG_lpt_PullTransposeThroughDequantization)
|
||||
* [LinOpSequenceFusion](@ref openvino_docs_IE_DG_lpt_LinOpSequenceFusion)
|
||||
* [PullReshapeThroughDequantization](@ref openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization)
|
||||
* [PullTransposeThroughDequantization](@ref openvino_docs_OV_UG_lpt_PullTransposeThroughDequantization)
|
||||
* [LinOpSequenceFusion](@ref openvino_docs_OV_UG_lpt_LinOpSequenceFusion)
|
||||
@@ -1,14 +1,14 @@
|
||||
# Step 2. Markup Transformations {#openvino_docs_IE_DG_lpt_step2_markup}
|
||||
# Step 2. Markup Transformations {#openvino_docs_OV_UG_lpt_step2_markup}
|
||||
|
||||
This step defines the optimal `FakeQuantize` decomposition precisions for the best inference performance via operations markup with runtime attribute instances. Attributes are created for input and output ports and operations. Transformations do not change the operation output port precisions. A model markup low precision logic is decomposed and implemented into the following common markup transformations. The order of transformations is important:
|
||||
|
||||
1. [MarkupCanBeQuantized](@ref openvino_docs_IE_DG_lpt_MarkupCanBeQuantized)
|
||||
2. [MarkupPrecisions](@ref openvino_docs_IE_DG_lpt_MarkupPrecisions)
|
||||
3. [MarkupPerTensorQuantization](@ref openvino_docs_IE_DG_lpt_MarkupPerTensorQuantization)
|
||||
4. [MarkupAvgPoolPrecisionPreserved](@ref openvino_docs_IE_DG_lpt_MarkupAvgPoolPrecisionPreserved)
|
||||
5. [PropagatePrecisions](@ref openvino_docs_IE_DG_lpt_PropagatePrecisions)
|
||||
6. [AlignQuantizationIntervals](@ref openvino_docs_IE_DG_lpt_AlignQuantizationIntervals)
|
||||
7. [AlignQuantizationParameters](@ref openvino_docs_IE_DG_lpt_AlignQuantizationParameters)
|
||||
1. [MarkupCanBeQuantized](@ref openvino_docs_OV_UG_lpt_MarkupCanBeQuantized)
|
||||
2. [MarkupPrecisions](@ref openvino_docs_OV_UG_lpt_MarkupPrecisions)
|
||||
3. [MarkupPerTensorQuantization](@ref openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization)
|
||||
4. [MarkupAvgPoolPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved)
|
||||
5. [PropagatePrecisions](@ref openvino_docs_OV_UG_lpt_PropagatePrecisions)
|
||||
6. [AlignQuantizationIntervals](@ref openvino_docs_OV_UG_lpt_AlignQuantizationIntervals)
|
||||
7. [AlignQuantizationParameters](@ref openvino_docs_OV_UG_lpt_AlignQuantizationParameters)
|
||||
|
||||
The table of transformations and used attributes:
|
||||
|
||||
@@ -25,11 +25,11 @@ The table of transformations and used attributes:
|
||||
> **Note:** the same type of attribute instances can be created in different transformations. This approach is the result of the transformation single-responsibility principle. For example, `Precision` attribute instances are created in `MarkupCanBeQuantized` and `MarkupPrecisions` transformations, but the reasons for their creation are different
|
||||
|
||||
Common markup transformations can be decomposed into simpler utility markup transformations. The order of Markup utility transformations is not important:
|
||||
* [CreateAttribute](@ref openvino_docs_IE_DG_lpt_CreateAttribute)
|
||||
* [CreatePrecisionsDependentAttribute](@ref openvino_docs_IE_DG_lpt_CreatePrecisionsDependentAttribute)
|
||||
* [PropagateThroughPrecisionPreserved](@ref openvino_docs_IE_DG_lpt_PropagateThroughPrecisionPreserved)
|
||||
* [PropagateToInput](@ref openvino_docs_IE_DG_lpt_PropagateToInput)
|
||||
* [UpdateSharedPrecisionPreserved](@ref openvino_docs_IE_DG_lpt_UpdateSharedPrecisionPreserved)
|
||||
* [CreateAttribute](@ref openvino_docs_OV_UG_lpt_CreateAttribute)
|
||||
* [CreatePrecisionsDependentAttribute](@ref openvino_docs_OV_UG_lpt_CreatePrecisionsDependentAttribute)
|
||||
* [PropagateThroughPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_PropagateThroughPrecisionPreserved)
|
||||
* [PropagateToInput](@ref openvino_docs_OV_UG_lpt_PropagateToInput)
|
||||
* [UpdateSharedPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_UpdateSharedPrecisionPreserved)
|
||||
|
||||
Let's explore all transformations and their relations in detail, using one and the same model:
|
||||
|
||||
@@ -44,7 +44,7 @@ The original model key features:
|
||||
|
||||
Transformations are run with the following parameters:
|
||||
|
||||
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_markup_pipeline
|
||||
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_markup_pipeline
|
||||
|
||||
## 1. MarkupCanBeQuantized
|
||||
The transformation marks operations that cannot be quantized. No attributes are required before the transformation.
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
# Step 3. Main Transformations {#openvino_docs_IE_DG_lpt_step3_main}
|
||||
# Step 3. Main Transformations {#openvino_docs_OV_UG_lpt_step3_main}
|
||||
|
||||
Main transformations are the majority of low precision transformations. Transformations operate with dequantization operations. Main transformations include:
|
||||
* [AddTransformation](@ref openvino_docs_IE_DG_lpt_AddTransformation)
|
||||
* [AvgPoolTransformation](@ref openvino_docs_IE_DG_lpt_AvgPoolTransformation)
|
||||
* [ClampTransformation](@ref openvino_docs_IE_DG_lpt_AvgPoolTransformation)
|
||||
* [ConcatTransformation](@ref openvino_docs_IE_DG_lpt_ConcatTransformation)
|
||||
* [ConvolutionTransformation](@ref openvino_docs_IE_DG_lpt_ConvolutionTransformation)
|
||||
* [ConvolutionBackpropDataTransformation](@ref openvino_docs_IE_DG_lpt_ConvolutionBackpropDataTransformation)
|
||||
* [DepthToSpaceTransformation](@ref openvino_docs_IE_DG_lpt_DepthToSpaceTransformation)
|
||||
* [FakeQuantizeDecompositionTransformation](@ref openvino_docs_IE_DG_lpt_FakeQuantizeDecompositionTransformation)
|
||||
* [FakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FakeQuantizeTransformation)
|
||||
* [InterpolateTransformation](@ref openvino_docs_IE_DG_lpt_InterpolateTransformation)
|
||||
* [GroupConvolutionTransformation](@ref openvino_docs_IE_DG_lpt_GroupConvolutionTransformation)
|
||||
* [MatMulTransformation](@ref openvino_docs_IE_DG_lpt_MatMulTransformation)
|
||||
* [MaxPoolTransformation](@ref openvino_docs_IE_DG_lpt_MaxPoolTransformation)
|
||||
* [MultiplyTransformation](@ref openvino_docs_IE_DG_lpt_MultiplyTransformation)
|
||||
* [MVNTransformation](@ref openvino_docs_IE_DG_lpt_MVNTransformation)
|
||||
* [NormalizeL2Transformation](@ref openvino_docs_IE_DG_lpt_NormalizeL2Transformation)
|
||||
* [PReluTransformation](@ref openvino_docs_IE_DG_lpt_PReluTransformation)
|
||||
* [ReduceMaxTransformation](@ref openvino_docs_IE_DG_lpt_ReduceMaxTransformation)
|
||||
* [ReduceMeanTransformation](@ref openvino_docs_IE_DG_lpt_ReduceMeanTransformation)
|
||||
* [ReduceMinTransformation](@ref openvino_docs_IE_DG_lpt_ReduceMinTransformation)
|
||||
* [ReduceSumTransformation](@ref openvino_docs_IE_DG_lpt_ReduceSumTransformation)
|
||||
* [ReluTransformation](@ref openvino_docs_IE_DG_lpt_ReluTransformation)
|
||||
* [ReshapeTransformation](@ref openvino_docs_IE_DG_lpt_ReshapeTransformation)
|
||||
* [SqueezeTransformation](@ref openvino_docs_IE_DG_lpt_SqueezeTransformation)
|
||||
* [ShuffleChannelsTransformation](@ref openvino_docs_IE_DG_lpt_ShuffleChannelsTransformation)
|
||||
* [SplitTransformation](@ref openvino_docs_IE_DG_lpt_SplitTransformation)
|
||||
* [StridedSliceTransformation](@ref openvino_docs_IE_DG_lpt_StridedSliceTransformation)
|
||||
* [TransposeTransformation](@ref openvino_docs_IE_DG_lpt_TransposeTransformation)
|
||||
* [UnsqueezeTransformation](@ref openvino_docs_IE_DG_lpt_UnsqueezeTransformation)
|
||||
* [VariadicSplitTransformation](@ref openvino_docs_IE_DG_lpt_VariadicSplitTransformation)
|
||||
* [AddTransformation](@ref openvino_docs_OV_UG_lpt_AddTransformation)
|
||||
* [AvgPoolTransformation](@ref openvino_docs_OV_UG_lpt_AvgPoolTransformation)
|
||||
* [ClampTransformation](@ref openvino_docs_OV_UG_lpt_AvgPoolTransformation)
|
||||
* [ConcatTransformation](@ref openvino_docs_OV_UG_lpt_ConcatTransformation)
|
||||
* [ConvolutionTransformation](@ref openvino_docs_OV_UG_lpt_ConvolutionTransformation)
|
||||
* [ConvolutionBackpropDataTransformation](@ref openvino_docs_OV_UG_lpt_ConvolutionBackpropDataTransformation)
|
||||
* [DepthToSpaceTransformation](@ref openvino_docs_OV_UG_lpt_DepthToSpaceTransformation)
|
||||
* [FakeQuantizeDecompositionTransformation](@ref openvino_docs_OV_UG_lpt_FakeQuantizeDecompositionTransformation)
|
||||
* [FakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FakeQuantizeTransformation)
|
||||
* [InterpolateTransformation](@ref openvino_docs_OV_UG_lpt_InterpolateTransformation)
|
||||
* [GroupConvolutionTransformation](@ref openvino_docs_OV_UG_lpt_GroupConvolutionTransformation)
|
||||
* [MatMulTransformation](@ref openvino_docs_OV_UG_lpt_MatMulTransformation)
|
||||
* [MaxPoolTransformation](@ref openvino_docs_OV_UG_lpt_MaxPoolTransformation)
|
||||
* [MultiplyTransformation](@ref openvino_docs_OV_UG_lpt_MultiplyTransformation)
|
||||
* [MVNTransformation](@ref openvino_docs_OV_UG_lpt_MVNTransformation)
|
||||
* [NormalizeL2Transformation](@ref openvino_docs_OV_UG_lpt_NormalizeL2Transformation)
|
||||
* [PReluTransformation](@ref openvino_docs_OV_UG_lpt_PReluTransformation)
|
||||
* [ReduceMaxTransformation](@ref openvino_docs_OV_UG_lpt_ReduceMaxTransformation)
|
||||
* [ReduceMeanTransformation](@ref openvino_docs_OV_UG_lpt_ReduceMeanTransformation)
|
||||
* [ReduceMinTransformation](@ref openvino_docs_OV_UG_lpt_ReduceMinTransformation)
|
||||
* [ReduceSumTransformation](@ref openvino_docs_OV_UG_lpt_ReduceSumTransformation)
|
||||
* [ReluTransformation](@ref openvino_docs_OV_UG_lpt_ReluTransformation)
|
||||
* [ReshapeTransformation](@ref openvino_docs_OV_UG_lpt_ReshapeTransformation)
|
||||
* [SqueezeTransformation](@ref openvino_docs_OV_UG_lpt_SqueezeTransformation)
|
||||
* [ShuffleChannelsTransformation](@ref openvino_docs_OV_UG_lpt_ShuffleChannelsTransformation)
|
||||
* [SplitTransformation](@ref openvino_docs_OV_UG_lpt_SplitTransformation)
|
||||
* [StridedSliceTransformation](@ref openvino_docs_OV_UG_lpt_StridedSliceTransformation)
|
||||
* [TransposeTransformation](@ref openvino_docs_OV_UG_lpt_TransposeTransformation)
|
||||
* [UnsqueezeTransformation](@ref openvino_docs_OV_UG_lpt_UnsqueezeTransformation)
|
||||
* [VariadicSplitTransformation](@ref openvino_docs_OV_UG_lpt_VariadicSplitTransformation)
|
||||
|
||||
Let's explore some main transformations on the example model. Original model:
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Step 4. Cleanup Transformations {#openvino_docs_IE_DG_lpt_step4_cleanup}
|
||||
# Step 4. Cleanup Transformations {#openvino_docs_OV_UG_lpt_step4_cleanup}
|
||||
|
||||
* [FoldConvertTransformation](@ref openvino_docs_IE_DG_lpt_FoldConvertTransformation)
|
||||
* [FoldFakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FoldFakeQuantizeTransformation)
|
||||
* [FuseConvertTransformation](@ref openvino_docs_IE_DG_lpt_FuseConvertTransformation)
|
||||
* [FuseMultiplyToFakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FuseMultiplyToFakeQuantizeTransformation)
|
||||
* [FuseSubtractToFakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FuseSubtractToFakeQuantizeTransformation)
|
||||
* [MultiplyToGroupConvolutionTransformation](@ref openvino_docs_IE_DG_lpt_MultiplyToGroupConvolutionTransformation)
|
||||
* [FoldConvertTransformation](@ref openvino_docs_OV_UG_lpt_FoldConvertTransformation)
|
||||
* [FoldFakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FoldFakeQuantizeTransformation)
|
||||
* [FuseConvertTransformation](@ref openvino_docs_OV_UG_lpt_FuseConvertTransformation)
|
||||
* [FuseMultiplyToFakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FuseMultiplyToFakeQuantizeTransformation)
|
||||
* [FuseSubtractToFakeQuantizeTransformation](@ref openvino_docs_OV_UG_lpt_FuseSubtractToFakeQuantizeTransformation)
|
||||
* [MultiplyToGroupConvolutionTransformation](@ref openvino_docs_OV_UG_lpt_MultiplyToGroupConvolutionTransformation)
|
||||
@@ -1,3 +1,3 @@
|
||||
# ConvertSubtractConstant transformation {#openvino_docs_IE_DG_lpt_ConvertSubtractConstant}
|
||||
# ConvertSubtractConstant transformation {#openvino_docs_OV_UG_lpt_ConvertSubtractConstant}
|
||||
|
||||
ngraph::pass::low_precision::ConvertSubtractConstant class represents the `ConvertSubtractConstant` transformation.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# LinOpSequenceFusion transformation {#openvino_docs_IE_DG_lpt_LinOpSequenceFusion}
|
||||
# LinOpSequenceFusion transformation {#openvino_docs_OV_UG_lpt_LinOpSequenceFusion}
|
||||
|
||||
ngraph::pass::LinOpSequenceFusion class represents the `LinOpSequenceFusion` transformation.
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# PullReshapeThroughDequantization transformation {#openvino_docs_IE_DG_lpt_PullReshapeThroughDequantization}
|
||||
# PullReshapeThroughDequantization transformation {#openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization}
|
||||
|
||||
ngraph::pass::low_precision::PullReshapeThroughDequantization class represents the `PullReshapeThroughDequantization` transformation.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user