onnxslim 0.1.79__tar.gz → 0.1.81__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. onnxslim-0.1.81/.codespellignore +1 -0
  2. onnxslim-0.1.81/.github/FUNDING.yml +15 -0
  3. onnxslim-0.1.81/.github/workflows/ci.yml +39 -0
  4. onnxslim-0.1.81/.github/workflows/format.yml +26 -0
  5. onnxslim-0.1.81/.github/workflows/nightly-test.yml +32 -0
  6. onnxslim-0.1.81/.github/workflows/python-publish.yml +38 -0
  7. onnxslim-0.1.81/.gitignore +133 -0
  8. onnxslim-0.1.81/.prettierignore +1 -0
  9. onnxslim-0.1.81/CODE_OF_CONDUCT.md +128 -0
  10. onnxslim-0.1.81/CONTRIBUTING.md +86 -0
  11. {onnxslim-0.1.79/onnxslim.egg-info → onnxslim-0.1.81}/PKG-INFO +18 -28
  12. {onnxslim-0.1.79 → onnxslim-0.1.81}/README.md +4 -1
  13. onnxslim-0.1.81/assets/logo/onnxslim-banner-light.svg +47 -0
  14. onnxslim-0.1.81/assets/logo/onnxslim-banner.svg +55 -0
  15. onnxslim-0.1.81/assets/logo/onnxslim-logo-os-bw.svg +22 -0
  16. onnxslim-0.1.81/assets/logo/onnxslim-logo-os-white.svg +22 -0
  17. onnxslim-0.1.81/assets/logo/onnxslim-logo-os.svg +34 -0
  18. onnxslim-0.1.81/bin/onnxslim +14 -0
  19. onnxslim-0.1.81/docs/_static/style.css +3 -0
  20. onnxslim-0.1.81/docs/_templates/layout.html +7 -0
  21. onnxslim-0.1.81/docs/conf.py +42 -0
  22. onnxslim-0.1.81/docs/index.rst +16 -0
  23. onnxslim-0.1.81/docs/main/toc.rst +4 -0
  24. onnxslim-0.1.81/docs/requirements.txt +2 -0
  25. onnxslim-0.1.81/examples/Boost-onnx-load-speed-by-10/342/200/22315-percent-with-onnxslim-python-package.ipynb +449 -0
  26. onnxslim-0.1.81/examples/common_subexpression_elimination/README.md +40 -0
  27. onnxslim-0.1.81/examples/common_subexpression_elimination/cse_demo.py +24 -0
  28. onnxslim-0.1.81/examples/input_shape_modification/README.md +19 -0
  29. onnxslim-0.1.81/examples/model_inspect/README.md +17 -0
  30. onnxslim-0.1.81/examples/output_modification/README.md +19 -0
  31. onnxslim-0.1.81/format.sh +4 -0
  32. onnxslim-0.1.81/images/after_cse.png +0 -0
  33. onnxslim-0.1.81/images/before_cse.png +0 -0
  34. onnxslim-0.1.81/images/cse.png +0 -0
  35. onnxslim-0.1.81/images/input_shape_modification.jpg +0 -0
  36. onnxslim-0.1.81/images/model_inspect.jpg +0 -0
  37. onnxslim-0.1.81/images/onnxslim.gif +0 -0
  38. onnxslim-0.1.81/images/output_modification.jpg +0 -0
  39. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/optimization/dead_node_elimination.py +4 -0
  40. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/symbolic_shape_infer.py +5 -4
  41. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/utils.py +33 -26
  42. onnxslim-0.1.81/onnxslim/version.py +3 -0
  43. onnxslim-0.1.81/pyproject.toml +99 -0
  44. onnxslim-0.1.81/tests/conftest.py +84 -0
  45. onnxslim-0.1.81/tests/test_benchmark.py +173 -0
  46. onnxslim-0.1.81/tests/test_cli_main.py +286 -0
  47. onnxslim-0.1.81/tests/test_coverage.py +2027 -0
  48. onnxslim-0.1.81/tests/test_dead_node_elimination.py +450 -0
  49. onnxslim-0.1.81/tests/test_elimination_patterns.py +218 -0
  50. onnxslim-0.1.81/tests/test_folder.py +61 -0
  51. onnxslim-0.1.81/tests/test_fusion_patterns.py +575 -0
  52. onnxslim-0.1.81/tests/test_modelzoo.py +209 -0
  53. onnxslim-0.1.81/tests/test_nvidia.py +138 -0
  54. onnxslim-0.1.81/tests/test_onnx_nets.py +107 -0
  55. onnxslim-0.1.81/tests/test_onnxslim.py +160 -0
  56. onnxslim-0.1.81/tests/test_pattern_generator.py +158 -0
  57. onnxslim-0.1.81/tests/test_pattern_matcher.py +254 -0
  58. onnxslim-0.1.81/tests/test_shape_folding.py +380 -0
  59. onnxslim-0.1.81/tests/test_subexpression_elimination.py +111 -0
  60. onnxslim-0.1.81/tests/test_symbolic_shape_inference.py +98 -0
  61. onnxslim-0.1.81/tests/test_utils.py +338 -0
  62. onnxslim-0.1.81/tests/utils.py +28 -0
  63. onnxslim-0.1.79/MANIFEST.in +0 -2
  64. onnxslim-0.1.79/PKG-INFO +0 -207
  65. onnxslim-0.1.79/VERSION +0 -1
  66. onnxslim-0.1.79/onnxslim/version.py +0 -1
  67. onnxslim-0.1.79/onnxslim.egg-info/SOURCES.txt +0 -71
  68. onnxslim-0.1.79/onnxslim.egg-info/dependency_links.txt +0 -1
  69. onnxslim-0.1.79/onnxslim.egg-info/entry_points.txt +0 -2
  70. onnxslim-0.1.79/onnxslim.egg-info/requires.txt +0 -5
  71. onnxslim-0.1.79/onnxslim.egg-info/top_level.txt +0 -1
  72. onnxslim-0.1.79/onnxslim.egg-info/zip-safe +0 -1
  73. onnxslim-0.1.79/pyproject.toml +0 -9
  74. onnxslim-0.1.79/setup.cfg +0 -4
  75. onnxslim-0.1.79/setup.py +0 -33
  76. {onnxslim-0.1.79 → onnxslim-0.1.81}/LICENSE +0 -0
  77. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/__init__.py +0 -0
  78. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/__main__.py +0 -0
  79. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/argparser.py +0 -0
  80. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/cli/__init__.py +0 -0
  81. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/cli/_main.py +0 -0
  82. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/__init__.py +0 -0
  83. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/optimization/__init__.py +0 -0
  84. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/optimization/subexpression_elimination.py +0 -0
  85. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/optimization/weight_tying.py +0 -0
  86. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/__init__.py +0 -0
  87. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/elimination/__init__.py +0 -0
  88. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/elimination/concat.py +0 -0
  89. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/elimination/reshape.py +0 -0
  90. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/elimination/reshape_as.py +0 -0
  91. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/elimination/slice.py +0 -0
  92. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/elimination/unsqueeze.py +0 -0
  93. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/__init__.py +0 -0
  94. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/concat_reshape.py +0 -0
  95. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/convadd.py +0 -0
  96. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/convbn.py +0 -0
  97. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/convmul.py +0 -0
  98. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/gelu.py +0 -0
  99. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/gemm.py +0 -0
  100. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/padconv.py +0 -0
  101. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/fusion/reduce.py +0 -0
  102. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/core/pattern/registry.py +0 -0
  103. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/misc/__init__.py +0 -0
  104. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/misc/tabulate.py +0 -0
  105. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/__init__.py +0 -0
  106. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/_sympy/__init__.py +0 -0
  107. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/_sympy/functions.py +0 -0
  108. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/_sympy/numbers.py +0 -0
  109. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/_sympy/printers.py +0 -0
  110. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/_sympy/solve.py +0 -0
  111. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/_sympy/symbol.py +0 -0
  112. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/__init__.py +0 -0
  113. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/exporters/__init__.py +0 -0
  114. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/exporters/base_exporter.py +0 -0
  115. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py +0 -0
  116. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/graph_pattern/__init__.py +0 -0
  117. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/graph_pattern/graph_pattern.py +0 -0
  118. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/importers/__init__.py +0 -0
  119. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/importers/base_importer.py +0 -0
  120. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/importers/onnx_importer.py +0 -0
  121. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/ir/__init__.py +0 -0
  122. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/ir/function.py +0 -0
  123. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/ir/graph.py +0 -0
  124. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/ir/node.py +0 -0
  125. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/ir/tensor.py +0 -0
  126. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/logger/__init__.py +0 -0
  127. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/logger/logger.py +0 -0
  128. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/util/__init__.py +0 -0
  129. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/util/exception.py +0 -0
  130. {onnxslim-0.1.79 → onnxslim-0.1.81}/onnxslim/third_party/onnx_graphsurgeon/util/misc.py +0 -0
@@ -0,0 +1 @@
1
+ onnxslim/argparser.py
@@ -0,0 +1,15 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: inisis
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12
+ polar: # Replace with a single Polar username
13
+ buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14
+ thanks_dev: # Replace with a single thanks.dev username
15
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,39 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: self-hosted
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
20
+
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v7
26
+ with:
27
+ enable-cache: true
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --dev
32
+
33
+ - name: Run all tests with coverage
34
+ run: uv run pytest --cov=onnxslim --cov-report=xml:coverage-ci.xml
35
+
36
+ - name: Upload coverage to Codecov
37
+ uses: codecov/codecov-action@v5
38
+ with:
39
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,26 @@
1
+ # # Ultralytics 🚀 - AGPL-3.0 license
2
+ # # Ultralytics Actions https://github.com/ultralytics/actions
3
+ # # This workflow automatically formats code and documentation in PRs to official Ultralytics standards
4
+
5
+ # name: Ultralytics Actions
6
+
7
+ # on:
8
+ # push:
9
+ # branches: [main]
10
+ # pull_request:
11
+ # branches: [main]
12
+ # types: [opened, closed, synchronize]
13
+
14
+ # jobs:
15
+ # format:
16
+ # runs-on: ubuntu-latest
17
+ # steps:
18
+ # - name: Run Ultralytics Formatting
19
+ # uses: ultralytics/actions@main
20
+ # with:
21
+ # token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, do not modify
22
+ # python: true # format Python code and docstrings
23
+ # markdown: true # format Markdown
24
+ # prettier: true # format YAML
25
+ # spelling: true # check spelling
26
+ # links: false # check broken links
@@ -0,0 +1,32 @@
1
+ name: nightly-test
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 18 * * *" # Runs at 6:00 PM UTC every day, which is 2:00 AM Beijing Time the next day
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: self-hosted
10
+
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+
14
+ - uses: actions/setup-python@v4
15
+ with:
16
+ python-version: "3.10"
17
+
18
+ - name: install dependency
19
+ run: |
20
+ python -m pip install --upgrade pip wheel setuptools
21
+ pip install .
22
+ pip install pytest onnxruntime
23
+
24
+ - name: benchmark test
25
+ run: |
26
+ python tests/test_benchmark.py
27
+
28
+ - name: model test
29
+ run: |
30
+ pip install .
31
+ pip install pytest pytest-xdist onnxruntime timm torchvision --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu
32
+ python tests/test_onnx_nets.py
@@ -0,0 +1,38 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ deploy:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v3
26
+ with:
27
+ python-version: "3.x"
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip wheel setuptools
31
+ pip install build
32
+ - name: Build package
33
+ run: python -m build
34
+ - name: Publish package
35
+ uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
36
+ with:
37
+ user: __token__
38
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,133 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ tmp/
27
+ # PyInstaller
28
+ # Usually these files are written by a python script from a template
29
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
30
+ *.manifest
31
+ *.spec
32
+ uv.lock
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *,cover
47
+ .hypothesis/
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Django stuff:
54
+ *.log
55
+ local_settings.py
56
+
57
+ # Flask stuff:
58
+ instance/
59
+ .webassets-cache
60
+
61
+ # Scrapy stuff:
62
+ .scrapy
63
+
64
+ # Sphinx documentation
65
+ docs/_build/
66
+
67
+ # PyBuilder
68
+ target/
69
+
70
+ # IPython Notebook
71
+ .ipynb_checkpoints
72
+
73
+ # pyenv
74
+ .python-version
75
+
76
+ # celery beat schedule file
77
+ celerybeat-schedule
78
+
79
+ # dotenv
80
+ .env
81
+
82
+ # virtualenv
83
+ venv/
84
+ ENV/
85
+
86
+ # Spyder project settings
87
+ .spyderproject
88
+
89
+ # Rope project settings
90
+ .ropeproject
91
+
92
+ # atom remote-sync package
93
+ .remote-sync.json
94
+
95
+ # weights
96
+ weights/
97
+
98
+ #DS_Store
99
+ .DS_Store
100
+
101
+ # dev stuff
102
+ eval/
103
+ eval.ipynb
104
+ dev.ipynb
105
+ .vscode/
106
+
107
+ # not ready
108
+ videos/
109
+ templates/
110
+ data/ssd_dataloader.py
111
+ data/datasets/
112
+ doc/visualize.py
113
+ read_results.py
114
+ ssd300_120000/
115
+ demos/live
116
+ webdemo.py
117
+ test_data_aug.py
118
+
119
+ # attributes
120
+
121
+ # pycharm
122
+ .idea/
123
+
124
+ # temp checkout soln
125
+ data/datasets/
126
+ data/ssd_dataloader.py
127
+ tests/model
128
+
129
+ # pylint
130
+ .pylintrc
131
+
132
+ # onnx
133
+ *.onnx
@@ -0,0 +1 @@
1
+ onnxslim/argparser.py
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ desmond.yao@buaa.edu.cn.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,86 @@
1
+ # Contributing to OnnxSlim
2
+
3
+ Thank you for your interest in contributing to OnnxSlim! This document provides guidelines and instructions to help you get started.
4
+
5
+ ## Code of Conduct
6
+
7
+ Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md) to foster an open and welcoming environment.
8
+
9
+ ## How to Contribute
10
+
11
+ ### Reporting Bugs
12
+
13
+ If you find a bug, please create an issue with the following information:
14
+
15
+ - Clear description of the bug
16
+ - Steps to reproduce
17
+ - Expected behavior
18
+ - Screenshots (if applicable)
19
+ - Environment details (OS, Python version, ONNX version, etc.)
20
+
21
+ ### Suggesting Features
22
+
23
+ We welcome feature suggestions! Please create an issue with:
24
+
25
+ - Clear description of the feature
26
+ - Rationale for the feature
27
+ - Potential implementation approach (optional)
28
+
29
+ ### Pull Requests
30
+
31
+ 1. Fork the repository
32
+ 2. Create a new branch (`git checkout -b feature/amazing-feature`)
33
+ 3. Make your changes
34
+ 4. Run tests if available
35
+ 5. Commit your changes (`git commit -m 'Add amazing feature'`)
36
+ 6. Push to the branch (`git push origin feature/amazing-feature`)
37
+ 7. Open a Pull Request
38
+
39
+ ### Coding Standards
40
+
41
+ - Follow the existing code style
42
+ - Write clear, commented, and testable code
43
+ - Keep commits focused and atomic
44
+ - Write meaningful commit messages
45
+ - Use type hints where appropriate
46
+
47
+ ## Development Setup
48
+
49
+ 1. Clone the repository
50
+ 2. Create a virtual environment
51
+ 3. Install dependencies
52
+
53
+ ```bash
54
+ # Setup commands
55
+ git clone https://github.com/username/OnnxSlim.git
56
+ cd OnnxSlim
57
+ pip install -e . # Install package in development mode
58
+ ```
59
+
60
+ ## Testing
61
+
62
+ Please ensure your code passes all tests:
63
+
64
+ ```bash
65
+ # Test commands
66
+ pytest tests/test_onnxslim.py
67
+ ```
68
+
69
+ ## Documentation
70
+
71
+ - Update documentation for any changed functionality
72
+ - Document new features thoroughly
73
+ - Use clear and concise language
74
+ - Add docstrings to new functions and classes
75
+
76
+ ## Review Process
77
+
78
+ 1. Maintainers will review your PR
79
+ 2. Changes may be requested
80
+ 3. Once approved, your PR will be merged
81
+
82
+ ## License
83
+
84
+ By contributing, you agree that your contributions will be licensed under the project's license.
85
+
86
+ Thank you for contributing to OnnxSlim!
@@ -1,38 +1,28 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onnxslim
3
- Version: 0.1.79
3
+ Version: 0.1.81
4
4
  Summary: OnnxSlim: A Toolkit to Help Optimize Onnx Model
5
- Home-page: https://github.com/inisis/OnnxSlim
6
- Author: inisis
7
- Author-email: desmond.yao@buaa.edu.cn
8
- License: MIT
9
- Project-URL: Bug Tracker, https://github.com/inisis/OnnxSlim/issues
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
5
+ Project-URL: homepage, https://github.com/inisis/OnnxSlim
6
+ Project-URL: issues, https://github.com/inisis/OnnxSlim/issues
7
+ Author-email: inisis <desmond.yao@buaa.edu.cn>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
12
10
  Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
14
- Requires-Python: >=3.6
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
14
+ Requires-Python: >=3.8
15
+ Requires-Dist: colorama
16
+ Requires-Dist: ml-dtypes
17
17
  Requires-Dist: onnx
18
- Requires-Dist: sympy>=1.13.1
19
18
  Requires-Dist: packaging
20
- Requires-Dist: colorama
21
- Requires-Dist: ml_dtypes
22
- Dynamic: author
23
- Dynamic: author-email
24
- Dynamic: classifier
25
- Dynamic: description
26
- Dynamic: description-content-type
27
- Dynamic: home-page
28
- Dynamic: license
29
- Dynamic: license-file
30
- Dynamic: project-url
31
- Dynamic: requires-dist
32
- Dynamic: requires-python
33
- Dynamic: summary
34
-
35
- # OnnxSlim
19
+ Requires-Dist: sympy>=1.13.1
20
+ Description-Content-Type: text/markdown
21
+
22
+ <p align="center">
23
+ <img src="assets/logo/onnxslim-banner-light.svg#gh-light-mode-only" alt="OnnxSlim Logo" width="640"/>
24
+ <img src="assets/logo/onnxslim-banner.svg#gh-dark-mode-only" alt="OnnxSlim Logo" width="640"/>
25
+ </p>
36
26
 
37
27
  <p align="center">
38
28
  <a href="https://pypi.org/project/onnxslim">
@@ -1,4 +1,7 @@
1
- # OnnxSlim
1
+ <p align="center">
2
+ <img src="assets/logo/onnxslim-banner-light.svg#gh-light-mode-only" alt="OnnxSlim Logo" width="640"/>
3
+ <img src="assets/logo/onnxslim-banner.svg#gh-dark-mode-only" alt="OnnxSlim Logo" width="640"/>
4
+ </p>
2
5
 
3
6
  <p align="center">
4
7
  <a href="https://pypi.org/project/onnxslim">
@@ -0,0 +1,47 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 640" width="1280" height="640">
2
+ <defs>
3
+ <linearGradient id="oGradL" x1="0%" y1="0%" x2="100%" y2="100%">
4
+ <stop offset="0%" style="stop-color:#005CED;stop-opacity:1" />
5
+ <stop offset="100%" style="stop-color:#00B4D8;stop-opacity:1" />
6
+ </linearGradient>
7
+ <linearGradient id="sGradL" x1="0%" y1="0%" x2="0%" y2="100%">
8
+ <stop offset="0%" style="stop-color:#00D4AA;stop-opacity:1" />
9
+ <stop offset="50%" style="stop-color:#00C9B7;stop-opacity:1" />
10
+ <stop offset="100%" style="stop-color:#00B4D8;stop-opacity:1" />
11
+ </linearGradient>
12
+ </defs>
13
+
14
+ <!-- Background -->
15
+ <rect width="1280" height="640" fill="#FFFFFF"/>
16
+
17
+ <!-- Decorative background elements -->
18
+ <circle cx="100" cy="100" r="200" fill="#005CED" opacity="0.03"/>
19
+ <circle cx="1180" cy="540" r="250" fill="#00D4AA" opacity="0.05"/>
20
+
21
+ <!-- Logo group - smaller, positioned on left -->
22
+ <g transform="translate(120, 170)">
23
+ <!-- O - outer ring -->
24
+ <circle cx="150" cy="150" r="125" fill="none" stroke="url(#oGradL)" stroke-width="20"/>
25
+
26
+ <!-- Smooth S curve -->
27
+ <path d="M 172 80
28
+ Q 117 80, 112 117
29
+ Q 108 150, 150 150
30
+ Q 192 150, 188 188
31
+ Q 183 220, 126 220"
32
+ fill="none"
33
+ stroke="url(#sGradL)"
34
+ stroke-width="12"
35
+ stroke-linecap="round"/>
36
+
37
+ <!-- Nodes at key positions -->
38
+ <circle cx="172" cy="80" r="18" fill="#00D4AA"/>
39
+ <circle cx="112" cy="117" r="14" fill="#00CCBB"/>
40
+ <circle cx="150" cy="150" r="18" fill="#00C4C0"/>
41
+ <circle cx="188" cy="188" r="14" fill="#00BCC5"/>
42
+ <circle cx="126" cy="220" r="18" fill="#00B4D8"/>
43
+ </g>
44
+
45
+ <!-- Text "OnnxSlim" - larger, centered vertically -->
46
+ <text x="420" y="360" font-family="Arial, Helvetica, sans-serif" font-size="150" font-weight="bold" fill="#005CED">OnnxSlim</text>
47
+ </svg>
@@ -0,0 +1,55 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 640" width="1280" height="640">
2
+ <defs>
3
+ <linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
4
+ <stop offset="0%" style="stop-color:#0a1628;stop-opacity:1" />
5
+ <stop offset="100%" style="stop-color:#1a2d4a;stop-opacity:1" />
6
+ </linearGradient>
7
+ <linearGradient id="oGrad" x1="0%" y1="0%" x2="100%" y2="100%">
8
+ <stop offset="0%" style="stop-color:#005CED;stop-opacity:1" />
9
+ <stop offset="100%" style="stop-color:#00B4D8;stop-opacity:1" />
10
+ </linearGradient>
11
+ <linearGradient id="sGrad" x1="0%" y1="0%" x2="0%" y2="100%">
12
+ <stop offset="0%" style="stop-color:#00D4AA;stop-opacity:1" />
13
+ <stop offset="50%" style="stop-color:#00C9B7;stop-opacity:1" />
14
+ <stop offset="100%" style="stop-color:#00B4D8;stop-opacity:1" />
15
+ </linearGradient>
16
+ <linearGradient id="textGrad" x1="0%" y1="0%" x2="100%" y2="0%">
17
+ <stop offset="0%" style="stop-color:#FFFFFF;stop-opacity:1" />
18
+ <stop offset="100%" style="stop-color:#E0E0E0;stop-opacity:1" />
19
+ </linearGradient>
20
+ </defs>
21
+
22
+ <!-- Background -->
23
+ <rect width="1280" height="640" fill="url(#bgGrad)"/>
24
+
25
+ <!-- Decorative background elements -->
26
+ <circle cx="100" cy="100" r="200" fill="#005CED" opacity="0.05"/>
27
+ <circle cx="1180" cy="540" r="250" fill="#00D4AA" opacity="0.05"/>
28
+
29
+ <!-- Logo group - smaller, positioned on left -->
30
+ <g transform="translate(120, 170)">
31
+ <!-- O - outer ring -->
32
+ <circle cx="150" cy="150" r="125" fill="none" stroke="url(#oGrad)" stroke-width="20"/>
33
+
34
+ <!-- Smooth S curve -->
35
+ <path d="M 172 80
36
+ Q 117 80, 112 117
37
+ Q 108 150, 150 150
38
+ Q 192 150, 188 188
39
+ Q 183 220, 126 220"
40
+ fill="none"
41
+ stroke="url(#sGrad)"
42
+ stroke-width="12"
43
+ stroke-linecap="round"/>
44
+
45
+ <!-- Nodes at key positions -->
46
+ <circle cx="172" cy="80" r="18" fill="#00D4AA"/>
47
+ <circle cx="112" cy="117" r="14" fill="#00CCBB"/>
48
+ <circle cx="150" cy="150" r="18" fill="#00C4C0"/>
49
+ <circle cx="188" cy="188" r="14" fill="#00BCC5"/>
50
+ <circle cx="126" cy="220" r="18" fill="#00B4D8"/>
51
+ </g>
52
+
53
+ <!-- Text "OnnxSlim" - larger, centered vertically -->
54
+ <text x="420" y="360" font-family="Arial, Helvetica, sans-serif" font-size="150" font-weight="bold" fill="url(#textGrad)">OnnxSlim</text>
55
+ </svg>