Skip to content

Commit 32dd66c

Browse files
committed
1. update changelog; 2. import onnxslim on top level; 3. pin mimimal onnxslim version and deduplication
Signed-off-by: inisis <[email protected]>
1 parent de38272 commit 32dd66c

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Model Optimizer Changelog (Linux)
2525
**Misc**
2626

2727
- Bump minimum recommended transformers version to 4.53.
28+
- Replace ONNX simplification package from 'onnxsim' to 'onnxslim'
2829

2930
0.39 (2025-11-11)
3031
^^^^^^^^^^^^^^^^^

modelopt/onnx/quantization/quantize.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
import onnx
4242
import onnx.onnx_cpp2py_export.checker as C
43+
import onnxslim
4344
import onnx_graphsurgeon as gs
4445

4546
from modelopt.onnx.logging_config import configure_logging, logger
@@ -132,13 +133,6 @@ def _preprocess_onnx(
132133
# Simplify model if requested
133134
if simplify:
134135
logger.info("Attempting to simplify model")
135-
try:
136-
import onnxslim
137-
except ModuleNotFoundError as e:
138-
logger.warning(
139-
"onnxslim is not installed. Please install it with 'pip install onnxslim'."
140-
)
141-
raise e
142136

143137
try:
144138
model_simp = onnxslim.slim(onnx_model, skip_fusion_patterns=["FusionGemm"])

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@
5151
"onnxruntime~=1.22.0 ; platform_machine == 'aarch64' or platform_system == 'Darwin'",
5252
"onnxruntime-gpu~=1.22.0 ; platform_machine != 'aarch64' and platform_system != 'Darwin' and platform_system != 'Windows'", # noqa: E501
5353
"onnxruntime-directml==1.20.0; platform_system == 'Windows'",
54-
"onnxscript", # For test_onnx_dynamo_export unit test
5554
"onnxscript", # For autocast opset conversion and test_onnx_dynamo_export unit test
5655
"polygraphy>=0.49.22",
57-
"onnxslim",
56+
"onnxslim>=0.1.75",
5857
],
5958
"hf": [
6059
"accelerate>=1.0.0",

0 commit comments

Comments
 (0)