Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Model Speedup Refactor #3462

Merged
merged 65 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
660fed2
Not Ready for review
Mar 20, 2021
c92e60e
rm the original infer_shape
Mar 20, 2021
785d135
Add infer_mask.py
Mar 20, 2021
d271964
update
Mar 21, 2021
ad44f57
update
Mar 25, 2021
62cc377
update
Mar 25, 2021
5cd85ab
update
Mar 26, 2021
3fcdd03
update
May 13, 2021
464405e
convtranspose
May 17, 2021
608052c
fix pylint
May 17, 2021
30ffde5
pylint
May 17, 2021
7380c36
update
May 18, 2021
5a9ccd7
update
May 18, 2021
fca5e88
merge master
May 18, 2021
95e6c13
update doc
May 18, 2021
de19c0e
update
May 19, 2021
533bc2f
update
May 19, 2021
66ca5d5
comment out some big model for pipeline test
May 19, 2021
002e68e
use smaller model for pipeline test
May 19, 2021
8fdd500
use lower confidence
May 19, 2021
8ec50ee
confidence=2
May 19, 2021
0743530
only mobilenet_v2
May 20, 2021
3158812
pipeline memory consumption test
May 20, 2021
9cf9b20
add support for reshape
May 20, 2021
c1ac7a0
update compression util unit test
May 20, 2021
ff281ce
split the speedup_integration test into two parts: small models and l…
May 20, 2021
8725ca2
remove useless comments
May 20, 2021
2ecf8f0
remove useless comments
May 20, 2021
8cc81b7
update
May 20, 2021
47eed20
remove useless code
May 20, 2021
51d21f8
update
May 20, 2021
d6e1310
remove the padding-to-resolve-conflict out of this pr
May 21, 2021
dd2af48
remove the padding mechanism
May 21, 2021
c5bd304
update
May 21, 2021
b5c8c38
add support for tupleunpack op
May 24, 2021
e2490f7
add test case for fine-grained pruning
May 25, 2021
5f00b91
merge the master branch
May 26, 2021
71743cf
support nanodet
Jun 10, 2021
f688987
remove useless comments
Jun 15, 2021
59969aa
update doc string
Jun 15, 2021
6903270
remove the useless comments
Jun 15, 2021
c17aca2
try tp support yolo
Jun 21, 2021
b7ebaf2
support yolov3
Jun 21, 2021
dba6be7
support yolov3
Jun 22, 2021
6a2db17
update
Jun 22, 2021
cbc27ec
remove debug trace point
Jun 22, 2021
7af2bef
support yolov3
Jun 25, 2021
3b6d7a8
fix pylint
Jun 25, 2021
00c0708
fix a bug in upsample bilinear
Jun 26, 2021
abdbc77
add detail description for replace function
Jun 28, 2021
94b6a6c
reformat the interface
Jun 28, 2021
4dfb5f5
fix pylint
Jun 29, 2021
8bb3608
fix docstring format
Jun 30, 2021
94c3fb9
remove the duplicated outputs when construct the grapth
Jun 30, 2021
f520101
remove useless comments
Jun 30, 2021
1c3c7de
update
Jul 5, 2021
22f9020
fix pylint
Jul 5, 2021
d7d4640
support squeeze
Jul 6, 2021
5279eab
update
Jul 6, 2021
c87b3bf
update
Jul 12, 2021
6be9e92
merge master branch
Jul 12, 2021
325a929
resolve comments
Jul 13, 2021
79cb16a
resolve comments
Jul 13, 2021
60d4894
resolve comments
Jul 13, 2021
c3a60fb
revert the modification on the chinese docs
Jul 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/en_US/Compression/CompressionReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ Topology Utilities
.. autoclass:: nni.compression.pytorch.utils.shape_dependency.GroupDependency
:members:

.. autoclass:: nni.compression.pytorch.utils.mask_conflict.CatMaskPadding
:members:

.. autoclass:: nni.compression.pytorch.utils.mask_conflict.GroupMaskConflict
:members:

Expand Down
3 changes: 0 additions & 3 deletions docs/zh_CN/Compression/CompressionReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ Quantizers
.. autoclass:: nni.compression.pytorch.utils.shape_dependency.GroupDependency
:members:

.. autoclass:: nni.compression.pytorch.utils.mask_conflict.CatMaskPadding
:members:

.. autoclass:: nni.compression.pytorch.utils.mask_conflict.GroupMaskConflict
:members:

Expand Down
9 changes: 9 additions & 0 deletions nni/common/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ class TorchModuleGraph(TorchGraph):
def __init__(self, model=None, dummy_input=None, traced_model=None):
super().__init__(model, dummy_input, traced_model)
self.global_count = 0
self.reused_module = set()
self.name_to_node, self.input_to_node, self.output_to_node = self._build_graph()
self._extract_auxiliary_info()

Expand Down Expand Up @@ -388,8 +389,14 @@ def _expand_module_node(self, node, node_name, unique_name, op_type, nodes,
visited.add(successor_node)
else:
outputs.append(output_name)
# if(len(outputs)>1):
# import pdb; pdb.set_trace()
break
else:
outputs.append(output_name)
# if(len(outputs)>1):
# import pdb; pdb.set_trace()
# print(_output)

nodepy = NodePyGroup(node_name, unique_name, module_type, op_type,
node_group, inputs=list(inputs), outputs=list(outputs))
Expand Down Expand Up @@ -724,6 +731,8 @@ def _build_graph(self):
unique_name = module_name
if use_count > 0:
unique_name = module_name + '.%d' % use_count
self.reused_module.add(unique_name)
self.reused_module.add(module_name)
node_group = self._expand_module_node(
node, module_name, unique_name, module_to_type[module_name],
node_cpps, input_to_node, output_to_node, 'module')
Expand Down
Loading