Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
314e06f
[Runtime] Pipeline Executor Initial patch.
huajsj Aug 10, 2021
a1e03d3
add pipeline config
huajsj Aug 20, 2021
6c1485a
add config connect logic.
huajsj Aug 25, 2021
d9ba4ca
fix build issue.
huajsj Aug 26, 2021
157e9c0
set output index start from 0
huajsj Aug 27, 2021
6783d90
address review comments
huajsj Aug 28, 2021
a1bbb85
address review comments.
huajsj Aug 29, 2021
872f075
address review comments.
huajsj Aug 29, 2021
67242e3
Update python/tvm/contrib/pipeline_executor.py
huajsj Aug 31, 2021
607b758
address review comments.
huajsj Aug 31, 2021
8d476ae
address review comments
huajsj Aug 31, 2021
e39b747
add topology sort
huajsj Sep 1, 2021
31ee5a6
add binding check logic.
huajsj Sep 2, 2021
5c50ba4
fix plint error.
huajsj Sep 2, 2021
21a3064
Update python/tvm/contrib/pipeline_executor.py
huajsj Sep 3, 2021
0498561
address review comments.
huajsj Sep 3, 2021
8146513
fix plint issue.
huajsj Sep 3, 2021
a5c5215
address review comments.
huajsj Sep 3, 2021
f75ea73
trigger build.
huajsj Sep 7, 2021
abdded1
Update python/tvm/contrib/pipeline_executor.py
huajsj Sep 8, 2021
f12b4ef
address review comments.
huajsj Sep 8, 2021
ce25b28
polish doc and comments.
huajsj Sep 9, 2021
2ae18f1
polish doc and address review comments.
huajsj Sep 9, 2021
8fa82c1
address review comments.
huajsj Sep 9, 2021
31e0819
doc change.
huajsj Sep 9, 2021
1b167fd
doc change.
huajsj Sep 10, 2021
4d869f5
Trigger build.
huajsj Sep 10, 2021
3cf01e9
trigge build.
huajsj Sep 11, 2021
73b6c98
address review comments.
huajsj Sep 12, 2021
beac198
address review comments.
huajsj Sep 14, 2021
8a088bf
address review comments.
huajsj Sep 14, 2021
a887705
polish documents.
huajsj Sep 14, 2021
efd91e1
Polish the document.
huajsj Sep 14, 2021
db8422d
address review comments.
huajsj Sep 15, 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
Prev Previous commit
Next Next commit
doc change.
  • Loading branch information
huajsj committed Sep 10, 2021
commit 31e0819c594a46258623742294d7a3795773d4ee
18 changes: 9 additions & 9 deletions python/tvm/contrib/pipeline_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def get_name(self):
return owner_name, self.name

def get_owner_idx(self):
"""Return owner idex if owner is ModuleWrapper, if not return 0"""
"""Return owner idex if owner is ModuleWrapper, if not return 0."""
if isinstance(self.io_owner, PipelineConfig.ModuleWrapper):
return self.io_owner.idx

Expand All @@ -207,7 +207,7 @@ def is_global_interface(self):
return not isinstance(self.io_owner, PipelineConfig.ModuleWrapper)

def __repr__(self):
"""Get all binding(input data) informations that looks like '|data_0: mod1:data_0'"""
"""Get all binding(input data) informations that looks like '|data_0: mod1:data_0'."""
Comment thread
huajsj marked this conversation as resolved.
Outdated
ret = " |{}: ".format(self.name)
for binding in self.bindings:
mname, dname = binding.get_name()
Expand Down Expand Up @@ -284,7 +284,7 @@ class BindingList:
Parameters
----------
owner : ModuleWrapper/PipelineConfig
The owner of this list can be ModuleWrapper or PipelineConfig
The owner of this list can be ModuleWrapper or PipelineConfig.

type_name : str
The type of this binding list can be either "input" or "output".
Expand All @@ -304,7 +304,7 @@ def __getitem__(self, key):
if key not in self.bindings:
data_type = self.get_binding_data_type(key)
if not data_type and isinstance(self.io_owner, PipelineConfig.ModuleWrapper):
raise RuntimeError(f"Can not find {key} in binding list {self.binding_type}")
raise RuntimeError(f"Can not find {key} in binding list {self.binding_type}.")

self.bindings[key] = PipelineConfig.Binding(
self.io_owner, self.binding_type, key, data_type
Expand Down Expand Up @@ -397,7 +397,7 @@ def __str__(self):
inf = self.input_bindings.bindings[input_name]
input_dump += str(inf) + "\n"

# get connections
# get connections.
output = {}
connections_dump = "\nconnections\n"
for mod in self.mod_wrapper:
Expand Down Expand Up @@ -502,22 +502,22 @@ def get_mod_idx(self, mod):
return idx

def pipe_input(self, name):
"""Return the corresponding input binding interface accordding the name"""
"""Return the corresponding input binding interface accordding the name."""
Comment thread
huajsj marked this conversation as resolved.
Outdated
return self.input_bindings[name]

def pipe_output(self, idx):
"""Return the corresponding output binding interface accordding the name"""
"""Return the corresponding output binding interface accordding the name."""
Comment thread
huajsj marked this conversation as resolved.
Outdated
return self.output_bindings[idx]


class PipelineExecutorFactoryModule(object):
Comment thread
huajsj marked this conversation as resolved.
"""This is a wrapper class which contains GraphExecutorFactoryModule list
"""This is a wrapper class which contains GraphExecutorFactoryModule list.
and Module configurations.
Comment thread
huajsj marked this conversation as resolved.
Outdated

Parameters
----------
pipeline_mods : List[GraphExecutorFactoryModule]
list of GraphExecutorFactoryModule
list of GraphExecutorFactoryModule.

mod_config : Dict[int, Dict[str, Any]]
modules and modules dependency configuration informaiton.
Comment thread
huajsj marked this conversation as resolved.
Outdated
Expand Down
2 changes: 1 addition & 1 deletion tests/python/relay/test_pipeline_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_pipeline():
assert pipe_config.get_config() == get_manual_conf([mod1, mod2, mod3], target)

"""
# build then create pipeline module.
# Build then create pipeline module.
"""
with tvm.transform.PassContext(opt_level=3):
pipeline_mod_config = pipeline_executor.build(pipe_config)
Expand Down