Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MegEngine/mgeconvert
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.6.0
Choose a base ref
...
head repository: MegEngine/mgeconvert
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 5,995 additions and 1,315 deletions.
  1. +29 −5 .github/workflows/ci.yml
  2. +29 −0 .github/workflows/complete_unit_test.yaml
  3. +1 −0 MANIFEST.in
  4. +118 −62 README.md
  5. +55 −9 bin/convert
  6. +10 −0 ci/build_package.sh
  7. +22 −39 ci/pytest_caffe_and_onnx.sh
  8. +36 −0 ci/pytest_caffe_and_onnx_complete.sh
  9. +19 −32 ci/pytest_tflite.sh
  10. +29 −0 ci/pytest_tflite_complete.sh
  11. +19 −0 ci/pytest_torchscript.sh
  12. +8 −0 ci/pytest_transform.sh
  13. +5 −2 ci/requires-style.txt
  14. +7 −2 ci/requires-test.txt
  15. +13 −0 ci/test.sh
  16. +20 −3 ci/test_convert_cmd.sh
  17. +0 −7 mgeconvert/__init__.py
  18. +0 −7 mgeconvert/backend/ir_to_caffe/__init__.py
  19. +4 −10 mgeconvert/backend/ir_to_caffe/caffe_converter.py
  20. +15 −28 mgeconvert/backend/ir_to_caffe/caffe_op.py
  21. +8 −1 mgeconvert/backend/ir_to_caffe/init.sh
  22. +1 −0 mgeconvert/backend/ir_to_mge/__init__.py
  23. +212 −0 mgeconvert/backend/ir_to_mge/mge_converter.py
  24. +913 −0 mgeconvert/backend/ir_to_mge/mge_op.py
  25. +10 −3 mgeconvert/backend/ir_to_onnx/init.sh
  26. +2 −8 mgeconvert/backend/ir_to_onnx/onnx_converter.py
  27. +70 −150 mgeconvert/backend/ir_to_onnx/onnx_op.py
  28. +0 −7 mgeconvert/backend/ir_to_tflite/__init__.py
  29. +19 −0 mgeconvert/backend/ir_to_tflite/build_flatbuffer.sh
  30. +23 −38 mgeconvert/backend/ir_to_tflite/init.sh
  31. +7 −1 mgeconvert/backend/ir_to_tflite/pyflexbuffers/__init__.py
  32. +7 −10 mgeconvert/backend/ir_to_tflite/tflite_converter.py
  33. +116 −23 mgeconvert/backend/ir_to_tflite/tflite_op.py
  34. +2 −0 mgeconvert/backend/ir_to_torchscript/__init__.py
  35. +121 −0 mgeconvert/backend/ir_to_torchscript/converter.py
  36. +711 −0 mgeconvert/backend/ir_to_torchscript/fx_op.py
  37. +0 −7 mgeconvert/converter_ir/__init__.py
  38. +0 −7 mgeconvert/converter_ir/ir_graph.py
  39. +148 −18 mgeconvert/converter_ir/ir_op.py
  40. +68 −42 mgeconvert/converter_ir/ir_quantizer.py
  41. +52 −12 mgeconvert/converter_ir/ir_tensor.py
  42. +417 −97 mgeconvert/converter_ir/ir_transform.py
  43. +0 −7 mgeconvert/converters/__init__.py
  44. +1 −7 mgeconvert/converters/mge_to_caffe.py
  45. +1 −7 mgeconvert/converters/mge_to_onnx.py
  46. +12 −9 mgeconvert/converters/mge_to_tflite.py
  47. +52 −0 mgeconvert/converters/onnx_to_mge.py
  48. +40 −0 mgeconvert/converters/onnx_to_tm.py
  49. +1 −9 mgeconvert/converters/tm_to_caffe.py
  50. +1 −8 mgeconvert/converters/tm_to_onnx.py
  51. +19 −11 mgeconvert/converters/tm_to_tflite.py
  52. +57 −0 mgeconvert/converters/tm_to_torchscript.py
  53. +0 −7 mgeconvert/frontend/__init__.py
  54. +0 −7 mgeconvert/frontend/mge_to_ir/__init__.py
  55. +0 −7 mgeconvert/frontend/mge_to_ir/mge_frontend.py
  56. +2 −10 mgeconvert/frontend/mge_to_ir/mge_utils.py
  57. +0 −7 mgeconvert/frontend/mge_to_ir/op_generators/__init__.py
  58. +0 −7 mgeconvert/frontend/mge_to_ir/op_generators/base.py
  59. +8 −15 mgeconvert/frontend/mge_to_ir/op_generators/convolution.py
  60. +12 −7 mgeconvert/frontend/mge_to_ir/op_generators/elemwise.py
  61. +0 −7 mgeconvert/frontend/mge_to_ir/op_generators/tensor.py
  62. +0 −7 mgeconvert/frontend/mge_to_ir/symbolvar_resolver.py
  63. +1 −0 mgeconvert/frontend/onnx_to_ir/__init__.py
  64. +91 −0 mgeconvert/frontend/onnx_to_ir/onnx_frontend.py
  65. +73 −0 mgeconvert/frontend/onnx_to_ir/onnxproto_resolver.py
  66. +4 −0 mgeconvert/frontend/onnx_to_ir/op_generators/__init__.py
  67. +40 −0 mgeconvert/frontend/onnx_to_ir/op_generators/base.py
  68. +167 −0 mgeconvert/frontend/onnx_to_ir/op_generators/elemwise.py
  69. +322 −0 mgeconvert/frontend/onnx_to_ir/op_generators/nn.py
  70. +343 −0 mgeconvert/frontend/onnx_to_ir/op_generators/tensor.py
  71. +0 −7 mgeconvert/frontend/tm_to_ir/__init__.py
  72. +1 −8 mgeconvert/frontend/tm_to_ir/op_generators/__init__.py
  73. +1 −10 mgeconvert/frontend/tm_to_ir/op_generators/base.py
  74. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/batchnorm.py
  75. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/broadcast.py
  76. +3 −15 mgeconvert/frontend/tm_to_ir/op_generators/concat.py
  77. +0 −7 mgeconvert/frontend/tm_to_ir/op_generators/constant.py
  78. +11 −25 mgeconvert/frontend/tm_to_ir/op_generators/conv2d.py
  79. +22 −26 mgeconvert/frontend/tm_to_ir/op_generators/conv_bn2d.py
  80. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/deconv.py
  81. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/dropout.py
  82. +10 −16 mgeconvert/frontend/tm_to_ir/op_generators/elemwise.py
  83. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/flatten.py
  84. +0 −7 mgeconvert/frontend/tm_to_ir/op_generators/getvarshape.py
  85. +10 −25 mgeconvert/frontend/tm_to_ir/op_generators/matmul.py
  86. +60 −0 mgeconvert/frontend/tm_to_ir/op_generators/pad.py
  87. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/pooling.py
  88. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/reduce.py
  89. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/reshape.py
  90. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/resize.py
  91. +0 −11 mgeconvert/frontend/tm_to_ir/op_generators/softmax.py
  92. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/squeeze.py
  93. +6 −8 mgeconvert/frontend/tm_to_ir/op_generators/subtensor.py
  94. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/transpose.py
  95. +0 −8 mgeconvert/frontend/tm_to_ir/op_generators/typecvt.py
  96. +5 −9 mgeconvert/frontend/tm_to_ir/pattern_utils.py
  97. +47 −25 mgeconvert/frontend/tm_to_ir/qat_pattern.py
  98. +18 −20 mgeconvert/frontend/tm_to_ir/tm_frontend.py
  99. +10 −13 mgeconvert/frontend/tm_to_ir/tm_tensor_resolver.py
  100. +0 −7 mgeconvert/frontend/tm_to_ir/tm_utils.py
  101. +1 −8 mgeconvert/version.py
  102. +137 −38 setup.py
  103. +36 −27 test/mge/test_caffe.py
  104. +38 −29 test/mge/test_onnx.py
  105. +32 −17 test/mge/test_tflite.py
  106. +7 −0 test/onnx_model/efficientnet.py
  107. +7 −0 test/onnx_model/mobilenetv2.py
  108. +7 −0 test/onnx_model/mobilenetv3.py
  109. +449 −0 test/onnx_model/mobileone.py
  110. +7 −0 test/onnx_model/resnet18.py
  111. +32 −32 test/traced_module/test_caffe.py
  112. +29 −29 test/traced_module/test_onnx.py
  113. +5 −0 test/traced_module/test_qat_tflite.py
  114. +47 −24 test/traced_module/test_tflite.py
  115. +251 −0 test/traced_module/test_torchscript.py
  116. +81 −0 test/traced_module/test_transform.py
  117. +32 −7 test/utils.py
34 changes: 29 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ on:

jobs:
format:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
@@ -22,14 +22,14 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -r ./ci/requires-style.txt
python3 -m pip install -q megengine==1.6.0 -f https://megengine.org.cn/whl/mge.html
python3 -m pip install -q megengine==1.8.1 -f https://megengine.org.cn/whl/mge.html
- name: check format
run: ./ci/run_format_check.sh
- name: lint
run: ./ci/lint.sh

pytest-caffe-and-onnx:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
container:
image: enginesh233/mgeconvert_ci:v1.1
defaults:
@@ -41,7 +41,7 @@ jobs:
run: ./ci/pytest_caffe_and_onnx.sh

pytest-tflite:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
container:
image: enginesh233/mgeconvert_ci:v1.1
defaults:
@@ -52,8 +52,32 @@ jobs:
- name: test tflite
run: ./ci/pytest_tflite.sh

test-convert-cmd:
pytest-torchscript:
runs-on: ubuntu-20.04
container:
image: enginesh233/mgeconvert_ci:v1.1
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: test torchscipt
run: ./ci/pytest_torchscript.sh

pytest-transform:
runs-on: ubuntu-latest
container:
image: enginesh233/mgeconvert_ci:v1.1
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: test transform
run: ./ci/pytest_transform.sh

test-convert-cmd:
runs-on: ubuntu-20.04
container:
image: enginesh233/mgeconvert_ci:v1.1
defaults:
29 changes: 29 additions & 0 deletions .github/workflows/complete_unit_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: COMPLETE_UNIT_TEST

on:
workflow_dispatch:

jobs:
pytest-caffe-and-onnx-complete:
runs-on: ubuntu-20.04
container:
image: enginesh233/mgeconvert_ci:v1.1
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: test caffe and onnx
run: ./ci/pytest_caffe_and_onnx_complete.sh

pytest-tflite-complete:
runs-on: ubuntu-20.04
container:
image: enginesh233/mgeconvert_ci:v1.1
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: test tflite
run: ./ci/pytest_tflite_complete.sh
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include mgeconvert/backend *.sh *.cc *.h *.so *.so.1 flatc
Loading