tico 0.1.0.dev250722__py3-none-any.whl → 0.1.0.dev250723__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/experimental/quantization/algorithm/pt2e/annotation/annotator.py +1 -6
- tico/experimental/quantization/algorithm/pt2e/annotation/op/linear.py +1 -1
- tico/experimental/quantization/algorithm/pt2e/utils.py +0 -1
- tico/experimental/quantization/algorithm/smoothquant/smooth_quant.py +1 -1
- tico/experimental/quantization/evaluation/evaluate.py +1 -1
- tico/experimental/quantization/passes/fold_quant_ops.py +0 -1
- tico/experimental/quantization/passes/insert_quantize_on_dtype_mismatch.py +1 -1
- tico/experimental/quantization/passes/quantize_bias.py +0 -1
- tico/passes/cast_aten_where_arg_type.py +1 -1
- tico/passes/cast_mixed_type_args.py +1 -1
- tico/passes/const_prop_pass.py +1 -1
- tico/passes/convert_conv1d_to_conv2d.py +1 -1
- tico/passes/decompose_batch_norm.py +2 -2
- tico/passes/decompose_fake_quantize.py +0 -1
- tico/passes/decompose_fake_quantize_tensor_qparams.py +0 -2
- tico/passes/legalize_predefined_layout_operators.py +1 -1
- tico/passes/lower_to_slice.py +1 -1
- tico/passes/merge_consecutive_cat.py +1 -1
- tico/passes/remove_redundant_expand.py +0 -5
- tico/passes/remove_redundant_reshape.py +3 -3
- tico/passes/segment_index_select.py +1 -1
- tico/serialize/circle_serializer.py +234 -141
- tico/serialize/operators/op_any.py +0 -1
- tico/serialize/operators/op_clamp.py +2 -5
- tico/serialize/operators/op_full_like.py +0 -2
- tico/utils/convert.py +1 -1
- tico/utils/graph.py +1 -1
- tico/utils/padding.py +0 -2
- tico/utils/serialize.py +0 -3
- tico/utils/utils.py +0 -1
- tico/utils/validate_args_kwargs.py +1 -3
- {tico-0.1.0.dev250722.dist-info → tico-0.1.0.dev250723.dist-info}/METADATA +1 -1
- {tico-0.1.0.dev250722.dist-info → tico-0.1.0.dev250723.dist-info}/RECORD +38 -38
- {tico-0.1.0.dev250722.dist-info → tico-0.1.0.dev250723.dist-info}/LICENSE +0 -0
- {tico-0.1.0.dev250722.dist-info → tico-0.1.0.dev250723.dist-info}/WHEEL +0 -0
- {tico-0.1.0.dev250722.dist-info → tico-0.1.0.dev250723.dist-info}/entry_points.txt +0 -0
- {tico-0.1.0.dev250722.dist-info → tico-0.1.0.dev250723.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.dev250723"
|
25
25
|
|
26
26
|
MINIMUM_SUPPORTED_VERSION = "2.5.0"
|
27
27
|
SECURE_TORCH_VERSION = "2.6.0"
|
@@ -21,12 +21,7 @@ if TYPE_CHECKING:
|
|
21
21
|
import torch.fx
|
22
22
|
from torch.ao.quantization.qconfig import _ObserverOrFakeQuantizeConstructor
|
23
23
|
import torch
|
24
|
-
from torch.ao.quantization.observer import
|
25
|
-
MinMaxObserver,
|
26
|
-
MovingAverageMinMaxObserver,
|
27
|
-
MovingAveragePerChannelMinMaxObserver,
|
28
|
-
PerChannelMinMaxObserver,
|
29
|
-
)
|
24
|
+
from torch.ao.quantization.observer import MinMaxObserver, PerChannelMinMaxObserver
|
30
25
|
from torch.ao.quantization.quantizer import QuantizationSpec, Quantizer
|
31
26
|
from torch.ao.quantization.quantizer.utils import _get_module_name_filter
|
32
27
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
from typing import Callable,
|
15
|
+
from typing import Callable, Optional, TYPE_CHECKING
|
16
16
|
|
17
17
|
if TYPE_CHECKING:
|
18
18
|
import torch.fx
|
@@ -19,7 +19,6 @@ if TYPE_CHECKING:
|
|
19
19
|
import torch
|
20
20
|
from torch.ao.quantization.quantizer import QuantizationSpec
|
21
21
|
from torch.ao.quantization.quantizer.utils import _get_module_name_filter
|
22
|
-
from torch.utils import _pytree as pytree
|
23
22
|
|
24
23
|
from tico.experimental.quantization.algorithm.pt2e.annotation.config import (
|
25
24
|
QuantizationConfig,
|
@@ -166,7 +166,7 @@ def evaluate(
|
|
166
166
|
)
|
167
167
|
if not isinstance(backend, BACKEND):
|
168
168
|
raise RuntimeError(
|
169
|
-
|
169
|
+
"Invalid backend. Please use tico.quantization.evaluate.BACKEND enum class"
|
170
170
|
)
|
171
171
|
# Make it a list for simpler logic.
|
172
172
|
if input_data is not None:
|
@@ -176,7 +176,7 @@ class CastATenWhereArgType(PassBase):
|
|
176
176
|
node_dtype = extract_torch_dtype(node)
|
177
177
|
assert (
|
178
178
|
node_dtype == node_dtype_ori
|
179
|
-
),
|
179
|
+
), "Type casting doesn't change node's dtype."
|
180
180
|
|
181
181
|
logger.debug(
|
182
182
|
f"{to_cast.name}'s dtype was casted from {buf_data.dtype} to {dtype_to_cast}"
|
@@ -178,7 +178,7 @@ class CastMixedTypeArgs(PassBase):
|
|
178
178
|
node_dtype = extract_torch_dtype(node)
|
179
179
|
assert (
|
180
180
|
node_dtype == node_dtype_ori
|
181
|
-
),
|
181
|
+
), "Type casting doesn't change node's dtype."
|
182
182
|
|
183
183
|
graph.eliminate_dead_code()
|
184
184
|
graph.lint()
|
tico/passes/const_prop_pass.py
CHANGED
@@ -301,7 +301,7 @@ class ConstPropPass(PassBase):
|
|
301
301
|
graph.eliminate_dead_code()
|
302
302
|
graph_module.recompile()
|
303
303
|
|
304
|
-
logger.debug(
|
304
|
+
logger.debug("Constant nodes are propagated")
|
305
305
|
# Constant folding can be done with only one time run. Let's set `modified` to False.
|
306
306
|
modified = False
|
307
307
|
return PassResult(modified)
|
@@ -19,7 +19,7 @@ if TYPE_CHECKING:
|
|
19
19
|
import torch
|
20
20
|
from torch.export import ExportedProgram
|
21
21
|
|
22
|
-
from tico.serialize.
|
22
|
+
from tico.serialize.circle_mapping import extract_shape
|
23
23
|
from tico.utils import logging
|
24
24
|
from tico.utils.errors import NotYetSupportedError
|
25
25
|
from tico.utils.graph import create_node
|
@@ -96,9 +96,9 @@ class DecomposeBatchNorm(PassBase):
|
|
96
96
|
eps = args.eps
|
97
97
|
|
98
98
|
if not running_mean:
|
99
|
-
raise NotYetSupportedError(
|
99
|
+
raise NotYetSupportedError("running_mean=None is not supported yet")
|
100
100
|
if not running_var:
|
101
|
-
raise NotYetSupportedError(
|
101
|
+
raise NotYetSupportedError("running_var=None is not supported yet")
|
102
102
|
|
103
103
|
"""
|
104
104
|
Only support the cases generated from torch.nn.BatchNorm2d module,
|
@@ -26,10 +26,8 @@ from torch._export.utils import (
|
|
26
26
|
)
|
27
27
|
|
28
28
|
# To import torch.ops.quantized_decomposed related operator
|
29
|
-
from torch.ao.quantization.fx._decomposed import quantized_decomposed_lib
|
30
29
|
from torch.export import ExportedProgram
|
31
30
|
|
32
|
-
from tico.utils import logging
|
33
31
|
from tico.utils.graph import create_node
|
34
32
|
from tico.utils.passes import PassBase, PassResult
|
35
33
|
from tico.utils.trace_decorators import (
|
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
|
20
20
|
import torch
|
21
21
|
from torch.export import ExportedProgram
|
22
22
|
|
23
|
-
from tico.serialize.
|
23
|
+
from tico.serialize.circle_mapping import extract_shape
|
24
24
|
from tico.utils import logging
|
25
25
|
from tico.utils.errors import NotYetSupportedError
|
26
26
|
from tico.utils.graph import create_node
|
tico/passes/lower_to_slice.py
CHANGED
@@ -28,7 +28,7 @@ from torch._export.utils import (
|
|
28
28
|
from torch.export import ExportedProgram
|
29
29
|
|
30
30
|
from tico.passes import ops
|
31
|
-
from tico.serialize.
|
31
|
+
from tico.serialize.circle_mapping import extract_shape
|
32
32
|
from tico.utils import logging
|
33
33
|
from tico.utils.graph import create_node, is_single_value_tensor
|
34
34
|
from tico.utils.passes import PassBase, PassResult
|
@@ -51,7 +51,7 @@ class MergeConsecutiveCat(PassBase):
|
|
51
51
|
if not prev_cat.op == "call_function":
|
52
52
|
continue
|
53
53
|
|
54
|
-
if
|
54
|
+
if prev_cat.target not in ops.aten.cat:
|
55
55
|
continue
|
56
56
|
|
57
57
|
prev_args = CatArgs(*prev_cat.args, **prev_cat.kwargs) # type: ignore[arg-type]
|
@@ -12,11 +12,6 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
from typing import TYPE_CHECKING
|
16
|
-
|
17
|
-
if TYPE_CHECKING:
|
18
|
-
import torch.fx
|
19
|
-
import torch
|
20
15
|
from torch.export import ExportedProgram
|
21
16
|
|
22
17
|
from tico.passes import ops
|
@@ -262,7 +262,7 @@ class RemoveRedundantReshapePattern3(PassBase):
|
|
262
262
|
continue
|
263
263
|
|
264
264
|
# add
|
265
|
-
if
|
265
|
+
if add.target not in ops.aten.add:
|
266
266
|
continue
|
267
267
|
add_args = AddTensorArgs(*add.args, **add.kwargs) # type: ignore[arg-type]
|
268
268
|
reshape_2, reshape_3 = add_args.input, add_args.other
|
@@ -272,7 +272,7 @@ class RemoveRedundantReshapePattern3(PassBase):
|
|
272
272
|
# reshape_2
|
273
273
|
if not reshape_2.op == "call_function":
|
274
274
|
continue
|
275
|
-
if
|
275
|
+
if reshape_2.target not in ops.aten.reshape:
|
276
276
|
continue
|
277
277
|
reshape_2_args = ReshapeArgs(*reshape_2.args, **reshape_2.kwargs) # type: ignore[arg-type]
|
278
278
|
reshape_2_input = reshape_2_args.input
|
@@ -280,7 +280,7 @@ class RemoveRedundantReshapePattern3(PassBase):
|
|
280
280
|
# reshape_3
|
281
281
|
if not reshape_3.op == "call_function":
|
282
282
|
continue
|
283
|
-
if
|
283
|
+
if reshape_3.target not in ops.aten.reshape:
|
284
284
|
continue
|
285
285
|
reshape_3_args = ReshapeArgs(*reshape_3.args, **reshape_3.kwargs) # type: ignore[arg-type]
|
286
286
|
reshape_3_input = reshape_3_args.input
|
@@ -29,7 +29,7 @@ from torch._export.utils import (
|
|
29
29
|
from torch.export import ExportedProgram
|
30
30
|
|
31
31
|
from tico.passes import ops
|
32
|
-
from tico.serialize.
|
32
|
+
from tico.serialize.circle_mapping import extract_shape
|
33
33
|
from tico.utils import logging
|
34
34
|
from tico.utils.graph import add_placeholder, create_node, is_single_value_tensor
|
35
35
|
from tico.utils.passes import PassBase, PassResult
|
@@ -18,12 +18,7 @@ from typing import Dict
|
|
18
18
|
import flatbuffers
|
19
19
|
import torch
|
20
20
|
from circle_schema import circle
|
21
|
-
from torch.export.exported_program import
|
22
|
-
ConstantArgument,
|
23
|
-
ExportedProgram,
|
24
|
-
InputKind,
|
25
|
-
TensorArgument,
|
26
|
-
)
|
21
|
+
from torch.export.exported_program import ConstantArgument, ExportedProgram, InputKind
|
27
22
|
|
28
23
|
from tico.serialize.circle_mapping import to_circle_dtype
|
29
24
|
from tico.serialize.operators import *
|
@@ -39,147 +34,38 @@ multiple_output_ops = [
|
|
39
34
|
torch.ops.aten.max.dim,
|
40
35
|
]
|
41
36
|
|
42
|
-
# Build circle model from ExportedProgram
|
43
|
-
# Return raw bytes of circle model
|
44
|
-
def build_circle(edge_program: ExportedProgram) -> bytes:
|
45
|
-
logger = logging.getLogger(__name__)
|
46
37
|
|
47
|
-
|
38
|
+
def _initialize_model() -> tuple[CircleModel, CircleSubgraph]:
|
39
|
+
"""Initialize a new Circle model and subgraph.
|
48
40
|
|
49
|
-
|
41
|
+
Returns:
|
42
|
+
Tuple containing the model and subgraph
|
43
|
+
"""
|
50
44
|
model = CircleModel()
|
51
|
-
|
52
|
-
# Add empty buffer at the front (convention)
|
53
|
-
model.add_buffer(circle.Buffer.BufferT())
|
54
|
-
|
55
|
-
# Create an empty subgraph (assume a single subgraph)
|
45
|
+
model.add_buffer(circle.Buffer.BufferT()) # Add empty buffer at the front
|
56
46
|
graph = CircleSubgraph(model)
|
47
|
+
return model, graph
|
57
48
|
|
58
|
-
# Export tensors
|
59
|
-
logger.debug("---------------Export tensors--------------")
|
60
|
-
buf_name_to_data = {name: buf for name, buf in edge_program.named_buffers()}
|
61
|
-
for node in edge_program.graph.nodes:
|
62
|
-
if node.op == "call_function":
|
63
|
-
if node.target in multiple_output_ops:
|
64
|
-
continue
|
65
|
-
node_val = node.meta["val"]
|
66
|
-
if node_val.layout != torch.strided:
|
67
|
-
raise RuntimeError(
|
68
|
-
f"Only support dense tensors (node layout: {node_val.layout})"
|
69
|
-
)
|
70
|
-
graph.add_tensor_from_node(node)
|
71
|
-
logger.debug(f"call_function: {node.name} tensor exported.")
|
72
|
-
|
73
|
-
# placeholder: function input (including parameters, buffers, constant tensors)
|
74
|
-
elif node.op == "placeholder":
|
75
|
-
# placeholder invariants
|
76
|
-
assert node.args is None or len(node.args) == 0 # Not support default param
|
77
|
-
|
78
|
-
# parameters
|
79
|
-
if node.name in edge_program.graph_signature.inputs_to_parameters:
|
80
|
-
param_name = edge_program.graph_signature.inputs_to_parameters[
|
81
|
-
node.name
|
82
|
-
]
|
83
|
-
param_data = edge_program.state_dict[param_name]
|
84
|
-
|
85
|
-
assert isinstance(
|
86
|
-
param_data, torch.Tensor
|
87
|
-
), "Expect parameters to be a tensor"
|
88
|
-
param_value = param_data.cpu().detach().numpy()
|
89
|
-
|
90
|
-
graph.add_tensor_from_node(node, param_value)
|
91
|
-
logger.debug(f"placeholder(param): {node.name} tensor exported.")
|
92
|
-
elif node.name in edge_program.graph_signature.inputs_to_buffers:
|
93
|
-
buffer_name = edge_program.graph_signature.inputs_to_buffers[node.name]
|
94
|
-
assert buffer_name in buf_name_to_data
|
95
|
-
buffer_data = buf_name_to_data[buffer_name]
|
96
|
-
assert isinstance(
|
97
|
-
buffer_data, torch.Tensor
|
98
|
-
), "Expect buffers to be a tensor"
|
99
|
-
buffer_value = buffer_data.cpu().detach().numpy()
|
100
|
-
|
101
|
-
graph.add_tensor_from_node(node, buffer_value)
|
102
|
-
logger.debug(f"placeholder(buffer): {node.name} tensor exported.")
|
103
|
-
elif (
|
104
|
-
node.name
|
105
|
-
in edge_program.graph_signature.inputs_to_lifted_tensor_constants
|
106
|
-
):
|
107
|
-
ctensor_name = (
|
108
|
-
edge_program.graph_signature.inputs_to_lifted_tensor_constants[
|
109
|
-
node.name
|
110
|
-
]
|
111
|
-
)
|
112
|
-
ctensor_data = edge_program.constants[ctensor_name]
|
113
|
-
|
114
|
-
assert isinstance(
|
115
|
-
ctensor_data, torch.Tensor
|
116
|
-
), "Expect constant tensor to be a tensor"
|
117
|
-
ctensor_value = ctensor_data.cpu().detach().numpy()
|
118
|
-
|
119
|
-
graph.add_tensor_from_node(node, ctensor_value)
|
120
|
-
logger.debug(
|
121
|
-
f"placeholder(constant tensor): {node.name} tensor exported."
|
122
|
-
)
|
123
|
-
else:
|
124
|
-
user_inputs = [
|
125
|
-
specs
|
126
|
-
for specs in edge_program.graph_signature.input_specs
|
127
|
-
if specs.kind == InputKind.USER_INPUT
|
128
|
-
]
|
129
|
-
constant_inputs = [
|
130
|
-
specs
|
131
|
-
for specs in user_inputs
|
132
|
-
if isinstance(specs.arg, ConstantArgument)
|
133
|
-
]
|
134
|
-
name_to_value = {
|
135
|
-
specs.arg.name: specs.arg.value for specs in constant_inputs
|
136
|
-
}
|
137
|
-
# NoneType ConstantArgument is ignored.
|
138
|
-
if node.name in name_to_value and name_to_value[node.name] == None:
|
139
|
-
continue
|
140
|
-
graph.add_tensor_from_node(node)
|
141
|
-
logger.debug(f"placeholder: {node.name} tensor exported.")
|
142
|
-
|
143
|
-
# get_attr: retrieve parameter
|
144
|
-
elif node.op == "get_attr":
|
145
|
-
# node.name: Place where fetched attribute is saved
|
146
|
-
# node.target: Attribute in the module
|
147
|
-
attr_tensor = getattr(node.graph.owning_module, node.target)
|
148
|
-
assert isinstance(attr_tensor, torch.Tensor)
|
149
49
|
|
150
|
-
|
151
|
-
|
152
|
-
shape=list(attr_tensor.shape),
|
153
|
-
dtype=to_circle_dtype(attr_tensor.dtype),
|
154
|
-
source_node=node,
|
155
|
-
)
|
50
|
+
def build_circle(ep: ExportedProgram) -> bytes:
|
51
|
+
"""Convert ExportedProgram to Circle format.
|
156
52
|
|
157
|
-
|
53
|
+
Args:
|
54
|
+
ep: The exported PyTorch program to convert
|
158
55
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
assert graph.has_tensor(output.name)
|
166
|
-
continue
|
167
|
-
|
168
|
-
# call_method: call method
|
169
|
-
elif node.op == "call_method":
|
170
|
-
raise AssertionError("Not yet implemented")
|
171
|
-
|
172
|
-
# call_module: call 'forward' of module
|
173
|
-
elif node.op == "call_module":
|
174
|
-
raise AssertionError("Not yet implemented")
|
56
|
+
Returns:
|
57
|
+
bytes: Raw bytes of the Circle model
|
58
|
+
"""
|
59
|
+
logger = logging.getLogger(__name__)
|
60
|
+
builder = flatbuffers.Builder()
|
61
|
+
model, graph = _initialize_model()
|
175
62
|
|
176
|
-
|
177
|
-
|
178
|
-
raise AssertionError(f"Unknown fx.Node op {node.op}")
|
63
|
+
# Export tensors
|
64
|
+
_export_tensors(graph, ep)
|
179
65
|
|
180
66
|
# Register inputs
|
181
67
|
logger.debug("---------------Register inputs--------------")
|
182
|
-
for in_spec in
|
68
|
+
for in_spec in ep.graph_signature.input_specs:
|
183
69
|
if in_spec.kind != InputKind.USER_INPUT:
|
184
70
|
continue
|
185
71
|
# NoneType ConstantArgument is ignored.
|
@@ -191,9 +77,9 @@ def build_circle(edge_program: ExportedProgram) -> bytes:
|
|
191
77
|
|
192
78
|
# Register outputs
|
193
79
|
logger.debug("---------------Register outputs--------------")
|
194
|
-
for user_output in
|
80
|
+
for user_output in ep.graph_signature.user_outputs:
|
195
81
|
if user_output == None:
|
196
|
-
logger.debug(
|
82
|
+
logger.debug("Ignore 'None' output")
|
197
83
|
continue
|
198
84
|
|
199
85
|
graph.add_output(user_output)
|
@@ -203,7 +89,7 @@ def build_circle(edge_program: ExportedProgram) -> bytes:
|
|
203
89
|
logger.debug("---------------Export operators--------------")
|
204
90
|
op_codes: Dict[OpCode, int] = {}
|
205
91
|
visitors = get_node_visitors(op_codes, graph)
|
206
|
-
for node in
|
92
|
+
for node in ep.graph.nodes:
|
207
93
|
if node.op != "call_function":
|
208
94
|
continue
|
209
95
|
|
@@ -227,10 +113,8 @@ def build_circle(edge_program: ExportedProgram) -> bytes:
|
|
227
113
|
code for code, _ in sorted(op_codes.items(), key=lambda x: x[1])
|
228
114
|
]
|
229
115
|
|
230
|
-
#
|
116
|
+
# Final model settings
|
231
117
|
model.description = "circle"
|
232
|
-
|
233
|
-
# Set version
|
234
118
|
model.version = 0
|
235
119
|
|
236
120
|
# Finish model
|
@@ -238,3 +122,212 @@ def build_circle(edge_program: ExportedProgram) -> bytes:
|
|
238
122
|
buf = builder.Output()
|
239
123
|
|
240
124
|
return bytes(buf)
|
125
|
+
|
126
|
+
|
127
|
+
def _export_tensors(graph: CircleSubgraph, ep: ExportedProgram) -> None:
|
128
|
+
"""Export all tensors from the exported program to the circle graph.
|
129
|
+
|
130
|
+
Args:
|
131
|
+
graph: The CircleSubgraph to add tensors to
|
132
|
+
ep: The exported PyTorch program
|
133
|
+
"""
|
134
|
+
logger = logging.getLogger(__name__)
|
135
|
+
logger.debug("---------------Export tensors--------------")
|
136
|
+
buf_name_to_data = {name: buf for name, buf in ep.named_buffers()}
|
137
|
+
|
138
|
+
for node in ep.graph.nodes:
|
139
|
+
if node.op == "call_function":
|
140
|
+
if node.target in multiple_output_ops:
|
141
|
+
continue
|
142
|
+
node_val = node.meta["val"]
|
143
|
+
if node_val.layout != torch.strided:
|
144
|
+
raise RuntimeError(
|
145
|
+
f"Only support dense tensors (node layout: {node_val.layout})"
|
146
|
+
)
|
147
|
+
graph.add_tensor_from_node(node)
|
148
|
+
logger.debug(f"call_function: {node.name} tensor exported.")
|
149
|
+
|
150
|
+
elif node.op == "placeholder":
|
151
|
+
_handle_placeholder_node(graph, node, ep, buf_name_to_data)
|
152
|
+
|
153
|
+
elif node.op == "get_attr":
|
154
|
+
_handle_get_attr_node(graph, node)
|
155
|
+
|
156
|
+
elif node.op == "output":
|
157
|
+
for output in node.args[0]:
|
158
|
+
if isinstance(output, torch.fx.Node):
|
159
|
+
assert graph.has_tensor(output.name)
|
160
|
+
continue
|
161
|
+
|
162
|
+
elif node.op == "call_method":
|
163
|
+
raise AssertionError("Not yet implemented")
|
164
|
+
|
165
|
+
elif node.op == "call_module":
|
166
|
+
raise AssertionError("Not yet implemented")
|
167
|
+
|
168
|
+
else:
|
169
|
+
raise AssertionError(f"Unknown fx.Node op {node.op}")
|
170
|
+
|
171
|
+
|
172
|
+
def _handle_placeholder_node(
|
173
|
+
graph: CircleSubgraph,
|
174
|
+
node: torch.fx.Node,
|
175
|
+
ep: ExportedProgram,
|
176
|
+
buf_name_to_data: dict,
|
177
|
+
) -> None:
|
178
|
+
"""Handle a placeholder node during tensor export."""
|
179
|
+
# placeholder invariants
|
180
|
+
assert node.args is None or len(node.args) == 0 # Not support default param
|
181
|
+
|
182
|
+
if node.name in ep.graph_signature.inputs_to_parameters:
|
183
|
+
_handle_parameter_node(graph, node, ep)
|
184
|
+
elif node.name in ep.graph_signature.inputs_to_buffers:
|
185
|
+
_handle_buffer_node(graph, node, ep, buf_name_to_data)
|
186
|
+
elif node.name in ep.graph_signature.inputs_to_lifted_tensor_constants:
|
187
|
+
_handle_constant_tensor_node(graph, node, ep)
|
188
|
+
else:
|
189
|
+
_handle_user_input_node(graph, node, ep)
|
190
|
+
|
191
|
+
|
192
|
+
def _handle_parameter_node(
|
193
|
+
graph: CircleSubgraph,
|
194
|
+
node: torch.fx.Node,
|
195
|
+
ep: ExportedProgram,
|
196
|
+
) -> None:
|
197
|
+
"""Handle a parameter placeholder node by exporting its tensor data.
|
198
|
+
|
199
|
+
Args:
|
200
|
+
graph: CircleSubgraph to add tensor to
|
201
|
+
node: The parameter node to process
|
202
|
+
ep: ExportedProgram containing parameter data
|
203
|
+
"""
|
204
|
+
param_name = ep.graph_signature.inputs_to_parameters[node.name]
|
205
|
+
param_data = ep.state_dict[param_name]
|
206
|
+
|
207
|
+
if not isinstance(param_data, torch.Tensor):
|
208
|
+
raise ValueError(f"Parameter {param_name} is not a tensor")
|
209
|
+
|
210
|
+
tensor_value = param_data.cpu().detach().numpy()
|
211
|
+
graph.add_tensor_from_node(node, tensor_value)
|
212
|
+
|
213
|
+
logger = logging.getLogger(__name__)
|
214
|
+
logger.debug(f"Exported parameter tensor: {node.name}")
|
215
|
+
|
216
|
+
|
217
|
+
def _handle_buffer_node(
|
218
|
+
graph: CircleSubgraph,
|
219
|
+
node: torch.fx.Node,
|
220
|
+
ep: ExportedProgram,
|
221
|
+
buf_name_to_data: dict,
|
222
|
+
) -> None:
|
223
|
+
"""Handle a buffer placeholder node by exporting its tensor data.
|
224
|
+
|
225
|
+
Args:
|
226
|
+
graph: CircleSubgraph to add tensor to
|
227
|
+
node: The buffer node to process
|
228
|
+
ep: ExportedProgram containing buffer info
|
229
|
+
buf_name_to_data: Mapping of buffer names to data
|
230
|
+
"""
|
231
|
+
buffer_name = ep.graph_signature.inputs_to_buffers[node.name]
|
232
|
+
|
233
|
+
if buffer_name not in buf_name_to_data:
|
234
|
+
raise ValueError(f"Buffer {buffer_name} not found in buffer data")
|
235
|
+
|
236
|
+
buffer_data = buf_name_to_data[buffer_name]
|
237
|
+
|
238
|
+
if not isinstance(buffer_data, torch.Tensor):
|
239
|
+
raise ValueError(f"Buffer {buffer_name} is not a tensor")
|
240
|
+
|
241
|
+
tensor_value = buffer_data.cpu().detach().numpy()
|
242
|
+
graph.add_tensor_from_node(node, tensor_value)
|
243
|
+
|
244
|
+
logger = logging.getLogger(__name__)
|
245
|
+
logger.debug(f"Exported buffer tensor: {node.name}")
|
246
|
+
|
247
|
+
|
248
|
+
def _handle_constant_tensor_node(
|
249
|
+
graph: CircleSubgraph,
|
250
|
+
node: torch.fx.Node,
|
251
|
+
ep: ExportedProgram,
|
252
|
+
) -> None:
|
253
|
+
"""Handle a constant tensor placeholder node by exporting its tensor data.
|
254
|
+
|
255
|
+
Args:
|
256
|
+
graph: CircleSubgraph to add tensor to
|
257
|
+
node: The constant tensor node to process
|
258
|
+
ep: ExportedProgram containing constant data
|
259
|
+
"""
|
260
|
+
ctensor_name = ep.graph_signature.inputs_to_lifted_tensor_constants[node.name]
|
261
|
+
|
262
|
+
if ctensor_name not in ep.constants:
|
263
|
+
raise ValueError(f"Constant tensor {ctensor_name} not found")
|
264
|
+
|
265
|
+
ctensor_data = ep.constants[ctensor_name]
|
266
|
+
|
267
|
+
if not isinstance(ctensor_data, torch.Tensor):
|
268
|
+
raise ValueError(f"Constant tensor {ctensor_name} is not a tensor")
|
269
|
+
|
270
|
+
tensor_value = ctensor_data.cpu().detach().numpy()
|
271
|
+
graph.add_tensor_from_node(node, tensor_value)
|
272
|
+
|
273
|
+
logger = logging.getLogger(__name__)
|
274
|
+
logger.debug(f"Exported constant tensor: {node.name}")
|
275
|
+
|
276
|
+
|
277
|
+
def _handle_user_input_node(
|
278
|
+
graph: CircleSubgraph,
|
279
|
+
node: torch.fx.Node,
|
280
|
+
ep: ExportedProgram,
|
281
|
+
) -> None:
|
282
|
+
"""Handle a user input placeholder node by exporting its tensor data.
|
283
|
+
|
284
|
+
Args:
|
285
|
+
graph: CircleSubgraph to add tensor to
|
286
|
+
node: The user input node to process
|
287
|
+
ep: ExportedProgram containing input specs
|
288
|
+
"""
|
289
|
+
user_inputs = [
|
290
|
+
specs
|
291
|
+
for specs in ep.graph_signature.input_specs
|
292
|
+
if specs.kind == InputKind.USER_INPUT
|
293
|
+
]
|
294
|
+
constant_inputs = [
|
295
|
+
specs for specs in user_inputs if isinstance(specs.arg, ConstantArgument)
|
296
|
+
]
|
297
|
+
name_to_value = {specs.arg.name: specs.arg.value for specs in constant_inputs}
|
298
|
+
|
299
|
+
# Skip NoneType ConstantArgument
|
300
|
+
if node.name in name_to_value and name_to_value[node.name] is None:
|
301
|
+
return
|
302
|
+
|
303
|
+
graph.add_tensor_from_node(node)
|
304
|
+
|
305
|
+
logger = logging.getLogger(__name__)
|
306
|
+
logger.debug(f"Exported user input tensor: {node.name}")
|
307
|
+
|
308
|
+
|
309
|
+
def _handle_get_attr_node(
|
310
|
+
graph: CircleSubgraph,
|
311
|
+
node: torch.fx.Node,
|
312
|
+
) -> None:
|
313
|
+
"""Handle a get_attr node by exporting its tensor data.
|
314
|
+
|
315
|
+
Args:
|
316
|
+
graph: CircleSubgraph to add tensor to
|
317
|
+
node: The get_attr node to process
|
318
|
+
"""
|
319
|
+
assert isinstance(node.target, str)
|
320
|
+
attr_tensor = getattr(node.graph.owning_module, node.target)
|
321
|
+
|
322
|
+
if not isinstance(attr_tensor, torch.Tensor):
|
323
|
+
raise ValueError(f"Attribute {node.target} is not a tensor")
|
324
|
+
|
325
|
+
graph.add_tensor_from_scratch(
|
326
|
+
prefix=node.name,
|
327
|
+
shape=list(attr_tensor.shape),
|
328
|
+
dtype=to_circle_dtype(attr_tensor.dtype),
|
329
|
+
source_node=node,
|
330
|
+
)
|
331
|
+
|
332
|
+
logger = logging.getLogger(__name__)
|
333
|
+
logger.debug(f"Exported attribute tensor: {node.name}")
|
@@ -21,12 +21,9 @@ import torch
|
|
21
21
|
from circle_schema import circle
|
22
22
|
|
23
23
|
from tico.passes import ops
|
24
|
+
from tico.serialize.circle_graph import CircleSubgraph
|
24
25
|
|
25
|
-
from tico.serialize.
|
26
|
-
CircleSubgraph,
|
27
|
-
extract_circle_dtype,
|
28
|
-
extract_shape,
|
29
|
-
)
|
26
|
+
from tico.serialize.circle_mapping import extract_circle_dtype, extract_shape
|
30
27
|
from tico.serialize.operators.hashable_opcode import OpCode
|
31
28
|
from tico.serialize.operators.node_visitor import NodeVisitor, register_node_visitor
|
32
29
|
from tico.serialize.operators.utils import create_builtin_operator, get_op_index
|
@@ -21,10 +21,8 @@ import torch
|
|
21
21
|
from circle_schema import circle
|
22
22
|
|
23
23
|
from tico.serialize.circle_graph import CircleSubgraph
|
24
|
-
from tico.serialize.circle_mapping import to_circle_dtype
|
25
24
|
from tico.serialize.operators.hashable_opcode import OpCode
|
26
25
|
from tico.serialize.operators.node_visitor import NodeVisitor, register_node_visitor
|
27
|
-
from tico.serialize.operators.utils import create_builtin_operator, get_op_index
|
28
26
|
from tico.utils.validate_args_kwargs import FullLikeArgs
|
29
27
|
|
30
28
|
|
tico/utils/convert.py
CHANGED
@@ -157,7 +157,7 @@ def check_unsupported_target(exported_program: ExportedProgram):
|
|
157
157
|
for n in exported_program.graph.nodes:
|
158
158
|
if n.op != "call_function":
|
159
159
|
continue
|
160
|
-
if
|
160
|
+
if n.target not in supported_target:
|
161
161
|
unsupported.append(n)
|
162
162
|
|
163
163
|
if unsupported:
|
tico/utils/graph.py
CHANGED
@@ -24,7 +24,7 @@ import torch
|
|
24
24
|
from torch.export import ExportedProgram
|
25
25
|
from torch.export.exported_program import InputKind, InputSpec, TensorArgument
|
26
26
|
|
27
|
-
from tico.utils.utils import get_fake_mode
|
27
|
+
from tico.utils.utils import get_fake_mode
|
28
28
|
|
29
29
|
|
30
30
|
def is_torch_param(node: torch.fx.Node, ep: ExportedProgram):
|
tico/utils/padding.py
CHANGED
tico/utils/serialize.py
CHANGED
@@ -12,9 +12,6 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
from typing import Optional
|
16
|
-
|
17
|
-
import torch
|
18
15
|
|
19
16
|
from tico.serialize.circle_graph import CircleSubgraph
|
20
17
|
from tico.utils.graph import get_module_name_chain
|
tico/utils/utils.py
CHANGED
@@ -16,10 +16,8 @@ from dataclasses import dataclass, field
|
|
16
16
|
from typing import List, Optional, TYPE_CHECKING, Union
|
17
17
|
|
18
18
|
if TYPE_CHECKING:
|
19
|
-
import torch._ops
|
20
19
|
import torch.fx
|
21
20
|
import torch
|
22
|
-
import torch.fx.node
|
23
21
|
|
24
22
|
from tico.utils.utils import enforce_type
|
25
23
|
|
@@ -137,7 +135,7 @@ class AvgPool2dArgs:
|
|
137
135
|
assert len(self.padding) == 2, len(self.padding)
|
138
136
|
if self.divisor_override is not None:
|
139
137
|
assert isinstance(self.divisor_override, int), type(self.divisor_override)
|
140
|
-
assert self.divisor_override != 0,
|
138
|
+
assert self.divisor_override != 0, "Divisor must be not zero."
|
141
139
|
|
142
140
|
|
143
141
|
@enforce_type
|
@@ -1,4 +1,4 @@
|
|
1
|
-
tico/__init__.py,sha256=
|
1
|
+
tico/__init__.py,sha256=e1nx3N3UdH9Ok1YI1Q0qGVr_5_AqoG4ei8NnoEsxeuk,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
|
@@ -17,9 +17,9 @@ tico/experimental/quantization/algorithm/gptq/quantizer.py,sha256=icaFDXA1UibgRI
|
|
17
17
|
tico/experimental/quantization/algorithm/gptq/utils.py,sha256=vDIW5ow5c1VSFpub7QumMWorHrV86c0kOtlBxMw2Y2Y,1808
|
18
18
|
tico/experimental/quantization/algorithm/pt2e/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
19
19
|
tico/experimental/quantization/algorithm/pt2e/quantizer.py,sha256=mdTvsG87bo8fu0GaWqSM8iBCs-4f4EfUlVtk-Ko6M34,2546
|
20
|
-
tico/experimental/quantization/algorithm/pt2e/utils.py,sha256=
|
20
|
+
tico/experimental/quantization/algorithm/pt2e/utils.py,sha256=URjTGgsnDdhUC2Nr0-YJ9GWbVOKmjElfLr83Y8eCz-M,4806
|
21
21
|
tico/experimental/quantization/algorithm/pt2e/annotation/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
22
|
-
tico/experimental/quantization/algorithm/pt2e/annotation/annotator.py,sha256=
|
22
|
+
tico/experimental/quantization/algorithm/pt2e/annotation/annotator.py,sha256=lFfblxglPxcN2IcrjAVYq7GOECIAQ4rr7M4euPp3yWc,7551
|
23
23
|
tico/experimental/quantization/algorithm/pt2e/annotation/config.py,sha256=8x6YvixIogXh_PwqhKNb3L6lJyBDFQ_OHotonG_hWD0,977
|
24
24
|
tico/experimental/quantization/algorithm/pt2e/annotation/spec.py,sha256=6CXHmeTbl8pzpHmrj9-bqIHMhHVGqPy7sYxyt-kWkKA,1437
|
25
25
|
tico/experimental/quantization/algorithm/pt2e/annotation/utils.py,sha256=oBf4vjFzVQ3jfk1N-6S7A_3woO27QIc8zD4fM8OAZss,3161
|
@@ -28,7 +28,7 @@ tico/experimental/quantization/algorithm/pt2e/annotation/op/adaptive_avg_pool2d.
|
|
28
28
|
tico/experimental/quantization/algorithm/pt2e/annotation/op/add.py,sha256=cYsuGBiEmogkx5v_LtpzDKVf_YPHukpHPEjV4D1Hvbk,2214
|
29
29
|
tico/experimental/quantization/algorithm/pt2e/annotation/op/conv2d.py,sha256=jaQ72qzM82AN1JKgdYslatmQ2ZGzLwUrbyVIMC7HYwY,3692
|
30
30
|
tico/experimental/quantization/algorithm/pt2e/annotation/op/div.py,sha256=uPKorN80d3yFOmIDI6fK7uQ4eyqehgkoGnyCCZ_pfsg,2196
|
31
|
-
tico/experimental/quantization/algorithm/pt2e/annotation/op/linear.py,sha256=
|
31
|
+
tico/experimental/quantization/algorithm/pt2e/annotation/op/linear.py,sha256=u84jvgf2i-lia3gqdmHrbqXS_hTWDxU1gio91E0JjG8,3491
|
32
32
|
tico/experimental/quantization/algorithm/pt2e/annotation/op/mean.py,sha256=gXZ7LQWujO6iN5ZjsV3emBSJJCt1VuhUnlnr7rJmpbU,2020
|
33
33
|
tico/experimental/quantization/algorithm/pt2e/annotation/op/mul.py,sha256=MPfk2aPBqX6W4TuOI_ZElrU_hAc-9OtClOxkXvH6tsA,2211
|
34
34
|
tico/experimental/quantization/algorithm/pt2e/annotation/op/relu6.py,sha256=UDWVX7xMlIfuyHlGVAJMAxRCC2C6ldfYqRwluChhhew,2017
|
@@ -39,10 +39,10 @@ tico/experimental/quantization/algorithm/pt2e/transformation/convert_scalars_to_
|
|
39
39
|
tico/experimental/quantization/algorithm/smoothquant/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
40
40
|
tico/experimental/quantization/algorithm/smoothquant/observer.py,sha256=yi9nR_BEuxKVjgFcYPeldhXlEbE9V-0r4kRRPcI3C70,2639
|
41
41
|
tico/experimental/quantization/algorithm/smoothquant/quantizer.py,sha256=rQMtnqM1dBzjhY-KJRp3TWZSW-dzXrs5N5FagXzh0IQ,2564
|
42
|
-
tico/experimental/quantization/algorithm/smoothquant/smooth_quant.py,sha256=
|
42
|
+
tico/experimental/quantization/algorithm/smoothquant/smooth_quant.py,sha256=O1h7IojcsJaprFvRM9tsAuR3q7vTjKKRi88jD-nH79Y,6175
|
43
43
|
tico/experimental/quantization/evaluation/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
44
44
|
tico/experimental/quantization/evaluation/backend.py,sha256=CZL9rZOA0t8cH7PHp6u9l7dGqWNvTj9bKOvwo0PVul0,692
|
45
|
-
tico/experimental/quantization/evaluation/evaluate.py,sha256=
|
45
|
+
tico/experimental/quantization/evaluation/evaluate.py,sha256=cI9_4cbJKeYMmDt_PD85MHEseHGhwYRr3RHsKdix1FI,7988
|
46
46
|
tico/experimental/quantization/evaluation/metric.py,sha256=Ae-vAkA8n6T9_aGv47rkz1MLCw9ji1oDm1Rdd_MIxNQ,3744
|
47
47
|
tico/experimental/quantization/evaluation/utils.py,sha256=82RG_e5LuKfWo786wEZUVwXY93nNl901n04fB7D0Z6k,5909
|
48
48
|
tico/experimental/quantization/evaluation/executor/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
@@ -50,28 +50,28 @@ tico/experimental/quantization/evaluation/executor/backend_executor.py,sha256=3k
|
|
50
50
|
tico/experimental/quantization/evaluation/executor/circle_executor.py,sha256=eCCJ9wTwR0vUJ0oN7jxtQxZ9598GRw6P6KUxiuGsIIM,2685
|
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
|
-
tico/experimental/quantization/passes/fold_quant_ops.py,sha256=
|
54
|
-
tico/experimental/quantization/passes/insert_quantize_on_dtype_mismatch.py,sha256=
|
53
|
+
tico/experimental/quantization/passes/fold_quant_ops.py,sha256=bRHYSeHdSTaz3261skIkK5Aso2Lbv7ql0zFI9ICmbDY,7028
|
54
|
+
tico/experimental/quantization/passes/insert_quantize_on_dtype_mismatch.py,sha256=4xwOzUrnMH4MQfdOHBHHXQo1EyWSkqNNVfBg47J5UCg,14721
|
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
|
-
tico/experimental/quantization/passes/quantize_bias.py,sha256=
|
57
|
+
tico/experimental/quantization/passes/quantize_bias.py,sha256=T7YxJ70N0tSK0FF9VJZA5iP0sHdnnsX9GX4AT4JDFSk,4325
|
58
58
|
tico/experimental/quantization/passes/remove_weight_dequant_op.py,sha256=Klc_9-94tl0_AuAToKOjsWED_YPk5RB67eum0ddPX7o,6588
|
59
59
|
tico/interpreter/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
60
60
|
tico/interpreter/infer.py,sha256=1ZFe3DVMR2mlwBosoedqoL0-CGN_01CKLgMgxuw62KA,4861
|
61
61
|
tico/interpreter/interpreter.py,sha256=tGbluCbrehTCqBu8mtGDNzby_ieJ2ry8_RH_eC0CQxk,3828
|
62
62
|
tico/passes/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
63
|
-
tico/passes/cast_aten_where_arg_type.py,sha256=
|
63
|
+
tico/passes/cast_aten_where_arg_type.py,sha256=QOaet85z23ad3s9c8md5r11q9dEw4-lfJqlpM7aiBic,7228
|
64
64
|
tico/passes/cast_clamp_mixed_type_args.py,sha256=m3_HpXLywWmWERfE5lM5PgvjBod7C4BWu_Q-TkRyO8k,5387
|
65
|
-
tico/passes/cast_mixed_type_args.py,sha256=
|
66
|
-
tico/passes/const_prop_pass.py,sha256=
|
67
|
-
tico/passes/convert_conv1d_to_conv2d.py,sha256=
|
65
|
+
tico/passes/cast_mixed_type_args.py,sha256=gsDJfqxVE2dqQnLjSEsPWWs9FGXT-tIyMzjLhxfktKA,7617
|
66
|
+
tico/passes/const_prop_pass.py,sha256=hDxGgJNiRjsgOArdaoeAOcOOA-nKBvA1W1zcMZQA5yg,11531
|
67
|
+
tico/passes/convert_conv1d_to_conv2d.py,sha256=ktS3h158y9rg1sQiW8BZZbflV_dk_UdjBPQnuiOKyzg,5303
|
68
68
|
tico/passes/convert_layout_op_to_reshape.py,sha256=sCAFjkmVtiKjvDQSAgnjNBHl3_hWXJZElGDXQiTH-7s,2963
|
69
69
|
tico/passes/convert_repeat_to_expand_copy.py,sha256=JbtFTmWyfJS2SSd_higP1IEhQeh7wHdN5dmTbbiFVCs,3237
|
70
70
|
tico/passes/convert_to_relu6.py,sha256=1BJpUwUb6Zli_1y3eyJQo7dg9B1xvZ7sYjMbvEQsFJM,6442
|
71
71
|
tico/passes/decompose_addmm.py,sha256=0IUZjRS8G-h7LPeYu27gxWyTKi3pKAF1uNU1y-mHLL0,4056
|
72
|
-
tico/passes/decompose_batch_norm.py,sha256=
|
73
|
-
tico/passes/decompose_fake_quantize.py,sha256=
|
74
|
-
tico/passes/decompose_fake_quantize_tensor_qparams.py,sha256=
|
72
|
+
tico/passes/decompose_batch_norm.py,sha256=06LAxhSmpTxFZJmUelwB3I_GipNWrLoM7PfM6ZkxOZY,6512
|
73
|
+
tico/passes/decompose_fake_quantize.py,sha256=dvXZ5LyjrbpgvasmcBgjk2-xJyijefPRoNXBjFmAkRI,5294
|
74
|
+
tico/passes/decompose_fake_quantize_tensor_qparams.py,sha256=k9MJhMVABFNF6lXgEum1fJyGpdQwVRKxWOYhkMR2M7c,13915
|
75
75
|
tico/passes/decompose_group_norm.py,sha256=rtjv3PrcFTtZ68uCsmE2LibnWaQU-e8NdKkblL4LqxE,10197
|
76
76
|
tico/passes/decompose_grouped_conv2d.py,sha256=n2qv320akL1ju33ucZ6lU1cKEAaj0NI8YZ5CrUnkRLM,8512
|
77
77
|
tico/passes/decompose_slice_scatter.py,sha256=xqMHKhW2595YoAeubKZ4jRhYW4TQ09EXPgLNgODqXG8,5653
|
@@ -80,25 +80,25 @@ tico/passes/fill_meta_val.py,sha256=Xbam6Aq90ZfWItZw1dgLIwH_q8RCiU5JodKNqkj-ink,
|
|
80
80
|
tico/passes/fuse_leading_unsqueeze_reshape.py,sha256=88jwTP35yRyXOk9xdO6YW2OEfdKAws3KFRT16WQz0RI,4291
|
81
81
|
tico/passes/fuse_redundant_reshape_to_mean.py,sha256=GhJS1ZKB6Ns4AhwcW3uUQ6q-0N-AzlD32B2EwusUJHg,3761
|
82
82
|
tico/passes/legalize_causal_mask_value.py,sha256=0nfUKGd7XSe9Hg5TAi4dUi6Nn6-JRTWCwhULR5AEgqs,4079
|
83
|
-
tico/passes/legalize_predefined_layout_operators.py,sha256=
|
83
|
+
tico/passes/legalize_predefined_layout_operators.py,sha256=MdpI47_AI6PDqxWHGlJCsjbg_qxJhDzMhTl1fWn8I04,18936
|
84
84
|
tico/passes/lower_pow2_to_mul.py,sha256=nfJXa9ZTZMiLg6ownSyvkM4KF2z9tZW34Q3CCWI_vmQ,2402
|
85
85
|
tico/passes/lower_to_resize_nearest_neighbor.py,sha256=N6F56Of8Aiv-KIiYLHnh33WX72W60ZVQSBEYWHdYqNQ,9005
|
86
|
-
tico/passes/lower_to_slice.py,sha256=
|
87
|
-
tico/passes/merge_consecutive_cat.py,sha256=
|
86
|
+
tico/passes/lower_to_slice.py,sha256=OzlFzK3lBYyYwC3WThsWd94Ob4JINIJF8UaLAtnumzU,7262
|
87
|
+
tico/passes/merge_consecutive_cat.py,sha256=ayZNLDA1DFM7Fxxi2Dmk1CujkgUuaVCH1rhQgLrvvOQ,2701
|
88
88
|
tico/passes/ops.py,sha256=cSj3Sk2x2cOE9b8oU5pmSa_rHr-iX2lORzu3N_UHMSQ,2967
|
89
89
|
tico/passes/remove_nop.py,sha256=Hf91p_EJAOC6DyWNthash0_UWtEcNc_M7znamQfYQ5Y,2686
|
90
90
|
tico/passes/remove_redundant_assert_nodes.py,sha256=IONd3xBy6I8tH6_Y1eN3_eCHH7WTC8soBgjXzOju9cQ,1612
|
91
|
-
tico/passes/remove_redundant_expand.py,sha256=
|
91
|
+
tico/passes/remove_redundant_expand.py,sha256=auyqIoQT4HJhiJfuUe6BrEtUhvz221ohnIK5EuszWeg,2112
|
92
92
|
tico/passes/remove_redundant_permute.py,sha256=98UsaZzFZdQzEEAR1pIzRisAf6hgfXLa88aayjalt3E,4292
|
93
|
-
tico/passes/remove_redundant_reshape.py,sha256=
|
93
|
+
tico/passes/remove_redundant_reshape.py,sha256=OnhU7FKpudGEaF6ufsMvkzf9hn84FNmNKk37M7FN3Pc,16454
|
94
94
|
tico/passes/remove_redundant_slice.py,sha256=Iv7TbB39fktNb4eq0VdyZnwxL_VsKLJ90diMmaf3kZk,2087
|
95
95
|
tico/passes/remove_redundant_to_copy.py,sha256=tKy4XKkO2l33fMxVPQ_iFkUeFvP15kbPvzPPhT_g0c8,3292
|
96
96
|
tico/passes/restore_linear.py,sha256=xGJdNb-1CrkOKS9BnLbcblkZc6P2vVjKIi-7lRcs7Bk,4111
|
97
|
-
tico/passes/segment_index_select.py,sha256=
|
97
|
+
tico/passes/segment_index_select.py,sha256=VVCKNLtYRkr9n5lGnlzEuQsQ0WVxEYXGchFrDnB1C40,5189
|
98
98
|
tico/serialize/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
99
99
|
tico/serialize/circle_graph.py,sha256=3t78g5eKzhHKvIBJqQ-CcwbqoV-2QwAdd_8wm4W1yXw,12317
|
100
100
|
tico/serialize/circle_mapping.py,sha256=C9C3ORACQOdvBdnt5KRzlT8zao_TvzQklIxH794OhP0,5719
|
101
|
-
tico/serialize/circle_serializer.py,sha256=
|
101
|
+
tico/serialize/circle_serializer.py,sha256=eb90eTgU6WAZEWPclZIkInJsqAP1KjRSF2QeY5F3c3E,10766
|
102
102
|
tico/serialize/pack.py,sha256=5HZ9kX3x6C6CyT_FWS6FRmvx_P7Dx21orjUNQxJ2xlo,1297
|
103
103
|
tico/serialize/quant_param.py,sha256=s97GJyDOZULnqFUWPakHais31G_qqPuO0awPHCkZDvI,1342
|
104
104
|
tico/serialize/operators/__init__.py,sha256=LIvXsNnN4yUCS2CGNQ5XW8p8oXDTV_WHWuOEAw1t6WY,990
|
@@ -107,13 +107,13 @@ tico/serialize/operators/node_visitor.py,sha256=UYyCwXqSCeRyimThMShstHnt7vKM9tsu
|
|
107
107
|
tico/serialize/operators/op_abs.py,sha256=Y-vy7rcqPT-qD3QS5R8zbApWWTPpjY6xuMMVnbIhYmQ,1827
|
108
108
|
tico/serialize/operators/op_add.py,sha256=otm062DMHVAThWmOtSTZdPyP3P5-2cv5VL_UWBJeLms,2346
|
109
109
|
tico/serialize/operators/op_alias_copy.py,sha256=Xu9OiILbGf8oddh8yTqovvLfgVs8XYV7Cg4n6CesWcg,2175
|
110
|
-
tico/serialize/operators/op_any.py,sha256=
|
110
|
+
tico/serialize/operators/op_any.py,sha256=vZ37qzSEAOVPjfakSkgPDym91S9kOMUpLisAqkP-3Po,5211
|
111
111
|
tico/serialize/operators/op_arange_start_step.py,sha256=0T5lWwh3TfsFStmVv0v5qG03KENRDBmMix08RXQ4D-U,2132
|
112
112
|
tico/serialize/operators/op_argmax.py,sha256=ARyGHlmWVmzwCct93V5x1-VyKqhxMOvV8GuM8yQWXdo,2290
|
113
113
|
tico/serialize/operators/op_avg_pool2d.py,sha256=vc7WCakGXtGFPV1ix5EJmboH23tQ-cSI36ePY3PHKI4,7544
|
114
114
|
tico/serialize/operators/op_bmm.py,sha256=AELjHC9ISFPIzEEl5Kr1s4GSNLZElwZmVZJWkEyCEoA,2189
|
115
115
|
tico/serialize/operators/op_cat.py,sha256=XDYOh0XAyrM0TlxVm6Sa0OFFGrKk7aSDcGXC-hYX4gs,2204
|
116
|
-
tico/serialize/operators/op_clamp.py,sha256=
|
116
|
+
tico/serialize/operators/op_clamp.py,sha256=6iDFZZTMkEqJ8lpNcEhKUpAIc4h2oPkBCBWnnt4lTDw,4322
|
117
117
|
tico/serialize/operators/op_clone.py,sha256=vzDYJ8TS3tc2BAyd_z8nt5VqT1inpymSseMEhd9dva0,2394
|
118
118
|
tico/serialize/operators/op_constant_pad_nd.py,sha256=OpP4AP-d1IFcWZolNa-o9ZxzXJQkMdG9WQ66soX3s-E,2675
|
119
119
|
tico/serialize/operators/op_conv2d.py,sha256=UfYk5xnA9PqVYyjU9dUCSW0CiCmcEK3LnlnFh0WY4Gg,6599
|
@@ -129,7 +129,7 @@ tico/serialize/operators/op_eq.py,sha256=g17_K6IkWvnop_LaiUJzcGPUSFElz6UUrf7T0bo
|
|
129
129
|
tico/serialize/operators/op_exp.py,sha256=WWCXRqpo8E5uIq2J8saJO5e_Sny5NhVThUFxgTZQmEs,2047
|
130
130
|
tico/serialize/operators/op_expand.py,sha256=Wc-FK-Je2nDW1x3g9kjSES3jxAhM5m7W2Irw1pt3BgE,3547
|
131
131
|
tico/serialize/operators/op_full.py,sha256=1Hv-H829F4gj5ZklrEb2wwKB9wSHBkc6aFS08jYFxuw,1679
|
132
|
-
tico/serialize/operators/op_full_like.py,sha256=
|
132
|
+
tico/serialize/operators/op_full_like.py,sha256=T4DomZTy4vyzYysGw7A0UrWbkV8EJ53whbtuUUuHy_I,1871
|
133
133
|
tico/serialize/operators/op_ge.py,sha256=TrgZ6wbIEYkDGfVFNtDlfM7ZkMMWjvcks5U5DankSbo,1892
|
134
134
|
tico/serialize/operators/op_gelu.py,sha256=bS8-0rg5_bT__OI3mBDywxGx4xTO2Iqea3h-uC17MpU,2145
|
135
135
|
tico/serialize/operators/op_gt.py,sha256=JAVbtuAUNLYhtJycJJCEkYo9QAvmiK4lTMdw5yHUd10,1886
|
@@ -183,31 +183,31 @@ tico/serialize/operators/op_view.py,sha256=5EMww-ve17Vm9XPuV03Tn7vJsjpU2J8U4d_FO
|
|
183
183
|
tico/serialize/operators/op_where.py,sha256=doE81GSwygrPBm3JIfN9w7kKXxeIYKxgk0eoY22QIcg,2845
|
184
184
|
tico/serialize/operators/utils.py,sha256=lXGpEJW1h8U_-gfc6EWjvvSiq3yJ9P-v1v3EMRT_pSk,2954
|
185
185
|
tico/utils/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
186
|
-
tico/utils/convert.py,sha256=
|
186
|
+
tico/utils/convert.py,sha256=GgZwZtiqFzTdszfUQO0vcX39lKjs97gYwZ-Tiw_4Bbo,13222
|
187
187
|
tico/utils/define.py,sha256=Ypgp7YffM4pgPl4Zh6TmogSn1OxGBMRw_e09qYGflZk,1467
|
188
188
|
tico/utils/diff_graph.py,sha256=_eDGGPDPYQD4b--MXX0DLoVgSt_wLfNPt47UlolLLR4,5272
|
189
189
|
tico/utils/dtype.py,sha256=4-k1iUaHivFFXAQuDs7up6fXt5y4FqldGNokAPa3kic,603
|
190
190
|
tico/utils/errors.py,sha256=f3csJjgbXG9W1aHhqEcou008Aor19W57X8oT5Hx8w1M,954
|
191
|
-
tico/utils/graph.py,sha256=
|
191
|
+
tico/utils/graph.py,sha256=jD6m58m5JmN9mPfaROA9CW3406iJxmnukke00AuwRqI,9131
|
192
192
|
tico/utils/installed_packages.py,sha256=J0FTwnkCGs0MxRWoCMYAqiwH7Z0GWFDLV--x-IndSp4,1017
|
193
193
|
tico/utils/logging.py,sha256=IlbBWscsaHidI0dNqro1HEXAbIcbkR3BD5ukLy2m95k,1286
|
194
194
|
tico/utils/model.py,sha256=pPOIjD0qjQirLibiRxxfjOR6efimOcDAd9R-74eus-k,1282
|
195
|
-
tico/utils/padding.py,sha256=
|
195
|
+
tico/utils/padding.py,sha256=0iEcS5G3gSFySPzBz1m5nxHYZ6MlLzG_KdAFJRauwIg,3279
|
196
196
|
tico/utils/passes.py,sha256=kGmDe__5cPaO6i5EDAoXSVe6yXEoX9hAny4ROb3ZEmQ,2409
|
197
197
|
tico/utils/pytree_utils.py,sha256=jrk3N6X6LiUnBCX_gM1K9nywbVAJBVnszlTAgeIeDUc,5219
|
198
198
|
tico/utils/register_custom_op.py,sha256=3-Yl6iYmx1qQA2igNHt4hYhQhQMkdPb7gF50LIY8yvc,27350
|
199
|
-
tico/utils/serialize.py,sha256=
|
199
|
+
tico/utils/serialize.py,sha256=cBtEUfi_SU_9_v0cq2CNikzn8GnzEz2RwRvUH2NkWu4,1378
|
200
200
|
tico/utils/torch_compat.py,sha256=oc6PztVsXdHcQ3iaVR90wLLxrGaj6zFHWZ8K9rRS6q8,1795
|
201
201
|
tico/utils/trace_decorators.py,sha256=ddLIiKQfSaQrxgF1kNpwjFTQnXENzeSfcr1kuAW4jGI,3221
|
202
|
-
tico/utils/utils.py,sha256=
|
203
|
-
tico/utils/validate_args_kwargs.py,sha256=
|
202
|
+
tico/utils/utils.py,sha256=Ln6FgrnWuwvKEL1ntzZXgH1tClcaOfQHt117dQ_mSb8,12976
|
203
|
+
tico/utils/validate_args_kwargs.py,sha256=CRj_SXMUUn6onsl8XLAt-zPZCFxR4C0XOCoaad_ZD4I,26689
|
204
204
|
tico/utils/mx/__init__.py,sha256=IO6FP_xYbGy0dW0HL26GXD3ouxARaxCK7bz9dn4blPQ,26
|
205
205
|
tico/utils/mx/elemwise_ops.py,sha256=V6glyAHsVR1joqpsgnNytatCD_ew92xNWZ19UFDoMTA,10281
|
206
206
|
tico/utils/mx/formats.py,sha256=uzNWyu-1onUlwQfX5cZ6fZSUfHMRqorper7_T1k3jfk,3404
|
207
207
|
tico/utils/mx/mx_ops.py,sha256=RcfUTYVi-wilGB2sC35OeARdwDqnixv7dG5iyZ-fQT8,8555
|
208
|
-
tico-0.1.0.
|
209
|
-
tico-0.1.0.
|
210
|
-
tico-0.1.0.
|
211
|
-
tico-0.1.0.
|
212
|
-
tico-0.1.0.
|
213
|
-
tico-0.1.0.
|
208
|
+
tico-0.1.0.dev250723.dist-info/LICENSE,sha256=kp4JLII7bzRhPb0CPD5XTDZMh22BQ7h3k3B7t8TiSbw,12644
|
209
|
+
tico-0.1.0.dev250723.dist-info/METADATA,sha256=MGuH7gedgNwadikvqXLQL_zTHDmzk20cwDohwgRkreg,8430
|
210
|
+
tico-0.1.0.dev250723.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
211
|
+
tico-0.1.0.dev250723.dist-info/entry_points.txt,sha256=kBKYSS_IYrSXmUYevmmepqIVPScq5vF8ulQRu3I_Zf0,59
|
212
|
+
tico-0.1.0.dev250723.dist-info/top_level.txt,sha256=oqs7UPoNSKZEwqsX8B-KAWdQwfAa7i60pbxW_Jk7P3w,5
|
213
|
+
tico-0.1.0.dev250723.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|