提交 7d376f2e 编写于 作者: L liuqi

Update document and tools help information.

上级 de834c4e
...@@ -34,7 +34,7 @@ MiAI Compute Engine requires the following dependencies: ...@@ -34,7 +34,7 @@ MiAI Compute Engine requires the following dependencies:
- `bazel installation <https://docs.bazel.build/versions/master/install.html>`__ - `bazel installation <https://docs.bazel.build/versions/master/install.html>`__
* - android-ndk * - android-ndk
- r15c/r16b - r15c/r16b
- reference the docker file - `NDK installation <https://developer.android.com/ndk/guides/setup>`__ or reference the docker file
* - adb * - adb
- >= 1.0.32 - >= 1.0.32
- apt-get install android-tools-adb - apt-get install android-tools-adb
...@@ -63,6 +63,10 @@ MiAI Compute Engine requires the following dependencies: ...@@ -63,6 +63,10 @@ MiAI Compute Engine requires the following dependencies:
- >= 17.09.0-ce - >= 17.09.0-ce
- `install doc <https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository>`__ - `install doc <https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository>`__
.. note::
``export ANDROID_NDK_HOME=/path/to/ndk`` to Specify ANDROID_NDK_HOME
MiAI Compute Engine provides Dockerfile with these dependencies installed, MiAI Compute Engine provides Dockerfile with these dependencies installed,
you can build the image from the Dockerfile, you can build the image from the Dockerfile,
...@@ -226,80 +230,24 @@ model conversion, compiling, test run, benchmark and correctness validation. ...@@ -226,80 +230,24 @@ model conversion, compiling, test run, benchmark and correctness validation.
build library and test tools. build library and test tools.
* *--config* (type=str, default="", required) the path of model yaml configuration file.
* *--tuning* (default=false, optional) whether tuning the parameters for the GPU of specified SoC.
* *--enable_openmp* (default=true, optional) whether use openmp.
* **run** * **run**
.. note:: .. note::
run the model(s). run the model(s).
* *--config* (type=str, default="", required) the path of model yaml configuration file.
* *--round* (type=int, default=1, optional) times for run.
* *--validate* (default=false, optional): whether to verify the results are consistent with the frameworks
* *--caffe_env* (type=local/docker, default=docker, optional) you can specific caffe environment for validation. local environment or caffe docker image.
* *--restart_round* (type=int, default=1, optional) restart round between run.
* *--gpu_out_of_range_check* (default=false, optional): whether check out of memory for gpu.
* *--vlog_level* (type=int[0-5], default=0, optional): verbose log level for debug.
.. warning:: .. warning::
``run`` rely on ``build`` command, you should ``run`` after ``build``. ``run`` rely on ``build`` command, you should ``run`` after ``build``.
* **benchmark** * **benchmark**
* *--config* (type=str, default="", required) the path of model yaml configuration file.
.. warning:: .. warning::
``benchmark`` rely on ``build`` command, you should ``benchmark`` after ``build``. ``benchmark`` rely on ``build`` command, you should ``benchmark`` after ``build``.
**common arguments**
Use ``-h`` to get detailed help.
.. list-table::
:widths: auto
:header-rows: 1
:align: left
* - argument(key)
- argument(value)
- default
- required
- commands
- explanation
* - --omp_num_threads
- int
- -1
- N
- ``run``/``benchmark``
- number of threads
* - --cpu_affinity_policy
- int
- 1
- N
- ``run``/``benchmark``
- 0:AFFINITY_NONE/1:AFFINITY_BIG_ONLY/2:AFFINITY_LITTLE_ONLY
* - --gpu_perf_hint
- int
- 3
- N
- ``run``/``benchmark``
- 0:DEFAULT/1:LOW/2:NORMAL/3:HIGH
* - --gpu_perf_hint
- int
- 3
- N
- ``run``/``benchmark``
- 0:DEFAULT/1:LOW/2:NORMAL/3:HIGH
* - --gpu_priority_hint
- int
- 3
- N
- ``run``/``benchmark``
- 0:DEFAULT/1:LOW/2:NORMAL/3:HIGH
Using ``-h`` to get detailed help.
.. code:: sh .. code:: sh
...@@ -354,7 +302,7 @@ header files and packaged as ...@@ -354,7 +302,7 @@ header files and packaged as
│   ├── mace.h │   ├── mace.h
│   └── mace_runtime.h │   └── mace_runtime.h
├── libmace_mobilenet-v2-gpu.tar.gz ├── libmace_mobilenet-v2-gpu.tar.gz
├── library ├── lib
│   ├── arm64-v8a │   ├── arm64-v8a
│   │   └── libmace_mobilenet-v2-gpu.MI6.msm8998.a │   │   └── libmace_mobilenet-v2-gpu.MI6.msm8998.a
│   └── armeabi-v7a │   └── armeabi-v7a
...@@ -420,6 +368,7 @@ Please refer to \ ``mace/examples/example.cc``\ for full usage. The following li ...@@ -420,6 +368,7 @@ Please refer to \ ``mace/examples/example.cc``\ for full usage. The following li
// Include the headers // Include the headers
#include "mace/public/mace.h" #include "mace/public/mace.h"
#include "mace/public/mace_runtime.h" #include "mace/public/mace_runtime.h"
// If the build_type is code
#include "mace/public/mace_engine_factory.h" #include "mace/public/mace_engine_factory.h"
// 0. Set pre-compiled OpenCL binary program file paths when available // 0. Set pre-compiled OpenCL binary program file paths when available
......
...@@ -1210,7 +1210,7 @@ def parse_args(): ...@@ -1210,7 +1210,7 @@ def parse_args():
type=str, type=str,
default="", default="",
required=True, required=True,
help="model yaml configuration file path") help="the path of model yaml configuration file.")
all_type_parent_parser.add_argument( all_type_parent_parser.add_argument(
"--build_type", "--build_type",
type=str, type=str,
...@@ -1258,7 +1258,7 @@ def parse_args(): ...@@ -1258,7 +1258,7 @@ def parse_args():
build.add_argument( build.add_argument(
'--tuning', '--tuning',
action="store_true", action="store_true",
help="tuning gpu parameters for specified SOC") help="whether tuning the parameters for the GPU of specified SoC.")
build.add_argument( build.add_argument(
"--enable_openmp", "--enable_openmp",
action="store_false", action="store_false",
...@@ -1277,17 +1277,19 @@ def parse_args(): ...@@ -1277,17 +1277,19 @@ def parse_args():
run.add_argument( run.add_argument(
"--validate", "--validate",
action="store_true", action="store_true",
help="validate result by comparing mace output and platform's output.") help="whether to verify the results are consistent with "
"the frameworks.")
run.add_argument( run.add_argument(
"--caffe_env", "--caffe_env",
type=str_to_caffe_env_type, type=str_to_caffe_env_type,
default='docker', default='docker',
help="[docker | local] caffe environment.") help="[docker | local] you can specific caffe environment for"
" validation. local environment or caffe docker image.")
run.add_argument( run.add_argument(
"--vlog_level", "--vlog_level",
type=int, type=int,
default=0, default=0,
help="VLOG level: [1~5].") help="[1~5]. Verbose log level for debug.")
run.add_argument( run.add_argument(
"--gpu_out_of_range_check", "--gpu_out_of_range_check",
action="store_true", action="store_true",
...@@ -1296,7 +1298,7 @@ def parse_args(): ...@@ -1296,7 +1298,7 @@ def parse_args():
"--restart_round", "--restart_round",
type=int, type=int,
default=1, default=1,
help="restart round for run.") help="restart round between run.")
run.add_argument( run.add_argument(
"--report", "--report",
action="store_true", action="store_true",
......
...@@ -605,7 +605,7 @@ def update_libmace_shared_library(serial_num, ...@@ -605,7 +605,7 @@ def update_libmace_shared_library(serial_num,
sh.cp("-f", "bazel-bin/mace/libmace.so", library_dir) sh.cp("-f", "bazel-bin/mace/libmace.so", library_dir)
sh.cp("-f", sh.cp("-f",
"%s/sources/cxx-stl/gnu-libstdc++/4.9/libs/%s/libgnustl_shared.so" % "%s/sources/cxx-stl/gnu-libstdc++/4.9/libs/%s/libgnustl_shared.so" %
(os.environ["ANDROID_NDK"], abi), (os.environ["ANDROID_NDK_HOME"], abi),
library_dir) library_dir)
if os.path.exists("mace/libmace.so"): if os.path.exists("mace/libmace.so"):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册