diff --git a/.github/workflows/linux_ci.yml b/.github/workflows/linux_ci.yml index 75867e255..a6a856458 100644 --- a/.github/workflows/linux_ci.yml +++ b/.github/workflows/linux_ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10'] + python-version: ['3.11'] architecture: ['x64'] steps: diff --git a/.github/workflows/mlagility_validation.yml b/.github/workflows/mlagility_validation.yml index a7611b5b1..1727e27e8 100644 --- a/.github/workflows/mlagility_validation.yml +++ b/.github/workflows/mlagility_validation.yml @@ -25,9 +25,6 @@ jobs: - name: Install dependencies and mlagility run: | python -m pip install --upgrade pip - python -m pip install onnx onnxruntime requests py-cpuinfo - # Print CPU info for debugging ONNX Runtime inference difference - python -m cpuinfo git clone https://github.com/groq/mlagility.git cd mlagility pip install -r models/requirements.txt @@ -35,5 +32,6 @@ jobs: - name: Validate created ONNX model from mlagility run: | + # TODO: remove the following after mlagility has resovled version contradict issue pip install -r models/mlagility/requirements.txt python workflow_scripts/run_mlagility.py diff --git a/.github/workflows/windows_ci.yml b/.github/workflows/windows_ci.yml index 34e1daaa6..4ebcb3804 100644 --- a/.github/workflows/windows_ci.yml +++ b/.github/workflows/windows_ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ['3.10'] + python-version: ['3.11'] architecture: ['x64'] steps: diff --git a/models/mlagility/alexnet/alexnet-18.onnx b/models/mlagility/alexnet/alexnet-18.onnx index e601daa98..31a696baa 100644 --- a/models/mlagility/alexnet/alexnet-18.onnx +++ b/models/mlagility/alexnet/alexnet-18.onnx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f954fd5efd73ebaf2095770fa69c0c7cd254042f1c3d819c33fc5c8fe5199fa -size 244407346 +oid sha256:861ce90b9787be9ff96af2a09c38164ca9c6e78c2cd715dd51ff518dfdd2d08e +size 244407334 diff --git a/models/mlagility/alexnet/test_data_set_0/input_0.pb b/models/mlagility/alexnet/test_data_set_0/input_0.pb index e8f1b84d9..73eea7886 100644 --- a/models/mlagility/alexnet/test_data_set_0/input_0.pb +++ b/models/mlagility/alexnet/test_data_set_0/input_0.pb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb8b6cf13a2f3ef60d0673a844698c51e338c2819e83cd1426946d2197107c1f -size 602137 +oid sha256:1222c5fed2f42a1de73e902cd25164ca489735bbbd7010e7838ec044bb8391a8 +size 602131 diff --git a/models/mlagility/alexnet/test_data_set_0/output_0.pb b/models/mlagility/alexnet/test_data_set_0/output_0.pb index 7be7372da..9a8feb50c 100644 --- a/models/mlagility/alexnet/test_data_set_0/output_0.pb +++ b/models/mlagility/alexnet/test_data_set_0/output_0.pb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:24fce9a5a7a7e4f44d7093502c91bc5ee217bd39badbfeb337ea4d33cd541675 +oid sha256:4641f236b9fc386b29b1a463e825425a72279dd0208bf01a2c8d023d3f6e9927 size 4014 diff --git a/models/mlagility/densenet121/densenet121-18.onnx b/models/mlagility/densenet121/densenet121-18.onnx new file mode 100644 index 000000000..3947a2e8b --- /dev/null +++ b/models/mlagility/densenet121/densenet121-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba4bb74ee59777ad5460e0b1e328844ffb26d82c8e49ecc3406bb6991048419a +size 31879908 diff --git a/models/mlagility/densenet121/test_data_set_0/input_0.pb b/models/mlagility/densenet121/test_data_set_0/input_0.pb new file mode 100644 index 000000000..aabc9d13c --- /dev/null +++ b/models/mlagility/densenet121/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d4ae8aaf73e4bf846b8e90091c371c57cfac19a0633b6636f40e0d63e886d4e +size 602131 diff --git a/models/mlagility/densenet121/test_data_set_0/output_0.pb b/models/mlagility/densenet121/test_data_set_0/output_0.pb new file mode 100644 index 000000000..b0caf1111 --- /dev/null +++ b/models/mlagility/densenet121/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:889bb0e8cf84ebbd646b600269b8db69a9fc6df4ff9b164ce1e64e589524cda4 +size 4016 diff --git a/models/mlagility/fasterrcnn_resnet50_fpn_v2/fasterrcnn_resnet50_fpn_v2-18.onnx b/models/mlagility/fasterrcnn_resnet50_fpn_v2/fasterrcnn_resnet50_fpn_v2-18.onnx index a16ac0195..5ed1dba71 100644 --- a/models/mlagility/fasterrcnn_resnet50_fpn_v2/fasterrcnn_resnet50_fpn_v2-18.onnx +++ b/models/mlagility/fasterrcnn_resnet50_fpn_v2/fasterrcnn_resnet50_fpn_v2-18.onnx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90f0837b92091e1a4193d293c900ee6e7f8797a480311340f42201aebe28db51 +oid sha256:43c6bfe96bc80bb12a503ab5e47e02079284d0390a6f7d3064cc16a8ea4281e1 size 174896554 diff --git a/models/mlagility/googlenet/googlenet-18.onnx b/models/mlagility/googlenet/googlenet-18.onnx new file mode 100644 index 000000000..d0068bfeb --- /dev/null +++ b/models/mlagility/googlenet/googlenet-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f233a12011abc1e2210054d943f7143a62e8d391780fc87f5d3f54167b1d976 +size 26484552 diff --git a/models/mlagility/googlenet/test_data_set_0/input_0.pb b/models/mlagility/googlenet/test_data_set_0/input_0.pb new file mode 100644 index 000000000..67b2894a2 --- /dev/null +++ b/models/mlagility/googlenet/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bfd438a69213e43dc2a3c900992068e3f5fda144dad5b3db339f7ab22f9dbe5 +size 602131 diff --git a/models/mlagility/googlenet/test_data_set_0/output_0.pb b/models/mlagility/googlenet/test_data_set_0/output_0.pb new file mode 100644 index 000000000..1e76f7f14 --- /dev/null +++ b/models/mlagility/googlenet/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b576b43775cd5d44f0bb6f02adf0bc66a2b6697d5febf0c52142b815f3f93faa +size 4015 diff --git a/models/mlagility/inception_v3/inception_v3-18.onnx b/models/mlagility/inception_v3/inception_v3-18.onnx new file mode 100644 index 000000000..f86040650 --- /dev/null +++ b/models/mlagility/inception_v3/inception_v3-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff14abf628cd202d0b40eadfa45a444146761675ee292c749be1551cf440cad8 +size 95258508 diff --git a/models/mlagility/inception_v3/test_data_set_0/input_0.pb b/models/mlagility/inception_v3/test_data_set_0/input_0.pb new file mode 100644 index 000000000..858b570b9 --- /dev/null +++ b/models/mlagility/inception_v3/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0291544392ef6e81e9637572412cf2398a51e8fed2d55b68f6d75ee3b93608d2 +size 602131 diff --git a/models/mlagility/inception_v3/test_data_set_0/output_0.pb b/models/mlagility/inception_v3/test_data_set_0/output_0.pb new file mode 100644 index 000000000..c0289505e --- /dev/null +++ b/models/mlagility/inception_v3/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20a9fac517a481f88a97075bf11d9c3d99f94a60e4112df9a56530c06ee3402b +size 4015 diff --git a/models/mlagility/maskrcnn_resnet50_fpn/maskrcnn_resnet50_fpn-18.onnx b/models/mlagility/maskrcnn_resnet50_fpn/maskrcnn_resnet50_fpn-18.onnx new file mode 100644 index 000000000..cb8e5f239 --- /dev/null +++ b/models/mlagility/maskrcnn_resnet50_fpn/maskrcnn_resnet50_fpn-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:deb9cad09b09dd8c394609c675ac1146995e397002d26f3ddb5b4ec1aa1f74a2 +size 178161574 diff --git a/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/input_0.pb b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/input_0.pb new file mode 100644 index 000000000..fa67504a3 --- /dev/null +++ b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff94cc071a469cd1472c148b2956d0202e6be58f1e606b19f029e5a5280c308a +size 602136 diff --git a/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_0.pb b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_0.pb new file mode 100644 index 000000000..2ec9e6d54 --- /dev/null +++ b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:febf8c4ca59954f2a1e027f0f835eb65f479bc3427a9480005e4b223398225cb +size 1619 diff --git a/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_1.pb b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_1.pb new file mode 100644 index 000000000..378a5dec8 --- /dev/null +++ b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_1.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84d6b09b4f5b9151dd353a23bba77982deb662b05b7ddcf3c4530638887f1d2e +size 825 diff --git a/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_2.pb b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_2.pb new file mode 100644 index 000000000..31eca2bbd --- /dev/null +++ b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_2.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09464d31b9658697d06ee89a1545ea82ae3182b0f68549d98f06dfcfb8459c50 +size 413 diff --git a/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_3.pb b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_3.pb new file mode 100644 index 000000000..1895bad35 --- /dev/null +++ b/models/mlagility/maskrcnn_resnet50_fpn/test_data_set_0/output_3.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db28a2d953014fa2b5e252a0d62b192f5e4a9ed579caaade91145700fc6c7d3f +size 20070423 diff --git a/models/mlagility/mobilenet_v2/mobilenet_v2-18.onnx b/models/mlagility/mobilenet_v2/mobilenet_v2-18.onnx new file mode 100644 index 000000000..c40335f87 --- /dev/null +++ b/models/mlagility/mobilenet_v2/mobilenet_v2-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b086abd17d091aa70ba0a6006c1bdadc2f9c3c3f4e3f97a2d44fdf25f87121a +size 13942189 diff --git a/models/mlagility/mobilenet_v2/test_data_set_0/input_0.pb b/models/mlagility/mobilenet_v2/test_data_set_0/input_0.pb new file mode 100644 index 000000000..28aa898d7 --- /dev/null +++ b/models/mlagility/mobilenet_v2/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53a56b25df64c651001b1ef45a7a7111817e2023ab283ddeaada6becb5c75958 +size 602131 diff --git a/models/mlagility/mobilenet_v2/test_data_set_0/output_0.pb b/models/mlagility/mobilenet_v2/test_data_set_0/output_0.pb new file mode 100644 index 000000000..c9c0a2f07 --- /dev/null +++ b/models/mlagility/mobilenet_v2/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b53bfcf6aa613958a1a27f6ff90d2f28f620d9295a11851944e0b69d6a7688f +size 4015 diff --git a/models/mlagility/mobilenet_v3_large/mobilenet_v3_large-18.onnx b/models/mlagility/mobilenet_v3_large/mobilenet_v3_large-18.onnx new file mode 100644 index 000000000..42c71e5be --- /dev/null +++ b/models/mlagility/mobilenet_v3_large/mobilenet_v3_large-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e90958ccce3e76dfc7a7e32d9a657e4a9e34995a59aca8b3060ee8c46f04d44b +size 21869272 diff --git a/models/mlagility/mobilenet_v3_large/test_data_set_0/input_0.pb b/models/mlagility/mobilenet_v3_large/test_data_set_0/input_0.pb new file mode 100644 index 000000000..b3c892b25 --- /dev/null +++ b/models/mlagility/mobilenet_v3_large/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d799238ba79fae2c1e955e04bcd506fe2e3c4ed8bf53c688f2064bb64a852862 +size 602131 diff --git a/models/mlagility/mobilenet_v3_large/test_data_set_0/output_0.pb b/models/mlagility/mobilenet_v3_large/test_data_set_0/output_0.pb new file mode 100644 index 000000000..dacc01a50 --- /dev/null +++ b/models/mlagility/mobilenet_v3_large/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffec71c9bddcf3a410726a5824efc8a11f2076f58569a0b6e38e467379004d95 +size 4015 diff --git a/models/mlagility/requirements.txt b/models/mlagility/requirements.txt index 66ba79ae3..68b485fb9 100644 --- a/models/mlagility/requirements.txt +++ b/models/mlagility/requirements.txt @@ -1,2 +1,2 @@ -torch==2.0.0 -torchvision==0.15.1 +torch==2.0.1 +torchvision==0.15.2 diff --git a/models/mlagility/resnet101/resnet101-18.onnx b/models/mlagility/resnet101/resnet101-18.onnx new file mode 100644 index 000000000..734d808f7 --- /dev/null +++ b/models/mlagility/resnet101/resnet101-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc51e6aed618c1910359ac18ec765c6e8367967167860989f2e025793032aa2f +size 177843014 diff --git a/models/mlagility/resnet101/test_data_set_0/input_0.pb b/models/mlagility/resnet101/test_data_set_0/input_0.pb new file mode 100644 index 000000000..a2f9a1f77 --- /dev/null +++ b/models/mlagility/resnet101/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40ec55530a76f00441feb4a5faf0f8d68d1709a155ff78dec429ffbbc7969ece +size 602131 diff --git a/models/mlagility/resnet101/test_data_set_0/output_0.pb b/models/mlagility/resnet101/test_data_set_0/output_0.pb new file mode 100644 index 000000000..f2c6aa83f --- /dev/null +++ b/models/mlagility/resnet101/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22b19105727b49f0676d4930ec8d85de2cb03ec46b5ec3347a6562c69397bd56 +size 4015 diff --git a/models/mlagility/resnet18/resnet18-18.onnx b/models/mlagility/resnet18/resnet18-18.onnx new file mode 100644 index 000000000..1e57c69c1 --- /dev/null +++ b/models/mlagility/resnet18/resnet18-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1369195abc6104d78844bc7147e1719c1f1b2ae86c8c813de19e324b52027fdf +size 46733629 diff --git a/models/mlagility/resnet18/test_data_set_0/input_0.pb b/models/mlagility/resnet18/test_data_set_0/input_0.pb new file mode 100644 index 000000000..7227b39c4 --- /dev/null +++ b/models/mlagility/resnet18/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be5018be10b4fd708e4307c3d502139ad91e726084d66a064b688877562e8dd6 +size 602131 diff --git a/models/mlagility/resnet18/test_data_set_0/output_0.pb b/models/mlagility/resnet18/test_data_set_0/output_0.pb new file mode 100644 index 000000000..20dac25ba --- /dev/null +++ b/models/mlagility/resnet18/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c029bbe134e503a0000be53cea86fde5508e758353f8e8a1b463750a81cd6c02 +size 4015 diff --git a/models/mlagility/resnet34/resnet34-18.onnx b/models/mlagility/resnet34/resnet34-18.onnx new file mode 100644 index 000000000..c3ad35f04 --- /dev/null +++ b/models/mlagility/resnet34/resnet34-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a427e52c846de379b629313fb01d47dfafa18d07f61864cc3276a32c03277e96 +size 87144773 diff --git a/models/mlagility/resnet34/test_data_set_0/input_0.pb b/models/mlagility/resnet34/test_data_set_0/input_0.pb new file mode 100644 index 000000000..9f92e53e3 --- /dev/null +++ b/models/mlagility/resnet34/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:227caf34eab8b637ad105d9b08f7568acabf44136dfbb80df06b26f7be612b66 +size 602131 diff --git a/models/mlagility/resnet34/test_data_set_0/output_0.pb b/models/mlagility/resnet34/test_data_set_0/output_0.pb new file mode 100644 index 000000000..fb4563630 --- /dev/null +++ b/models/mlagility/resnet34/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a4dbe8b0cb4aa602037b13231534a6e9b008ba08bf8a32360daf892204fbd2d +size 4015 diff --git a/models/mlagility/resnet50/resnet50-18.onnx b/models/mlagility/resnet50/resnet50-18.onnx index e682f9114..4702621b6 100644 --- a/models/mlagility/resnet50/resnet50-18.onnx +++ b/models/mlagility/resnet50/resnet50-18.onnx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:837e0e4e6fe7fcd48c3b9e222b033ee580739618f3ba064ce90bfbbaa8e427cf +oid sha256:1d395852791beccf1793a843b9bddbe906063cffbcb1862d6db2a88eafc4eb93 size 102057631 diff --git a/models/mlagility/ssd300_vgg16/ssd300_vgg16-18.onnx b/models/mlagility/ssd300_vgg16/ssd300_vgg16-18.onnx new file mode 100644 index 000000000..a1a9f15e6 --- /dev/null +++ b/models/mlagility/ssd300_vgg16/ssd300_vgg16-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b07dc1f4ef40331def248889d05d22b18e64a59b23a99241880e2d3fb4674d7 +size 142914780 diff --git a/models/mlagility/ssd300_vgg16/test_data_set_0/input_0.pb b/models/mlagility/ssd300_vgg16/test_data_set_0/input_0.pb new file mode 100644 index 000000000..b242aa378 --- /dev/null +++ b/models/mlagility/ssd300_vgg16/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62af23ccbf95a2ae95ba2a74e46ca7212ad128f9bb5e3fd765ff6892a5b51ce5 +size 602136 diff --git a/models/mlagility/ssd300_vgg16/test_data_set_0/output_0.pb b/models/mlagility/ssd300_vgg16/test_data_set_0/output_0.pb new file mode 100644 index 000000000..d82e0d51c --- /dev/null +++ b/models/mlagility/ssd300_vgg16/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27e2e5911ec6b77ddd0699615157bff96c5d92af5244371a780cccdcf982355b +size 3216 diff --git a/models/mlagility/ssd300_vgg16/test_data_set_0/output_1.pb b/models/mlagility/ssd300_vgg16/test_data_set_0/output_1.pb new file mode 100644 index 000000000..7053b9e3f --- /dev/null +++ b/models/mlagility/ssd300_vgg16/test_data_set_0/output_1.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:541c4a5835dc28785b774487e8fb26e07e5135a050eb4026f66040e98ac0fe41 +size 814 diff --git a/models/mlagility/ssd300_vgg16/test_data_set_0/output_2.pb b/models/mlagility/ssd300_vgg16/test_data_set_0/output_2.pb new file mode 100644 index 000000000..1e7276ee3 --- /dev/null +++ b/models/mlagility/ssd300_vgg16/test_data_set_0/output_2.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:421637d1e224522f07da933d82fce9bed34309eafa639bb8441029b9a8223bc6 +size 1614 diff --git a/models/mlagility/vgg16/test_data_set_0/input_0.pb b/models/mlagility/vgg16/test_data_set_0/input_0.pb new file mode 100644 index 000000000..42cc26806 --- /dev/null +++ b/models/mlagility/vgg16/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dab34f1f196efba0b9c57310822c8b7a7d0d354abf741913d5a1d606afb2483b +size 602131 diff --git a/models/mlagility/vgg16/test_data_set_0/output_0.pb b/models/mlagility/vgg16/test_data_set_0/output_0.pb new file mode 100644 index 000000000..93482fcce --- /dev/null +++ b/models/mlagility/vgg16/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a21540b69e5d70a0de3b7cf77e50faf02de8bfaf63eba158bed298d1040730e +size 4014 diff --git a/models/mlagility/vgg16/vgg16-18.onnx b/models/mlagility/vgg16/vgg16-18.onnx new file mode 100644 index 000000000..4cb1d41bf --- /dev/null +++ b/models/mlagility/vgg16/vgg16-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8319e932a2a25c588cd121e4d0e9d14c667a47bc2ad8693f7c408bfed29c26c +size 553408805 diff --git a/models/mlagility/vgg16_bn/test_data_set_0/input_0.pb b/models/mlagility/vgg16_bn/test_data_set_0/input_0.pb new file mode 100644 index 000000000..9a976fa58 --- /dev/null +++ b/models/mlagility/vgg16_bn/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ace70e08a606e8bd4cd93d8903d24993c5cee40fbc1dc3e3a82ac7b0e60b398 +size 602131 diff --git a/models/mlagility/vgg16_bn/test_data_set_0/output_0.pb b/models/mlagility/vgg16_bn/test_data_set_0/output_0.pb new file mode 100644 index 000000000..ff1a0af65 --- /dev/null +++ b/models/mlagility/vgg16_bn/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7aa0733a2fa96f398bfbfc99989d4a5bef481cc1d71efb9b65c4832bff999b6a +size 4015 diff --git a/models/mlagility/vgg16_bn/vgg16_bn-18.onnx b/models/mlagility/vgg16_bn/vgg16_bn-18.onnx new file mode 100644 index 000000000..824f01a7d --- /dev/null +++ b/models/mlagility/vgg16_bn/vgg16_bn-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bd0224f03ede2c45bffcca55b047b97011a865359d4890d2cbe6568ab173063 +size 553408660 diff --git a/models/mlagility/vgg19/test_data_set_0/input_0.pb b/models/mlagility/vgg19/test_data_set_0/input_0.pb new file mode 100644 index 000000000..6128ed828 --- /dev/null +++ b/models/mlagility/vgg19/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2bf364b799ecdaac851a97a03966dcd070f59cbe44a0b2c081f18477f00c52c +size 602131 diff --git a/models/mlagility/vgg19/test_data_set_0/output_0.pb b/models/mlagility/vgg19/test_data_set_0/output_0.pb new file mode 100644 index 000000000..717cb28ab --- /dev/null +++ b/models/mlagility/vgg19/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c61098a74ba213705ddcb7f07b93c7cbd392ff66a8424d2c80186b52aa120b5 +size 4014 diff --git a/models/mlagility/vgg19/vgg19-18.onnx b/models/mlagility/vgg19/vgg19-18.onnx new file mode 100644 index 000000000..34e737d36 --- /dev/null +++ b/models/mlagility/vgg19/vgg19-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d6b02272fccd6edba3b469766356cea8b1c7752da93bf7ca589a15b8544b976 +size 574643837 diff --git a/models/mlagility/vgg19_bn/test_data_set_0/input_0.pb b/models/mlagility/vgg19_bn/test_data_set_0/input_0.pb new file mode 100644 index 000000000..f4bc94231 --- /dev/null +++ b/models/mlagility/vgg19_bn/test_data_set_0/input_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85c397fb3b85f5172a6cda014501ff4fe118ccd352dbec9617537af8f17731ee +size 602131 diff --git a/models/mlagility/vgg19_bn/test_data_set_0/output_0.pb b/models/mlagility/vgg19_bn/test_data_set_0/output_0.pb new file mode 100644 index 000000000..c9b78ccca --- /dev/null +++ b/models/mlagility/vgg19_bn/test_data_set_0/output_0.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eeec361b25b3f59bdc03238936681da19e428833dd580bde8b5928f5aa96af07 +size 4015 diff --git a/models/mlagility/vgg19_bn/vgg19_bn-18.onnx b/models/mlagility/vgg19_bn/vgg19_bn-18.onnx new file mode 100644 index 000000000..38c95ab36 --- /dev/null +++ b/models/mlagility/vgg19_bn/vgg19_bn-18.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccd9eee43245051902e12958be7b21178bac94181e1a5ac6dc5f5aa31f056351 +size 574643650 diff --git a/workflow_scripts/config.py b/workflow_scripts/config.py deleted file mode 100644 index a757924a7..000000000 --- a/workflow_scripts/config.py +++ /dev/null @@ -1,6 +0,0 @@ -models_info = [ - # (script_path, model_name, model_zoo_directory) - ("torch_hub/alexnet.py", "alexnet_torch_hub_7df2a577", "alexnet"), - ("torch_hub/resnet50.py", "resnet50_torch_hub_31acb52e", "resnet50"), - ("torchvision/fasterrcnn_resnet50_fpn_v2.py", "fasterrcnn_resnet50_fpn_v2_torchvision_ec445cac", "fasterrcnn_resnet50_fpn_v2"), -] diff --git a/workflow_scripts/mlagility_config.py b/workflow_scripts/mlagility_config.py new file mode 100644 index 000000000..f412fd48e --- /dev/null +++ b/workflow_scripts/mlagility_config.py @@ -0,0 +1,19 @@ +models_info = [ + "torch_hub/alexnet.py", + "torch_hub/resnet50.py", + "torchvision/fasterrcnn_resnet50_fpn_v2.py", + "torchvision/maskrcnn_resnet50_fpn.py", + "torchvision/ssd300_vgg16.py", + "torch_hub/mobilenet_v2.py", + "torch_hub/mobilenet_v3_large.py", + "torch_hub/resnet18.py", + "torch_hub/resnet34.py", + "torch_hub/resnet101.py", + "torch_hub/vgg16.py", + "torch_hub/vgg16_bn.py", + "torch_hub/vgg19.py", + "torch_hub/vgg19_bn.py", + "torch_hub/densenet121.py", + "torch_hub/inception_v3.py", + "torch_hub/googlenet.py", +] diff --git a/workflow_scripts/run_mlagility.py b/workflow_scripts/run_mlagility.py index 92ea3972a..880475328 100644 --- a/workflow_scripts/run_mlagility.py +++ b/workflow_scripts/run_mlagility.py @@ -1,9 +1,24 @@ -import config +import argparse +from mlagility_config import models_info import os.path as osp +from os import listdir, rename from pathlib import Path import shutil import subprocess import sys +import ort_test_dir_utils + + +def get_immediate_subdirectories_count(dir_name): + return len([name for name in listdir(dir_name) + if osp.isdir(osp.join(dir_name, name))]) + + +def find_model_hash_name(dir_name, cache_dir_prefix): + for dir in listdir(dir_name): + if dir.startswith(cache_dir_prefix): + return dir + raise Exception(f"Cannot find model hash name: {cache_dir_prefix} in cache directory.") ZOO_OPSET_VERSION = "18" @@ -13,27 +28,62 @@ mlagility_models_dir = "models/mlagility" cache_converted_dir = ".cache" -errors = 0 - -for script_path, model_name, model_zoo_dir in config.models_info: - try: - print(f"----------------Checking {model_zoo_dir}----------------") - final_model_path = osp.join(mlagility_models_dir, model_zoo_dir, f"{model_zoo_dir}-{ZOO_OPSET_VERSION}.onnx") - subprocess.run(["benchit", osp.join(mlagility_root, script_path), "--cache-dir", cache_converted_dir, - "--onnx-opset", ZOO_OPSET_VERSION, "--export-only"], - cwd=cwd_path, stdout=sys.stdout, - stderr=sys.stderr) - shutil.copy(osp.join(cache_converted_dir, model_name, "onnx", model_name + base_name), final_model_path) - subprocess.run(["git", "diff", "--exit-code", "--", final_model_path], - cwd=cwd_path, stdout=sys.stdout, - stderr=sys.stderr) - print(f"Successfully checked {model_zoo_dir}.") - except Exception as e: - errors += 1 - print(f"Failed to check {model_zoo_dir} because of {e}.") - -if errors > 0: - print(f"All {len(config.models_info)} model(s) have been checked, but {errors} model(s) failed.") - sys.exit(1) -else: - print(f"All {len(config.models_info)} model(s) have been checked.") + +def main(): + parser = argparse.ArgumentParser(description="Test settings") + + parser.add_argument("--create", required=False, default=False, action="store_true", + help="Create new models from mlagility if not exist.") + parser.add_argument("--skip", required=False, default=False, action="store_true", + help="Skip checking models if already exist.") + + args = parser.parse_args() + errors = 0 + + for model_info in models_info: + directory_name, model_name = model_info.split("/") + model_name = model_name.replace(".py", "") + model_zoo_dir = model_name + try: + print(f"----------------Checking {model_zoo_dir}----------------") + final_model_dir = osp.join(mlagility_models_dir, model_zoo_dir) + final_model_name = f"{model_zoo_dir}-{ZOO_OPSET_VERSION}.onnx" + final_model_path = osp.join(final_model_dir, final_model_name) + if osp.exists(final_model_path) and args.skip: + print(f"Skip checking {model_zoo_dir} because {final_model_path} already exists.") + continue + subprocess.run(["benchit", osp.join(mlagility_root, model_info), "--cache-dir", cache_converted_dir, + "--onnx-opset", ZOO_OPSET_VERSION, "--export-only"], + cwd=cwd_path, stdout=sys.stdout, + stderr=sys.stderr, check=True) + model_hash_name = find_model_hash_name(".cache", model_name + "_" + directory_name + "_") + mlagility_created_onnx = osp.join(cache_converted_dir, model_hash_name, "onnx", model_hash_name + base_name) + if args.create: + ort_test_dir_utils.create_test_dir(mlagility_created_onnx, "./", final_model_dir) + rename(osp.join(final_model_dir, model_hash_name + base_name), final_model_path) + print(f"Successfully created {model_zoo_dir} by mlagility and ORT.") + else: + shutil.copy(mlagility_created_onnx, final_model_path) + subprocess.run(["git", "diff", "--exit-code", "--", final_model_path], + cwd=cwd_path, stdout=sys.stdout, + stderr=sys.stderr, check=True) + print(f"Successfully checked {model_zoo_dir} by mlagility.") + except Exception as e: + errors += 1 + print(f"Failed to check {model_zoo_dir} because of {e}.") + + if errors > 0: + print(f"All {len(models_info)} model(s) have been checked, but {errors} model(s) failed.") + sys.exit(1) + else: + print(f"All {len(models_info)} model(s) have been checked.") + + mlagility_subdir_count = get_immediate_subdirectories_count(mlagility_models_dir) + if mlagility_subdir_count != len(models_info): + print(f"Expected {len(models_info)} model(s) in {mlagility_models_dir}, but got {mlagility_subdir_count} model(s) under models/mlagility." + f"Please check if you have added new model(s) to models_info in mlagility_config.py.") + sys.exit(1) + + +if __name__ == "__main__": + main()