tico 0.1.0.dev250625__py3-none-any.whl → 0.1.0.dev250629__py3-none-any.whl
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.
- tico/__init__.py +1 -1
- tico/passes/decompose_fake_quantize_tensor_qparams.py +1 -1
- tico/utils/convert.py +17 -0
- {tico-0.1.0.dev250625.dist-info → tico-0.1.0.dev250629.dist-info}/METADATA +1 -1
- {tico-0.1.0.dev250625.dist-info → tico-0.1.0.dev250629.dist-info}/RECORD +9 -9
- {tico-0.1.0.dev250625.dist-info → tico-0.1.0.dev250629.dist-info}/LICENSE +0 -0
- {tico-0.1.0.dev250625.dist-info → tico-0.1.0.dev250629.dist-info}/WHEEL +0 -0
- {tico-0.1.0.dev250625.dist-info → tico-0.1.0.dev250629.dist-info}/entry_points.txt +0 -0
- {tico-0.1.0.dev250625.dist-info → tico-0.1.0.dev250629.dist-info}/top_level.txt +0 -0
tico/__init__.py
CHANGED
@@ -21,7 +21,7 @@ from tico.config import CompileConfigV1, get_default_config
|
|
21
21
|
from tico.utils.convert import convert, convert_from_exported_program, convert_from_pt2
|
22
22
|
|
23
23
|
# THIS LINE IS AUTOMATICALLY GENERATED BY setup.py
|
24
|
-
__version__ = "0.1.0.
|
24
|
+
__version__ = "0.1.0.dev250629"
|
25
25
|
|
26
26
|
MINIMUM_SUPPORTED_VERSION = "2.5.0"
|
27
27
|
SECURE_TORCH_VERSION = "2.6.0"
|
@@ -51,7 +51,7 @@ def get_quant_type(min: int, max: int) -> torch.dtype:
|
|
51
51
|
if min == -32767 and max == 32767:
|
52
52
|
return torch.int16
|
53
53
|
|
54
|
-
raise RuntimeError("Not supported min/max values")
|
54
|
+
raise RuntimeError(f"Not supported min/max values: {min}/{max}")
|
55
55
|
|
56
56
|
|
57
57
|
def get_constant_from_tensor(
|
tico/utils/convert.py
CHANGED
@@ -162,6 +162,22 @@ def check_unsupported_target(exported_program: ExportedProgram):
|
|
162
162
|
raise NotYetSupportedError("NOT SUPPORTED OPERATOR IN GRAPH MODULE")
|
163
163
|
|
164
164
|
|
165
|
+
def check_training_ops(exported_program: ExportedProgram):
|
166
|
+
TRAINING_OPS = {
|
167
|
+
torch.ops.aten.dropout.default,
|
168
|
+
torch.ops.aten.native_dropout.default,
|
169
|
+
}
|
170
|
+
found = set()
|
171
|
+
for node in exported_program.graph.nodes:
|
172
|
+
if node.op == "call_function" and node.target in TRAINING_OPS:
|
173
|
+
found.add(node.target)
|
174
|
+
|
175
|
+
if found:
|
176
|
+
raise RuntimeError(
|
177
|
+
f"Detected training-mode ops {sorted(found)}. Call `model.eval()` before export."
|
178
|
+
)
|
179
|
+
|
180
|
+
|
165
181
|
def convert_exported_module_to_circle(
|
166
182
|
exported_program: ExportedProgram,
|
167
183
|
config: CompileConfigBase = get_default_config(),
|
@@ -170,6 +186,7 @@ def convert_exported_module_to_circle(
|
|
170
186
|
logger.debug("Input ExportedProgram (must be core aten)")
|
171
187
|
logger.debug(exported_program)
|
172
188
|
|
189
|
+
check_training_ops(exported_program)
|
173
190
|
# PRE-EDGE PASSES
|
174
191
|
#
|
175
192
|
# Here are the passes that run before to_edge() conversion.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
tico/__init__.py,sha256=
|
1
|
+
tico/__init__.py,sha256=RfkSpTE90FwwM4kJohc9prmZ7kQXSUmZaZiUKxrn-D0,1743
|
2
2
|
tico/pt2_to_circle.py,sha256=gu3MD4Iqc0zMZcCZ2IT8oGbyj21CTSbT3Rgd9s2B_9A,2767
|
3
3
|
tico/config/__init__.py,sha256=xZzCXjZ84qE-CsBi-dfaL05bqpQ3stKKfTXhnrJRyVs,142
|
4
4
|
tico/config/base.py,sha256=anwOiJFkUxUi7Cef573JgQcjk6S-FSi6O_TLjYASW-g,1244
|
@@ -70,7 +70,7 @@ tico/passes/convert_to_relu6.py,sha256=1BJpUwUb6Zli_1y3eyJQo7dg9B1xvZ7sYjMbvEQsF
|
|
70
70
|
tico/passes/decompose_addmm.py,sha256=0IUZjRS8G-h7LPeYu27gxWyTKi3pKAF1uNU1y-mHLL0,4056
|
71
71
|
tico/passes/decompose_batch_norm.py,sha256=hWR6PMqgzMuNME7oLiNaxDJl5ZwXZeqxSkcNEMW4vAE,6514
|
72
72
|
tico/passes/decompose_fake_quantize.py,sha256=Y29HncMwgRffwmzl5-iua8MhWLd9zEAUWqlNhGhmoHg,5368
|
73
|
-
tico/passes/decompose_fake_quantize_tensor_qparams.py,sha256=
|
73
|
+
tico/passes/decompose_fake_quantize_tensor_qparams.py,sha256=y519moei8WeEiSv24TnPoqy0i7xXc6j34rT-EykajCM,14020
|
74
74
|
tico/passes/decompose_group_norm.py,sha256=rtjv3PrcFTtZ68uCsmE2LibnWaQU-e8NdKkblL4LqxE,10197
|
75
75
|
tico/passes/decompose_grouped_conv2d.py,sha256=n2qv320akL1ju33ucZ6lU1cKEAaj0NI8YZ5CrUnkRLM,8512
|
76
76
|
tico/passes/decompose_slice_scatter.py,sha256=xqMHKhW2595YoAeubKZ4jRhYW4TQ09EXPgLNgODqXG8,5653
|
@@ -180,7 +180,7 @@ tico/serialize/operators/op_view.py,sha256=5EMww-ve17Vm9XPuV03Tn7vJsjpU2J8U4d_FO
|
|
180
180
|
tico/serialize/operators/op_where.py,sha256=doE81GSwygrPBm3JIfN9w7kKXxeIYKxgk0eoY22QIcg,2845
|
181
181
|
tico/serialize/operators/utils.py,sha256=lXGpEJW1h8U_-gfc6EWjvvSiq3yJ9P-v1v3EMRT_pSk,2954
|
182
182
|
tico/utils/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
183
|
-
tico/utils/convert.py,sha256=
|
183
|
+
tico/utils/convert.py,sha256=fJRltUkBALia6N7lKcMMvmNBU-5DYyztnNZQjcgjvXU,12452
|
184
184
|
tico/utils/define.py,sha256=Ypgp7YffM4pgPl4Zh6TmogSn1OxGBMRw_e09qYGflZk,1467
|
185
185
|
tico/utils/diff_graph.py,sha256=_eDGGPDPYQD4b--MXX0DLoVgSt_wLfNPt47UlolLLR4,5272
|
186
186
|
tico/utils/errors.py,sha256=f3csJjgbXG9W1aHhqEcou008Aor19W57X8oT5Hx8w1M,954
|
@@ -198,9 +198,9 @@ tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
|
198
198
|
tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
|
199
199
|
tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
|
200
200
|
tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
|
201
|
-
tico-0.1.0.
|
202
|
-
tico-0.1.0.
|
203
|
-
tico-0.1.0.
|
204
|
-
tico-0.1.0.
|
205
|
-
tico-0.1.0.
|
206
|
-
tico-0.1.0.
|
201
|
+
tico-0.1.0.dev250629.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
|
202
|
+
tico-0.1.0.dev250629.dist-info/METADATA,sha256=DSkGeB1pQ2OlIkRm5lh4m4GpX5e5tuEk9rsU0joBLWE,8846
|
203
|
+
tico-0.1.0.dev250629.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
204
|
+
tico-0.1.0.dev250629.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
|
205
|
+
tico-0.1.0.dev250629.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
|
206
|
+
tico-0.1.0.dev250629.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|