Skip to content

Commit 9360959

Browse files
committed
update Readme and delete some info
1 parent c477469 commit 9360959

File tree

2 files changed

+13
-116
lines changed

2 files changed

+13
-116
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@
1111
## Torch
1212

1313
- [README.md](torch/README.md)
14+
15+
## TVM
16+
17+
- runtime
18+
- [runtime.md](tvm/runtime.md)
19+
20+
## IREE
21+
22+
- runtime
23+
- [runtime.md](iree/runtime.md)

tvm/tvm.md renamed to tvm/runtime.md

+3-116
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,19 @@ python: load_module
3232
-> `tkey == "_lib"` call `make_object<LibraryModuleNode>`
3333
-> `tkey == "_import_tree"` read `import_tree_row_ptr` and `import_tree_child_indices`
3434
-> `tkey == <others>` call `LoadModuleFromBinary@src/runtime/library_module.cc:107`
35-
-> call `runtime.module.loadbinary_<tkey>` for rcar target, it is `runtime.module.loadbinary_rcar_v4x`
36-
-> call `LoadFromBinary@src/runtime/contrib/rcar_v4x/rcar_v4x_runtime.cc:140`
35+
-> call `runtime.module.loadbinary_<tkey>` for target
36+
-> call `LoadFromBinary@src/runtime/contrib/target/target_runtime.cc:140`
3737
-> push back into the Module List
3838
-> return the root module which is the first module in the list.
3939
```
4040

4141
During the `CreateModuleFromLibrary` function, the `net_onnx_rdl.tar` will be untar and with `g++ -shared -fPIC -o <output_name>.so devc.o lib0.o` to create the shared library.
4242

43-
4443
```log
4544
python: tvm.graph_executor.create
4645
-> call the `GraphExecutorCreate@src/runtime/graph_executor/graph_executor.cc:788`
4746
-> call the `exec->Init`
4847
-> call the `this->Load(&reader)` # This is the `Load` function.
49-
-> in this load function, it will parse the metadata.json like this (in the graph_json chapter):
50-
-> Here it will extract the `arg_nodes`, `heads`, `nodes`, `node_row_ptr`, `attrs` and `shape` information.
51-
-> and init the vector of Node in the `GraphExecutor` object.
52-
-> and all the nodes in the json will be extracted to the `TVMOpParam`.
5348
-> call `GraphExecutor::SetupStorage()`
5449
-> calculate the tensor space and create a storage list and allocate the memory.
5550
-> call `GraphExecutor::SetupOpExecs()`
@@ -58,7 +53,7 @@ python: tvm.graph_executor.create
5853
-> scan the input and output and create the TVMArgs
5954
-> `module_.GetFunction(param.func_name, true);`
6055
# Here the param.func_name is the function name in the json.
61-
# So, This will call the `RCarV4XRuntime::GetFunction` since the name is for rcar target.
56+
# So, This will call the `TargetRuntime::GetFunction` since the name is for target.
6257
# -> `ModuleNode::GetFunction@src/runtime/module.cc:64`
6358
-> return the function ptr and args ptr.
6459
@@ -70,111 +65,3 @@ python:
7065
```
7166

7267
Note: call the GetFuntion(`default`) function, This will convert the tensor into device tensor.
73-
74-
## graph_json
75-
76-
```json
77-
{
78-
"nodes": [
79-
{
80-
"op": "null",
81-
"name": "input",
82-
"inputs": []
83-
},
84-
{
85-
"op": "tvm_op",
86-
"name": "tvmgen_foo_rcardkl_main_0",
87-
"attrs": {
88-
"num_outputs": "1",
89-
"num_inputs": "1",
90-
"flatten_data": "0",
91-
"func_name": "tvmgen_foo_rcardkl_main_0"
92-
},
93-
"inputs": [
94-
[
95-
0,
96-
0,
97-
0
98-
]
99-
]
100-
},
101-
{
102-
"op": "tvm_op",
103-
"name": "tvmgen_foo_tvmgen_foo_rcar_imp_main_0",
104-
"attrs": {
105-
"flatten_data": "0",
106-
"func_name": "tvmgen_foo_tvmgen_foo_rcar_imp_main_0",
107-
"out_layout": "",
108-
"data_layout": "NCHW",
109-
"hash": "3fb7d5cff8f3e218",
110-
"kernel_layout": "OIHW",
111-
"num_outputs": "1",
112-
"num_inputs": "1",
113-
"global_symbol": "tvmgen_foo_tvmgen_foo_rcar_imp_main_0",
114-
"Compiler": "rcar_imp"
115-
},
116-
"inputs": [
117-
[
118-
1,
119-
0,
120-
0
121-
]
122-
]
123-
},
124-
{
125-
"op": "tvm_op",
126-
"name": "tvmgen_foo_rcardkl_main_3",
127-
"attrs": {
128-
"num_outputs": "1",
129-
"num_inputs": "1",
130-
"flatten_data": "0",
131-
"func_name": "tvmgen_foo_rcardkl_main_3"
132-
},
133-
"inputs": [
134-
[
135-
2,
136-
0,
137-
0
138-
]
139-
]
140-
}
141-
],
142-
"arg_nodes": [0],
143-
"heads": [
144-
[
145-
3,
146-
0,
147-
0
148-
]
149-
],
150-
"attrs": {
151-
"dltype": [
152-
"list_str",
153-
[
154-
"float32",
155-
"int8",
156-
"int8",
157-
"float32"
158-
]
159-
],
160-
"device_index": [
161-
"list_int",
162-
[1, 1, 1, 1]
163-
],
164-
"storage_id": [
165-
"list_int",
166-
[0, 1, 2, 3]
167-
],
168-
"shape": [
169-
"list_shape",
170-
[
171-
[1, 3, 224, 224],
172-
[1, 3, 224, 224],
173-
[1, 512, 1, 1],
174-
[1, 1000]
175-
]
176-
]
177-
},
178-
"node_row_ptr": [0, 1, 2, 3, 4]
179-
}
180-
```

0 commit comments

Comments
 (0)