tico 0.1.0.dev250626__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 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.dev250626"
24
+ __version__ = "0.1.0.dev250629"
25
25
 
26
26
  MINIMUM_SUPPORTED_VERSION = "2.5.0"
27
27
  SECURE_TORCH_VERSION = "2.6.0"
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tico
3
- Version: 0.1.0.dev250626
3
+ Version: 0.1.0.dev250629
4
4
  Summary: Convert exported Torch module to circle
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -1,4 +1,4 @@
1
- tico/__init__.py,sha256=V3kK40Sfe76REBha3SgBJMRTeeZYJFErkkr3yo2nCE0,1743
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
@@ -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=gh_EcWwjZZ5IyQKtazfiZ1_FvAMXe0leu5nPN-0OcHg,11919
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.dev250626.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
202
- tico-0.1.0.dev250626.dist-info/METADATA,sha256=WnpZWIQvH2xOtEbyhhWKZNI56zg_fJ3ublFR7M-t128,8846
203
- tico-0.1.0.dev250626.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
204
- tico-0.1.0.dev250626.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
205
- tico-0.1.0.dev250626.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
206
- tico-0.1.0.dev250626.dist-info/RECORD,,
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,,