onnxslim 0.1.77__tar.gz → 0.1.78__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.
- {onnxslim-0.1.77/onnxslim.egg-info → onnxslim-0.1.78}/PKG-INFO +76 -15
- {onnxslim-0.1.77 → onnxslim-0.1.78}/README.md +75 -14
- onnxslim-0.1.78/VERSION +1 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py +13 -5
- onnxslim-0.1.78/onnxslim/version.py +1 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78/onnxslim.egg-info}/PKG-INFO +76 -15
- onnxslim-0.1.77/VERSION +0 -1
- onnxslim-0.1.77/onnxslim/version.py +0 -1
- {onnxslim-0.1.77 → onnxslim-0.1.78}/LICENSE +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/MANIFEST.in +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/__main__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/argparser.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/cli/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/cli/_main.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/optimization/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/optimization/dead_node_elimination.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/optimization/subexpression_elimination.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/optimization/weight_tying.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/elimination/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/elimination/concat.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/elimination/reshape.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/elimination/reshape_as.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/elimination/slice.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/elimination/unsqueeze.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/concat_reshape.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/convadd.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/convbn.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/convmul.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/gelu.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/gemm.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/padconv.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/fusion/reduce.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/core/pattern/registry.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/misc/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/misc/tabulate.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/_sympy/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/_sympy/functions.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/_sympy/numbers.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/_sympy/printers.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/_sympy/solve.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/_sympy/symbol.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/exporters/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/exporters/base_exporter.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/graph_pattern/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/graph_pattern/graph_pattern.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/importers/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/importers/base_importer.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/importers/onnx_importer.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/ir/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/ir/function.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/ir/graph.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/ir/node.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/ir/tensor.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/logger/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/logger/logger.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/util/__init__.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/util/exception.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/util/misc.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/symbolic_shape_infer.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/utils.py +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim.egg-info/SOURCES.txt +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim.egg-info/dependency_links.txt +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim.egg-info/entry_points.txt +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim.egg-info/requires.txt +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim.egg-info/top_level.txt +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim.egg-info/zip-safe +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/pyproject.toml +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/setup.cfg +0 -0
- {onnxslim-0.1.77 → onnxslim-0.1.78}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onnxslim
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.78
|
|
4
4
|
Summary: OnnxSlim: A Toolkit to Help Optimize Onnx Model
|
|
5
5
|
Home-page: https://github.com/inisis/OnnxSlim
|
|
6
6
|
Author: inisis
|
|
@@ -61,7 +61,9 @@ Dynamic: summary
|
|
|
61
61
|
|
|
62
62
|
OnnxSlim can help you slim your onnx model, with less operators, but same accuracy, better inference speed.
|
|
63
63
|
|
|
64
|
-
- 🚀 2025/
|
|
64
|
+
- 🚀 2025/11/29: Top 1% on PyPI
|
|
65
|
+
- 🚀 2025/11/27: OnnxSlim is merged into [NVIDIA TensorRT-Model-Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer) 🤗🤗🤗
|
|
66
|
+
- 🚀 2025/05/17: OnnxSlim is merged into [HuggingFace optimum](https://github.com/huggingface/optimum) 🤗🤗🤗
|
|
65
67
|
- 🚀 2025/04/30: Rank 1st in the [AICAS 2025 LLM inference optimization challenge](https://tianchi.aliyun.com/competition/entrance/532289/customize588)
|
|
66
68
|
- 🚀 2025/01/28: Achieved 1M downloads
|
|
67
69
|
- 🚀 2024/06/23: OnnxSlim is merged into [transformers.js](https://github.com/huggingface/transformers.js) 🤗🤗🤗
|
|
@@ -119,19 +121,78 @@ For more usage, see onnxslim -h or refer to our [examples](./examples)
|
|
|
119
121
|
|
|
120
122
|
# Projects using OnnxSlim
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
124
|
+
<table style="width:100%; border-collapse:separate; border-spacing:10px;">
|
|
125
|
+
<tr>
|
|
126
|
+
<td style="vertical-align:middle;">
|
|
127
|
+
<img src="https://avatars.githubusercontent.com/u/1728152?s=200&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
128
|
+
<a href="https://github.com/NVIDIA/TensorRT-Model-Optimizer" target="_blank">NVIDIA/TensorRT-Model-Optimizer</a>
|
|
129
|
+
</td>
|
|
130
|
+
<td style="vertical-align:middle;">
|
|
131
|
+
<img src="https://avatars.githubusercontent.com/u/1961952?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
132
|
+
<a href="https://github.com/alibaba/MNN" target="_blank">alibaba/MNN</a>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td style="vertical-align:middle;">
|
|
137
|
+
<img src="https://avatars.githubusercontent.com/u/26833451?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
138
|
+
<a href="https://github.com/ultralytics/ultralytics" target="_blank">ultralytics/ultralytics</a>
|
|
139
|
+
</td>
|
|
140
|
+
<td style="vertical-align:middle;">
|
|
141
|
+
<img src="https://avatars.githubusercontent.com/u/131524?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
142
|
+
<a href="https://github.com/mozilla/smart_autofill" target="_blank">Mozilla/smart_autofill</a>
|
|
143
|
+
</td>
|
|
144
|
+
</tr>
|
|
145
|
+
<tr>
|
|
146
|
+
<td style="vertical-align:middle;">
|
|
147
|
+
<img src="https://avatars.githubusercontent.com/u/1961952?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
148
|
+
<a href="https://github.com/wangzhaode/mnn-llm" target="_blank">alibaba/MNN-LLM</a>
|
|
149
|
+
</td>
|
|
150
|
+
<td style="vertical-align:middle;">
|
|
151
|
+
<img src="https://avatars.githubusercontent.com/u/25720743?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
152
|
+
<a href="https://github.com/huggingface/transformers.js" target="_blank">huggingface/transformers.js</a>
|
|
153
|
+
</td>
|
|
154
|
+
</tr>
|
|
155
|
+
<tr>
|
|
156
|
+
<td style="vertical-align:middle;">
|
|
157
|
+
<img src="https://avatars.githubusercontent.com/u/25720743?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
158
|
+
<a href="https://github.com/huggingface/optimum" target="_blank">huggingface/optimum</a>
|
|
159
|
+
</td>
|
|
160
|
+
<td style="vertical-align:middle;">
|
|
161
|
+
<img src="https://avatars.githubusercontent.com/u/23534030?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
162
|
+
<a href="https://github.com/PaddlePaddle/PaddleOCR" target="_blank">PaddlePaddle/PaddleOCR</a>
|
|
163
|
+
</td>
|
|
164
|
+
</tr>
|
|
165
|
+
<tr>
|
|
166
|
+
<td style="vertical-align:middle;">
|
|
167
|
+
<img src="https://avatars.githubusercontent.com/u/109945100?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
168
|
+
<a href="https://github.com/modelscope/FunASR" target="_blank">ModelScope/FunASR</a>
|
|
169
|
+
</td>
|
|
170
|
+
<td style="vertical-align:middle;">
|
|
171
|
+
<img src="https://avatars.githubusercontent.com/u/111754012?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
172
|
+
<a href="https://github.com/CVCUDA/CV-CUDA" target="_blank">CVCUDA/CV-CUDA</a>
|
|
173
|
+
</td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr>
|
|
176
|
+
<td style="vertical-align:middle;">
|
|
177
|
+
<img src="https://avatars.githubusercontent.com/u/86091366?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
178
|
+
<a href="https://github.com/THU-MIG/yolov10" target="_blank">THU-MIG/yolov10</a>
|
|
179
|
+
</td>
|
|
180
|
+
<td style="vertical-align:middle;">
|
|
181
|
+
<img src="https://avatars.githubusercontent.com/u/48153283?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
182
|
+
<a href="https://github.com/sunsmarterjie/yolov12" target="_blank">sunsmarterjie/yolov12</a>
|
|
183
|
+
</td>
|
|
184
|
+
</tr>
|
|
185
|
+
<tr>
|
|
186
|
+
<td style="vertical-align:middle;">
|
|
187
|
+
<img src="https://avatars.githubusercontent.com/u/147458884?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
188
|
+
<a href="https://github.com/nndeploy/nndeploy" target="_blank">nndeploy/nndeploy</a>
|
|
189
|
+
</td>
|
|
190
|
+
<td style="vertical-align:middle;">
|
|
191
|
+
<img src="https://avatars.githubusercontent.com/u/126587470?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
192
|
+
<a href="https://github.com/deepghs/imgutils" target="_blank">deepghs/imgutils</a>
|
|
193
|
+
</td>
|
|
194
|
+
</tr>
|
|
195
|
+
</table>
|
|
135
196
|
|
|
136
197
|
# References
|
|
137
198
|
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
|
|
28
28
|
OnnxSlim can help you slim your onnx model, with less operators, but same accuracy, better inference speed.
|
|
29
29
|
|
|
30
|
-
- 🚀 2025/
|
|
30
|
+
- 🚀 2025/11/29: Top 1% on PyPI
|
|
31
|
+
- 🚀 2025/11/27: OnnxSlim is merged into [NVIDIA TensorRT-Model-Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer) 🤗🤗🤗
|
|
32
|
+
- 🚀 2025/05/17: OnnxSlim is merged into [HuggingFace optimum](https://github.com/huggingface/optimum) 🤗🤗🤗
|
|
31
33
|
- 🚀 2025/04/30: Rank 1st in the [AICAS 2025 LLM inference optimization challenge](https://tianchi.aliyun.com/competition/entrance/532289/customize588)
|
|
32
34
|
- 🚀 2025/01/28: Achieved 1M downloads
|
|
33
35
|
- 🚀 2024/06/23: OnnxSlim is merged into [transformers.js](https://github.com/huggingface/transformers.js) 🤗🤗🤗
|
|
@@ -85,19 +87,78 @@ For more usage, see onnxslim -h or refer to our [examples](./examples)
|
|
|
85
87
|
|
|
86
88
|
# Projects using OnnxSlim
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
<table style="width:100%; border-collapse:separate; border-spacing:10px;">
|
|
91
|
+
<tr>
|
|
92
|
+
<td style="vertical-align:middle;">
|
|
93
|
+
<img src="https://avatars.githubusercontent.com/u/1728152?s=200&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
94
|
+
<a href="https://github.com/NVIDIA/TensorRT-Model-Optimizer" target="_blank">NVIDIA/TensorRT-Model-Optimizer</a>
|
|
95
|
+
</td>
|
|
96
|
+
<td style="vertical-align:middle;">
|
|
97
|
+
<img src="https://avatars.githubusercontent.com/u/1961952?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
98
|
+
<a href="https://github.com/alibaba/MNN" target="_blank">alibaba/MNN</a>
|
|
99
|
+
</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td style="vertical-align:middle;">
|
|
103
|
+
<img src="https://avatars.githubusercontent.com/u/26833451?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
104
|
+
<a href="https://github.com/ultralytics/ultralytics" target="_blank">ultralytics/ultralytics</a>
|
|
105
|
+
</td>
|
|
106
|
+
<td style="vertical-align:middle;">
|
|
107
|
+
<img src="https://avatars.githubusercontent.com/u/131524?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
108
|
+
<a href="https://github.com/mozilla/smart_autofill" target="_blank">Mozilla/smart_autofill</a>
|
|
109
|
+
</td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr>
|
|
112
|
+
<td style="vertical-align:middle;">
|
|
113
|
+
<img src="https://avatars.githubusercontent.com/u/1961952?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
114
|
+
<a href="https://github.com/wangzhaode/mnn-llm" target="_blank">alibaba/MNN-LLM</a>
|
|
115
|
+
</td>
|
|
116
|
+
<td style="vertical-align:middle;">
|
|
117
|
+
<img src="https://avatars.githubusercontent.com/u/25720743?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
118
|
+
<a href="https://github.com/huggingface/transformers.js" target="_blank">huggingface/transformers.js</a>
|
|
119
|
+
</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td style="vertical-align:middle;">
|
|
123
|
+
<img src="https://avatars.githubusercontent.com/u/25720743?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
124
|
+
<a href="https://github.com/huggingface/optimum" target="_blank">huggingface/optimum</a>
|
|
125
|
+
</td>
|
|
126
|
+
<td style="vertical-align:middle;">
|
|
127
|
+
<img src="https://avatars.githubusercontent.com/u/23534030?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
128
|
+
<a href="https://github.com/PaddlePaddle/PaddleOCR" target="_blank">PaddlePaddle/PaddleOCR</a>
|
|
129
|
+
</td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr>
|
|
132
|
+
<td style="vertical-align:middle;">
|
|
133
|
+
<img src="https://avatars.githubusercontent.com/u/109945100?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
134
|
+
<a href="https://github.com/modelscope/FunASR" target="_blank">ModelScope/FunASR</a>
|
|
135
|
+
</td>
|
|
136
|
+
<td style="vertical-align:middle;">
|
|
137
|
+
<img src="https://avatars.githubusercontent.com/u/111754012?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
138
|
+
<a href="https://github.com/CVCUDA/CV-CUDA" target="_blank">CVCUDA/CV-CUDA</a>
|
|
139
|
+
</td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td style="vertical-align:middle;">
|
|
143
|
+
<img src="https://avatars.githubusercontent.com/u/86091366?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
144
|
+
<a href="https://github.com/THU-MIG/yolov10" target="_blank">THU-MIG/yolov10</a>
|
|
145
|
+
</td>
|
|
146
|
+
<td style="vertical-align:middle;">
|
|
147
|
+
<img src="https://avatars.githubusercontent.com/u/48153283?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
148
|
+
<a href="https://github.com/sunsmarterjie/yolov12" target="_blank">sunsmarterjie/yolov12</a>
|
|
149
|
+
</td>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td style="vertical-align:middle;">
|
|
153
|
+
<img src="https://avatars.githubusercontent.com/u/147458884?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
154
|
+
<a href="https://github.com/nndeploy/nndeploy" target="_blank">nndeploy/nndeploy</a>
|
|
155
|
+
</td>
|
|
156
|
+
<td style="vertical-align:middle;">
|
|
157
|
+
<img src="https://avatars.githubusercontent.com/u/126587470?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
158
|
+
<a href="https://github.com/deepghs/imgutils" target="_blank">deepghs/imgutils</a>
|
|
159
|
+
</td>
|
|
160
|
+
</tr>
|
|
161
|
+
</table>
|
|
101
162
|
|
|
102
163
|
# References
|
|
103
164
|
|
onnxslim-0.1.78/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.78
|
|
@@ -21,7 +21,6 @@ from collections.abc import Sequence
|
|
|
21
21
|
|
|
22
22
|
import numpy as np
|
|
23
23
|
import onnx
|
|
24
|
-
import onnx.numpy_helper
|
|
25
24
|
from onnx import IR_VERSION, ModelProto, defs
|
|
26
25
|
|
|
27
26
|
from onnxslim.third_party.onnx_graphsurgeon.exporters.base_exporter import BaseExporter
|
|
@@ -35,9 +34,11 @@ from onnxslim.third_party.onnx_graphsurgeon.ir.tensor import (
|
|
|
35
34
|
Tensor,
|
|
36
35
|
Variable,
|
|
37
36
|
)
|
|
37
|
+
|
|
38
38
|
from onnxslim.third_party.onnx_graphsurgeon.logger import G_LOGGER
|
|
39
39
|
from onnxslim.third_party.onnx_graphsurgeon.util import misc
|
|
40
40
|
|
|
41
|
+
from ml_dtypes import bfloat16, float8_e4m3fn
|
|
41
42
|
|
|
42
43
|
def dtype_to_onnx(dtype: np.dtype | onnx.TensorProto.DataType) -> int:
|
|
43
44
|
"""Converts a numpy dtype or ONNX data type to its integer representation."""
|
|
@@ -86,6 +87,15 @@ def update_import_domains(graph):
|
|
|
86
87
|
return graph.import_domains
|
|
87
88
|
|
|
88
89
|
|
|
90
|
+
def float32_to_bfloat16_uint16(x):
|
|
91
|
+
"""Convert a float32 value to bfloat16 represented as uint16."""
|
|
92
|
+
return bfloat16(x).view(np.uint16)
|
|
93
|
+
|
|
94
|
+
def float32_to_float8e4m3(x):
|
|
95
|
+
"""Convert a float32 value to float8e4m3 represented as uint8."""
|
|
96
|
+
return float8_e4m3fn(x).view(np.uint8)
|
|
97
|
+
|
|
98
|
+
|
|
89
99
|
class NumpyArrayConverter:
|
|
90
100
|
def __init__(self, container, scalar_converter):
|
|
91
101
|
self.func = np.vectorize(scalar_converter, otypes=[container])
|
|
@@ -95,12 +105,10 @@ class NumpyArrayConverter:
|
|
|
95
105
|
|
|
96
106
|
|
|
97
107
|
_NUMPY_ARRAY_CONVERTERS = {
|
|
98
|
-
onnx.TensorProto.BFLOAT16: NumpyArrayConverter(np.uint16,
|
|
108
|
+
onnx.TensorProto.BFLOAT16: NumpyArrayConverter(np.uint16, float32_to_bfloat16_uint16),
|
|
99
109
|
# FP8 in TensorRT supports negative zeros, no infinities
|
|
100
110
|
# See https://onnx.ai/onnx/technical/float8.html#papers
|
|
101
|
-
onnx.TensorProto.FLOAT8E4M3FN: NumpyArrayConverter(
|
|
102
|
-
np.uint8, lambda x: onnx.helper.float32_to_float8e4m3(x, fn=True, uz=False)
|
|
103
|
-
),
|
|
111
|
+
onnx.TensorProto.FLOAT8E4M3FN: NumpyArrayConverter(np.uint8, float32_to_float8e4m3),
|
|
104
112
|
}
|
|
105
113
|
|
|
106
114
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.78"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onnxslim
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.78
|
|
4
4
|
Summary: OnnxSlim: A Toolkit to Help Optimize Onnx Model
|
|
5
5
|
Home-page: https://github.com/inisis/OnnxSlim
|
|
6
6
|
Author: inisis
|
|
@@ -61,7 +61,9 @@ Dynamic: summary
|
|
|
61
61
|
|
|
62
62
|
OnnxSlim can help you slim your onnx model, with less operators, but same accuracy, better inference speed.
|
|
63
63
|
|
|
64
|
-
- 🚀 2025/
|
|
64
|
+
- 🚀 2025/11/29: Top 1% on PyPI
|
|
65
|
+
- 🚀 2025/11/27: OnnxSlim is merged into [NVIDIA TensorRT-Model-Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer) 🤗🤗🤗
|
|
66
|
+
- 🚀 2025/05/17: OnnxSlim is merged into [HuggingFace optimum](https://github.com/huggingface/optimum) 🤗🤗🤗
|
|
65
67
|
- 🚀 2025/04/30: Rank 1st in the [AICAS 2025 LLM inference optimization challenge](https://tianchi.aliyun.com/competition/entrance/532289/customize588)
|
|
66
68
|
- 🚀 2025/01/28: Achieved 1M downloads
|
|
67
69
|
- 🚀 2024/06/23: OnnxSlim is merged into [transformers.js](https://github.com/huggingface/transformers.js) 🤗🤗🤗
|
|
@@ -119,19 +121,78 @@ For more usage, see onnxslim -h or refer to our [examples](./examples)
|
|
|
119
121
|
|
|
120
122
|
# Projects using OnnxSlim
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
124
|
+
<table style="width:100%; border-collapse:separate; border-spacing:10px;">
|
|
125
|
+
<tr>
|
|
126
|
+
<td style="vertical-align:middle;">
|
|
127
|
+
<img src="https://avatars.githubusercontent.com/u/1728152?s=200&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
128
|
+
<a href="https://github.com/NVIDIA/TensorRT-Model-Optimizer" target="_blank">NVIDIA/TensorRT-Model-Optimizer</a>
|
|
129
|
+
</td>
|
|
130
|
+
<td style="vertical-align:middle;">
|
|
131
|
+
<img src="https://avatars.githubusercontent.com/u/1961952?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
132
|
+
<a href="https://github.com/alibaba/MNN" target="_blank">alibaba/MNN</a>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td style="vertical-align:middle;">
|
|
137
|
+
<img src="https://avatars.githubusercontent.com/u/26833451?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
138
|
+
<a href="https://github.com/ultralytics/ultralytics" target="_blank">ultralytics/ultralytics</a>
|
|
139
|
+
</td>
|
|
140
|
+
<td style="vertical-align:middle;">
|
|
141
|
+
<img src="https://avatars.githubusercontent.com/u/131524?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
142
|
+
<a href="https://github.com/mozilla/smart_autofill" target="_blank">Mozilla/smart_autofill</a>
|
|
143
|
+
</td>
|
|
144
|
+
</tr>
|
|
145
|
+
<tr>
|
|
146
|
+
<td style="vertical-align:middle;">
|
|
147
|
+
<img src="https://avatars.githubusercontent.com/u/1961952?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
148
|
+
<a href="https://github.com/wangzhaode/mnn-llm" target="_blank">alibaba/MNN-LLM</a>
|
|
149
|
+
</td>
|
|
150
|
+
<td style="vertical-align:middle;">
|
|
151
|
+
<img src="https://avatars.githubusercontent.com/u/25720743?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
152
|
+
<a href="https://github.com/huggingface/transformers.js" target="_blank">huggingface/transformers.js</a>
|
|
153
|
+
</td>
|
|
154
|
+
</tr>
|
|
155
|
+
<tr>
|
|
156
|
+
<td style="vertical-align:middle;">
|
|
157
|
+
<img src="https://avatars.githubusercontent.com/u/25720743?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
158
|
+
<a href="https://github.com/huggingface/optimum" target="_blank">huggingface/optimum</a>
|
|
159
|
+
</td>
|
|
160
|
+
<td style="vertical-align:middle;">
|
|
161
|
+
<img src="https://avatars.githubusercontent.com/u/23534030?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
162
|
+
<a href="https://github.com/PaddlePaddle/PaddleOCR" target="_blank">PaddlePaddle/PaddleOCR</a>
|
|
163
|
+
</td>
|
|
164
|
+
</tr>
|
|
165
|
+
<tr>
|
|
166
|
+
<td style="vertical-align:middle;">
|
|
167
|
+
<img src="https://avatars.githubusercontent.com/u/109945100?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
168
|
+
<a href="https://github.com/modelscope/FunASR" target="_blank">ModelScope/FunASR</a>
|
|
169
|
+
</td>
|
|
170
|
+
<td style="vertical-align:middle;">
|
|
171
|
+
<img src="https://avatars.githubusercontent.com/u/111754012?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
172
|
+
<a href="https://github.com/CVCUDA/CV-CUDA" target="_blank">CVCUDA/CV-CUDA</a>
|
|
173
|
+
</td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr>
|
|
176
|
+
<td style="vertical-align:middle;">
|
|
177
|
+
<img src="https://avatars.githubusercontent.com/u/86091366?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
178
|
+
<a href="https://github.com/THU-MIG/yolov10" target="_blank">THU-MIG/yolov10</a>
|
|
179
|
+
</td>
|
|
180
|
+
<td style="vertical-align:middle;">
|
|
181
|
+
<img src="https://avatars.githubusercontent.com/u/48153283?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
182
|
+
<a href="https://github.com/sunsmarterjie/yolov12" target="_blank">sunsmarterjie/yolov12</a>
|
|
183
|
+
</td>
|
|
184
|
+
</tr>
|
|
185
|
+
<tr>
|
|
186
|
+
<td style="vertical-align:middle;">
|
|
187
|
+
<img src="https://avatars.githubusercontent.com/u/147458884?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
188
|
+
<a href="https://github.com/nndeploy/nndeploy" target="_blank">nndeploy/nndeploy</a>
|
|
189
|
+
</td>
|
|
190
|
+
<td style="vertical-align:middle;">
|
|
191
|
+
<img src="https://avatars.githubusercontent.com/u/126587470?s=48&v=4" width="22" height="22" style="vertical-align:middle; margin-right:8px;"/>
|
|
192
|
+
<a href="https://github.com/deepghs/imgutils" target="_blank">deepghs/imgutils</a>
|
|
193
|
+
</td>
|
|
194
|
+
</tr>
|
|
195
|
+
</table>
|
|
135
196
|
|
|
136
197
|
# References
|
|
137
198
|
|
onnxslim-0.1.77/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.1.77
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.77"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/exporters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/graph_pattern/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/importers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/logger/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxslim-0.1.77 → onnxslim-0.1.78}/onnxslim/third_party/onnx_graphsurgeon/util/exception.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|