mct-nightly 2.2.0.20240912.453__py3-none-any.whl → 2.2.0.20240914.446__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.
- {mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/METADATA +1 -1
- {mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/RECORD +7 -7
- model_compression_toolkit/__init__.py +1 -1
- model_compression_toolkit/core/pytorch/reader/graph_builders.py +19 -14
- {mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/LICENSE.md +0 -0
- {mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/WHEEL +0 -0
- {mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/top_level.txt +0 -0
{mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/RECORD
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
model_compression_toolkit/__init__.py,sha256=
|
1
|
+
model_compression_toolkit/__init__.py,sha256=__eCTt82foAJINoW9y8vsFIArodkmGR-DSkiZcW8xZ4,1573
|
2
2
|
model_compression_toolkit/constants.py,sha256=i4wYheBkIdQmsQA-axIpcT3YiSO1USNc-jaNiNE8w6E,3920
|
3
3
|
model_compression_toolkit/defaultdict.py,sha256=LSc-sbZYXENMCw3U9F4GiXuv67IKpdn0Qm7Fr11jy-4,2277
|
4
4
|
model_compression_toolkit/logger.py,sha256=3DByV41XHRR3kLTJNbpaMmikL8icd9e1N-nkQAY9oDk,4567
|
@@ -267,7 +267,7 @@ model_compression_toolkit/core/pytorch/quantizer/__init__.py,sha256=Rf1RcYmelmdZ
|
|
267
267
|
model_compression_toolkit/core/pytorch/quantizer/fake_quant_builder.py,sha256=D8_CEuFqKAhbUgKaRw7Jlxo0zlqgPTMu6CIIIM4LfS0,7045
|
268
268
|
model_compression_toolkit/core/pytorch/quantizer/lut_fake_quant.py,sha256=uyeBtNokyDUikk-YkDP_mN_2DX0J5oPm3kSfdSUT2Ck,4420
|
269
269
|
model_compression_toolkit/core/pytorch/reader/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKWF575ofc06JFQSq83Jz99A,696
|
270
|
-
model_compression_toolkit/core/pytorch/reader/graph_builders.py,sha256
|
270
|
+
model_compression_toolkit/core/pytorch/reader/graph_builders.py,sha256=-EGSQOdww-O9x0jT_0ggqz2RcrRuDDaWTKnsWgQyxDI,16114
|
271
271
|
model_compression_toolkit/core/pytorch/reader/node_holders.py,sha256=7XNc7-l1MZPJGcOESvtAwfIMxrU6kvt3YjF5B7qOqK4,1048
|
272
272
|
model_compression_toolkit/core/pytorch/reader/reader.py,sha256=GEJE0QX8XJFWbYCkbRBtzttZtmmuoACLx8gw9KyAQCE,6015
|
273
273
|
model_compression_toolkit/core/pytorch/statistics_correction/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKWF575ofc06JFQSq83Jz99A,696
|
@@ -536,8 +536,8 @@ model_compression_toolkit/xquant/pytorch/model_analyzer.py,sha256=b93o800yVB3Z-i
|
|
536
536
|
model_compression_toolkit/xquant/pytorch/pytorch_report_utils.py,sha256=bOc-hFL3gdoSM1Th_S2N_-9JJSlPGpZCTx_QLJHS6lg,3388
|
537
537
|
model_compression_toolkit/xquant/pytorch/similarity_functions.py,sha256=CERxq5K8rqaiE-DlwhZBTUd9x69dtYJlkHOPLB54vm8,2354
|
538
538
|
model_compression_toolkit/xquant/pytorch/tensorboard_utils.py,sha256=mkoEktLFFHtEKzzFRn_jCnxjhJolK12TZ5AQeDHzUO8,9767
|
539
|
-
mct_nightly-2.2.0.
|
540
|
-
mct_nightly-2.2.0.
|
541
|
-
mct_nightly-2.2.0.
|
542
|
-
mct_nightly-2.2.0.
|
543
|
-
mct_nightly-2.2.0.
|
539
|
+
mct_nightly-2.2.0.20240914.446.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
|
540
|
+
mct_nightly-2.2.0.20240914.446.dist-info/METADATA,sha256=chH3Tl7acE9bZhKTreJBOT-7NKvL5UgB72DHLQ0IG_Q,20813
|
541
|
+
mct_nightly-2.2.0.20240914.446.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
542
|
+
mct_nightly-2.2.0.20240914.446.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
|
543
|
+
mct_nightly-2.2.0.20240914.446.dist-info/RECORD,,
|
@@ -27,4 +27,4 @@ from model_compression_toolkit import data_generation
|
|
27
27
|
from model_compression_toolkit import pruning
|
28
28
|
from model_compression_toolkit.trainable_infrastructure.keras.load_model import keras_load_quantized_model
|
29
29
|
|
30
|
-
__version__ = "2.2.0.
|
30
|
+
__version__ = "2.2.0.20240914.000446"
|
@@ -80,16 +80,19 @@ def _build_input_alloc_and_call_args(n: Node, input_tensors_in_node_kwargs: Dict
|
|
80
80
|
tensor_input_alloc = []
|
81
81
|
op_call_args = list(n.args)
|
82
82
|
if inputs_as_list:
|
83
|
-
op_call_args
|
83
|
+
# input tensors are a list in the first argument -> remove from op_call_args and go over
|
84
|
+
# the tensors in that list.
|
85
|
+
_args = op_call_args.pop(0)
|
84
86
|
else:
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
87
|
+
_args = n.args
|
88
|
+
for in_node in n.all_input_nodes:
|
89
|
+
# The extra for loop is used to tackle the case of the same input tensor for this node (e.g. torch.add(x, x)).
|
90
|
+
for i, arg in enumerate(_args):
|
91
|
+
if arg == in_node:
|
92
|
+
tensor_input_alloc.append(i)
|
93
|
+
for k, arg in input_tensors_in_node_kwargs.items():
|
94
|
+
if arg == in_node:
|
95
|
+
tensor_input_alloc.append(k)
|
93
96
|
|
94
97
|
return op_call_args, tensor_input_alloc
|
95
98
|
|
@@ -253,11 +256,8 @@ def nodes_builder(model: GraphModule,
|
|
253
256
|
node_kwargs[k] = v
|
254
257
|
|
255
258
|
# Check if node's first input argument is a list of input fx nodes, such as torch.cat:
|
256
|
-
|
259
|
+
inputs_as_list = is_instance_first_arg(node, (list, tuple)) and all(
|
257
260
|
[isinstance(n, Node) for n in node.args[0]])
|
258
|
-
is_placeholder_a_list = is_instance_first_arg(node, Node) and \
|
259
|
-
node.args[0].op == PLACEHOLDER and node.args[0].meta[TYPE] in (list, tuple)
|
260
|
-
inputs_as_list = is_first_input_list_of_nodes or is_placeholder_a_list
|
261
261
|
|
262
262
|
# Build tensor_input_alloc required for the model builder. All input nodes are received as a list in the builder,
|
263
263
|
# so tensor_input_alloc is used to allocate each input tensor in the correct place in the node's args & kwargs.
|
@@ -333,7 +333,12 @@ def edges_builder(model: GraphModule,
|
|
333
333
|
if input_node in fx_node_2_graph_node:
|
334
334
|
# n_edges_for_input_node is for the case that the input node appears more than
|
335
335
|
# once as the input of the node, for example add(x, x)
|
336
|
-
|
336
|
+
if node in fx_node_2_graph_node and isinstance(fx_node_2_graph_node[node], FunctionalNode) and \
|
337
|
+
fx_node_2_graph_node[node].inputs_as_list:
|
338
|
+
_args = node.args[0]
|
339
|
+
else:
|
340
|
+
_args = node.args
|
341
|
+
n_edges_for_input_node = sum([1 for a in _args if input_node == a])
|
337
342
|
n_edges_for_input_node = max(n_edges_for_input_node, 1)
|
338
343
|
|
339
344
|
dst_index = node.all_input_nodes.index(input_node)
|
{mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/LICENSE.md
RENAMED
File without changes
|
File without changes
|
{mct_nightly-2.2.0.20240912.453.dist-info → mct_nightly-2.2.0.20240914.446.dist-info}/top_level.txt
RENAMED
File without changes
|