From 682f54ce5d22c704f5cc2b3b7dff6c3aa64bdcef Mon Sep 17 00:00:00 2001 From: yanghaoqi Date: Fri, 25 Aug 2023 10:27:31 +0800 Subject: [PATCH] add link for shape bucket && opt jupyter docker cmd --- docs/USAGE_v2.md | 12 +++++++++++- docs/USAGE_v2_EN.md | 14 +++++++++++++- docs/shape_bucket.md | 12 ++++++------ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/docs/USAGE_v2.md b/docs/USAGE_v2.md index 224ebd33c5..68944d7bbf 100644 --- a/docs/USAGE_v2.md +++ b/docs/USAGE_v2.md @@ -46,7 +46,15 @@ Type "help", "copyright", "credits" or "license" for more information. k230模型编译推理参考Jupyter脚本:[User_guide](../examples/user_guide/k230_simulate.ipynb),脚本中包含了单输入和多输入的示例。 -如果在Docker中运行Jupyter脚本,可以参考[配置Jupyter lab](https://github.com/kunjing96/docker-jupyterlab#32-%E9%85%8D%E7%BD%AEjupyter-lab)进行配置。 +如果在Docker中运行Jupyter脚本,可以参考以下命令,之后在浏览器窗口打开即可。 + +```shell +docker run -it --rm --privileged=true -p 8889:8889 --name Kendryte -v `pwd`:/mnt -w /mnt ghcr.io/kendryte/k230_sdk /bin/bash -c "/bin/bash + +pip install jupyterlab + +jupyter-lab --ip 0.0.0.0 --allow-root +``` 在执行脚本之前需要根据自身需求修改以下内容: @@ -153,6 +161,8 @@ subgraph A end ``` +##### 动态shape参数 +详见[动态shape参数说明](./shape_bucket.md) #### 代码示例 diff --git a/docs/USAGE_v2_EN.md b/docs/USAGE_v2_EN.md index 4ff2a12942..5800ccfc7e 100644 --- a/docs/USAGE_v2_EN.md +++ b/docs/USAGE_v2_EN.md @@ -46,7 +46,16 @@ Type "help", "copyright", "credits" or "license" for more information. Model compilation, inference for k230 can be found in the Jupyter script [User_guide](../examples/user_guide/k230_simulate.ipynb), this script contains single and multiple input examples. -If you run Jupyter scripts in Docker, you can refer to [Configure Jupyter lab](https://github.com/kunjing96/docker-jupyterlab#32-%E9%85%8D%E7%BD%AEjupyter-lab) to configure them. +If you run the Jupyter script in Docker, you can refer to the command and then open it in your browser. + +```shell +docker run -it --rm --privileged=true -p 8889:8889 --name Kendryte -v `pwd`:/mnt -w /mnt ghcr.io/kendryte/k230_sdk /bin/bash -c "/bin/bash + +pip install jupyterlab + +jupyter-lab --ip 0.0.0.0 --allow-root +``` + You need to modify the following to suit your needs before executing the script: @@ -154,6 +163,9 @@ subgraph A ``` +##### Dynamice shape args +Refer to[Dynamic shape args description](./shape_bucket.md) + #### Example ```python diff --git a/docs/shape_bucket.md b/docs/shape_bucket.md index a37929f7db..7af9f2a459 100644 --- a/docs/shape_bucket.md +++ b/docs/shape_bucket.md @@ -4,12 +4,12 @@ ShapeBucket是针对动态shape的一种解决方案,会根据输入长度的 对应的不同CompileOptions中的字段 -| 字段名称 | 类型 | 是否必须 | 描述 | -| --------------------------- | ---------------- | -------- | ------------------------------------------------------------ | -| shape_bucket_enable | bool | 是 | 是否开启ShapeBucket功能,默认为False。在 `dump_ir=True`时生效 | -| shape_bucket_range_info | Dict[str, [int]] | 是 | 每个输入shape维度信息中的变量的范围,最小值必须大于等于1 | -| shape_bucket_segments_count | int | 是 | 输入变量的范围划分为几段 | -| shape_bucket_fix_var_map | Dict[str, int] | 否 | 固定shape维度信息中的变量为特定的值 | +| 字段名称 | 类型 | 是否必须 | 描述 | +| --------------------------- | --------------------- | -------- | --------------------------------------------------------------- | +| shape_bucket_enable | bool | 是 | 是否开启ShapeBucket功能,默认为False。在 `dump_ir=True`时生效 | +| shape_bucket_range_info | Dict[str, [int, int]] | 是 | 每个输入shape维度信息中的变量的范围,最小值必须大于等于1 | +| shape_bucket_segments_count | int | 是 | 输入变量的范围划分为几段 | +| shape_bucket_fix_var_map | Dict[str, int] | 否 | 固定shape维度信息中的变量为特定的值 | ## onnx