tico 0.1.0.dev250703__py3-none-any.whl → 0.1.0.dev250707__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.dev250703"
24
+ __version__ = "0.1.0.dev250707"
25
25
 
26
26
  MINIMUM_SUPPORTED_VERSION = "2.5.0"
27
27
  SECURE_TORCH_VERSION = "2.6.0"
@@ -31,6 +31,7 @@ from tico.utils.utils import quant_min_max, set_new_meta_val
31
31
  from tico.utils.validate_args_kwargs import (
32
32
  AddTensorArgs,
33
33
  BmmArgs,
34
+ CatArgs,
34
35
  LinearArgs,
35
36
  MulTensorArgs,
36
37
  PermuteArgs,
@@ -79,7 +80,7 @@ def _u8_to_i16(qparam: QuantParam) -> QuantParam:
79
80
  max_ = u8_scale * (255 - u8_zerop)
80
81
  min_ = u8_scale * (-u8_zerop)
81
82
 
82
- abs_max = abs(max([max_, min_], key=abs))
83
+ abs_max = max(abs(max_), abs(min_))
83
84
  s16_scale = abs_max / 32767
84
85
  s16_zerop = 0
85
86
 
@@ -282,6 +283,35 @@ class InsertQuantizeOnDtypeMismatch(PassBase):
282
283
  else:
283
284
  raise NotYetSupportedError("Unsupported dtype")
284
285
 
286
+ elif node.target == torch.ops.aten.cat.default:
287
+ cat_args = CatArgs(*node.args, **node.kwargs)
288
+ tensors = cat_args.tensors
289
+
290
+ if any(QPARAM_KEY not in x.meta for x in tensors):
291
+ continue
292
+
293
+ if QPARAM_KEY not in node.meta:
294
+ continue
295
+
296
+ assert len(tensors) > 0
297
+ in_dtype = qparam_dtype(tensors[0])
298
+ if in_dtype == qparam_dtype(node):
299
+ continue
300
+
301
+ if any(qparam_dtype(x) != in_dtype for x in tensors):
302
+ continue
303
+
304
+ if in_dtype == "int16" and qparam_dtype(node) == "uint8":
305
+ quantize = _insert_quantize_op_after(node)
306
+
307
+ quantize.meta[QPARAM_KEY] = copy.deepcopy(node.meta[QPARAM_KEY])
308
+ node.meta[QPARAM_KEY] = _u8_to_i16(node.meta[QPARAM_KEY])
309
+ logger.debug(
310
+ f"quantize_per_tensor.default is inserted after {node.name}."
311
+ )
312
+ else:
313
+ raise NotYetSupportedError("Unsupported dtype")
314
+
285
315
  elif node.target == torch.ops.aten.bmm.default:
286
316
  bmm_args = BmmArgs(*node.args, **node.kwargs)
287
317
  x = bmm_args.input
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tico
3
- Version: 0.1.0.dev250703
3
+ Version: 0.1.0.dev250707
4
4
  Summary: Convert exported Torch module to circle
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -43,10 +43,7 @@ designed for optimized on-device neural network inference.
43
43
  0. Prerequisites
44
44
 
45
45
  - Python 3.10
46
- - [one-compiler nightly](https://github.com/Samsung/TICO/issues/2)
47
- - This project depends on [ONE](https://github.com/Samsung/ONE) Compiler, and it uses
48
- nightly features that are not yet available in the official release. Until one-compiler 1.30.0
49
- is released, you must use a prebuilt nighlty version of ONE Compiler.
46
+ - [one-compiler 1.30.0](https://github.com/Samsung/ONE/releases/tag/1.30.0)
50
47
 
51
48
  We highly recommend to use a virtual env, e.g., conda.
52
49
 
@@ -69,7 +66,7 @@ This will generate `build` and `dist` directories in the root directory.
69
66
  **Available options**
70
67
  - `--dist` To install the package from .whl (without this option, _TICO_ is installed in an editable mode)
71
68
  - `--torch_ver <torch version>` To install a specific torch version (default: 2.6).
72
- - Available <torch version>: 2.5, 2.6, nightly
69
+ - Available <torch version>: 2.5, 2.6, 2.7, nightly
73
70
 
74
71
  4. Now you can convert a torch module to a `.circle`.
75
72
 
@@ -290,17 +287,10 @@ By default, `./ccex test` runs all modules with the `circle-interpreter` engine.
290
287
  You can override this and run tests using the `onert` runtime instead.
291
288
 
292
289
 
293
- ##### 0. Installing ONERT Nightly
294
-
295
- Some ONERT features are only available in the nightly build until the next official release.
296
- To install the ONERT wheel from the issue comment:
297
-
298
- 1. Download the `.whl` file linked
299
- in [the relevant Github issue comment](https://github.com/Samsung/TICO/issues/2#issuecomment-2841487306).
300
- 2. Install it with pip, for example:
290
+ ##### 0. Install ONERT
301
291
 
302
292
  ```bash
303
- pip install /path/to/onert_nightly.whl
293
+ pip install onert
304
294
  ```
305
295
 
306
296
  ##### 1. Command-Line Flag
@@ -1,4 +1,4 @@
1
- tico/__init__.py,sha256=P6Y7D-gIsRLMIUA9w5OkdqONBxv5lRR70wvkWFHh1wY,1743
1
+ tico/__init__.py,sha256=G29NbaZNUeg1aAnblegJHoEefDV7Icu2V7UzEeaZf1A,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
@@ -51,7 +51,7 @@ tico/experimental/quantization/evaluation/executor/circle_executor.py,sha256=eCC
51
51
  tico/experimental/quantization/evaluation/executor/triv24_executor.py,sha256=sUoXl6oOO2arAKaNjOBg7HiQja145_Jv6qgY7XtR7A8,5159
52
52
  tico/experimental/quantization/passes/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
53
53
  tico/experimental/quantization/passes/fold_quant_ops.py,sha256=iaBMyO49CwVkhebMz3rjkHWfWE2LhwH6fORe7n4S6XQ,7040
54
- tico/experimental/quantization/passes/insert_quantize_on_dtype_mismatch.py,sha256=lQeN6VJNYQyDeucB4KpyyWvIiuhGRq7wjIeaCKdM7ck,15462
54
+ tico/experimental/quantization/passes/insert_quantize_on_dtype_mismatch.py,sha256=FfqTlGANcG1V64zw0MFcIxL9WafuxPINuzWohGdsYCg,16617
55
55
  tico/experimental/quantization/passes/propagate_qparam_backward.py,sha256=TGtyW0Z2qOTgVIasBdGRgbwH31YYd6ek7OvLTmCV614,3118
56
56
  tico/experimental/quantization/passes/propagate_qparam_forward.py,sha256=RhUHGCR2RpBO5KYkQ7Z8U5u7HEwDq2wdKHLKAJCi-5c,5138
57
57
  tico/experimental/quantization/passes/quantize_bias.py,sha256=ZQ3rETYStpW28JUbODRixbq5sDEOiIOB_qWA-Jzuu-Y,4337
@@ -200,9 +200,9 @@ tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
200
200
  tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
201
201
  tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
202
202
  tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
203
- tico-0.1.0.dev250703.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
204
- tico-0.1.0.dev250703.dist-info/METADATA,sha256=b1B8214FjIYVG6Z4kL5NDM0EN-jksdYbAtiViQ-hGtU,8846
205
- tico-0.1.0.dev250703.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
206
- tico-0.1.0.dev250703.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
207
- tico-0.1.0.dev250703.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
208
- tico-0.1.0.dev250703.dist-info/RECORD,,
203
+ tico-0.1.0.dev250707.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
204
+ tico-0.1.0.dev250707.dist-info/METADATA,sha256=DNpanGd-UTVh99jSdqMsSlyt6Z9CkqgkHi5uzLlKWSU,8244
205
+ tico-0.1.0.dev250707.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
206
+ tico-0.1.0.dev250707.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
207
+ tico-0.1.0.dev250707.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
208
+ tico-0.1.0.dev250707.dist-info/RECORD,,