-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(tvm_utility): remove download logic from CMake and update docum…
…entation (#4923) * add include tier4_autoware_utils and dependency Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * remove downloading logic from Cmake, update documentation Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): remove downloading logic from Cmake, update documentation Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): fix lint_cmake error Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): format warning message Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): add logic to work with autoware_data folder, add nn config header and test image Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * style(pre-commit): autofix * build(tvm_utility): refactor, update InferenceEngineTVM constructor Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): add lightweight model and test with it Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): make building yolo_v2_tiny disable by default Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): remove test artifact for yolo_v2_tiny Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): update docs Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): update docs Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): update namespace in abs_model test Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): rewrite yolo_v2_tiny as example Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): clean comments in yolo_v2_tiny example main.cpp Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): add launch file for yolo_v2_tiny example Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): update yolo_v2_tiny example readme Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): add model for arm based systems, need to be tested on device Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * style(pre-commit): autofix * build(tvm_utility): update config header for arm Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): remove debug output Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): add find_package conditional section Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): fix lint_cmake errors Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): remove coping model files during build Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): update readme with new data folder structure Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): fix spell check warnings Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): add no model files guard to get_neural_network Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): set back default paths in config headers Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): add param file, update launch file Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): add schema file, update node name Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): fix json-schema-check Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): fix json-schema-check Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * build(tvm_utility): add parameter table to example readme Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * build(tvm_utility): fix typo-error in description of schema.json Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> * style(pre-commit): autofix * buiild(tvm_utility): fix spell-check warning and typo Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> --------- Signed-off-by: Alexey Panferov <lexavtanke@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
27f28d6
commit e16ebd8
Showing
21 changed files
with
649 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
"perception/bytetrack/lib/**" | ||
], | ||
"ignoreRegExpList": [], | ||
"words": [] | ||
"words": ["dltype", "tvmgen"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
artifacts/**/*.jpg | ||
data/ | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/**: | ||
ros__parameters: | ||
image_filename: $(find-pkg-share tvm_utility)/artifacts/yolo_v2_tiny/test_image_0.jpg | ||
label_filename: $(find-pkg-share tvm_utility)/artifacts/yolo_v2_tiny/labels.txt | ||
anchor_filename: $(find-pkg-share tvm_utility)/artifacts/yolo_v2_tiny/anchors.csv | ||
data_path: $(env HOME)/autoware_data |
36 changes: 36 additions & 0 deletions
36
common/tvm_utility/data/models/abs_model_aarch64/deploy_graph.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"nodes": [ | ||
{ | ||
"op": "null", | ||
"name": "a", | ||
"inputs": [] | ||
}, | ||
{ | ||
"op": "tvm_op", | ||
"name": "tvmgen_default_fused_abs", | ||
"attrs": { | ||
"num_outputs": "1", | ||
"num_inputs": "1", | ||
"flatten_data": "0", | ||
"func_name": "tvmgen_default_fused_abs", | ||
"hash": "1be44995aa501758" | ||
}, | ||
"inputs": [[0, 0, 0]] | ||
} | ||
], | ||
"arg_nodes": [0], | ||
"heads": [[1, 0, 0]], | ||
"attrs": { | ||
"dltype": ["list_str", ["float32", "float32"]], | ||
"device_index": ["list_int", [1, 1]], | ||
"storage_id": ["list_int", [0, 1]], | ||
"shape": [ | ||
"list_shape", | ||
[ | ||
[2, 2], | ||
[2, 2] | ||
] | ||
] | ||
}, | ||
"node_row_ptr": [0, 1, 2] | ||
} |
Binary file not shown.
Binary file added
BIN
+32 Bytes
common/tvm_utility/data/models/abs_model_aarch64/deploy_param.params
Binary file not shown.
54 changes: 54 additions & 0 deletions
54
common/tvm_utility/data/models/abs_model_aarch64/inference_engine_tvm_config.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2021 Arm Limited and Contributors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "tvm_utility/pipeline.hpp" | ||
|
||
#ifndef COMMON__TVM_UTILITY__DATA__MODELS__ABS_MODEL_AARCH64__INFERENCE_ENGINE_TVM_CONFIG_HPP_ // NOLINT | ||
#define COMMON__TVM_UTILITY__DATA__MODELS__ABS_MODEL_AARCH64__INFERENCE_ENGINE_TVM_CONFIG_HPP_ | ||
|
||
namespace model_zoo | ||
{ | ||
namespace inf_test | ||
{ | ||
namespace engine_load | ||
{ | ||
namespace abs_model | ||
{ | ||
|
||
static const tvm_utility::pipeline::InferenceEngineTVMConfig config{ | ||
{0, 0, 0}, // modelzoo_version | ||
|
||
// cspell: ignore mtriple | ||
"abs_model_aarch64", // network_name | ||
"llvm -mtriple=aarch64-linux-gnu", // network_backend | ||
|
||
"deploy_lib.so", // network_module_path | ||
"deploy_graph.json", // network_graph_path | ||
"deploy_param.params", // network_params_path | ||
|
||
// cspell: ignore DLCPU | ||
kDLCPU, // tvm_device_type | ||
0, // tvm_device_id | ||
|
||
{{"a", kDLFloat, 32, 1, {2, 2}}}, // network_inputs | ||
|
||
{{"output", kDLFloat, 32, 1, {2, 2}}} // network_outputs | ||
}; | ||
|
||
} // namespace abs_model | ||
} // namespace engine_load | ||
} // namespace inf_test | ||
} // namespace model_zoo | ||
#endif // COMMON__TVM_UTILITY__DATA__MODELS__ABS_MODEL_AARCH64__INFERENCE_ENGINE_TVM_CONFIG_HPP_ | ||
// NOLINT |
36 changes: 36 additions & 0 deletions
36
common/tvm_utility/data/models/abs_model_x86_64/deploy_graph.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"nodes": [ | ||
{ | ||
"op": "null", | ||
"name": "a", | ||
"inputs": [] | ||
}, | ||
{ | ||
"op": "tvm_op", | ||
"name": "tvmgen_default_fused_abs", | ||
"attrs": { | ||
"num_outputs": "1", | ||
"num_inputs": "1", | ||
"flatten_data": "0", | ||
"func_name": "tvmgen_default_fused_abs", | ||
"hash": "1be44995aa501758" | ||
}, | ||
"inputs": [[0, 0, 0]] | ||
} | ||
], | ||
"arg_nodes": [0], | ||
"heads": [[1, 0, 0]], | ||
"attrs": { | ||
"dltype": ["list_str", ["float32", "float32"]], | ||
"device_index": ["list_int", [1, 1]], | ||
"storage_id": ["list_int", [0, 1]], | ||
"shape": [ | ||
"list_shape", | ||
[ | ||
[2, 2], | ||
[2, 2] | ||
] | ||
] | ||
}, | ||
"node_row_ptr": [0, 1, 2] | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.