Skip to content

Commit

Permalink
add link for shape bucket && opt jupyter docker cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghaoqi committed Aug 25, 2023
1 parent 2d97be5 commit 682f54c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
12 changes: 11 additions & 1 deletion docs/USAGE_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

在执行脚本之前需要根据自身需求修改以下内容:

Expand Down Expand Up @@ -153,6 +161,8 @@ subgraph A
end

```
##### 动态shape参数
详见[动态shape参数说明](./shape_bucket.md)

#### 代码示例

Expand Down
14 changes: 13 additions & 1 deletion docs/USAGE_v2_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -154,6 +163,9 @@ subgraph A
```

##### Dynamice shape args
Refer to[Dynamic shape args description](./shape_bucket.md)

#### Example

```python
Expand Down
12 changes: 6 additions & 6 deletions docs/shape_bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 682f54c

Please sign in to comment.