Skip to content

Commit

Permalink
update faq (#1139)
Browse files Browse the repository at this point in the history
* update faq

* update volkan version

* fix vulkan version

* update benckmark model url
  • Loading branch information
curioyang authored Jan 3, 2024
1 parent 583b64b commit cb3fc2d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/compiler-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- {name: x86_64-windows, os: windows-latest, shell: bash}

env:
VULKANSDK_VER: 1.2.182.0
VULKANSDK_VER: 1.3.268.0

steps:
- uses: actions/checkout@v3
Expand All @@ -99,8 +99,8 @@ jobs:

- name: Set up test environment (Linux)
run: |
wget https://sdk.lunarg.com/sdk/download/${VULKANSDK_VER}/linux/vulkansdk-linux-x86_64-${VULKANSDK_VER}.tar.gz -O vulkansdk.tar.gz
tar xf vulkansdk.tar.gz
wget https://sdk.lunarg.com/sdk/download/${VULKANSDK_VER}/linux/vulkansdk-linux-x86_64-${VULKANSDK_VER}.tar.xz -O vulkansdk.tar.xz
tar xf vulkansdk.tar.xz
sudo cp -P ${VULKANSDK_VER}/x86_64/lib/libvulkan.so* /usr/local/lib/
wget https://github.com/sunnycase/swiftshader/releases/download/v1.0/swiftshader-ubuntu-18.04-x86_64.zip -O swiftshader.zip
unzip swiftshader.zip
Expand All @@ -112,8 +112,8 @@ jobs:
- name: Set up test environment (Windows)
shell: pwsh
run: |
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/${env:VULKANSDK_VER}/windows/VulkanSDK-${env:VULKANSDK_VER}-Installer.exe -O VulkanSDK-Installer.exe
.\VulkanSDK-Installer.exe /S
# Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/${env:VULKANSDK_VER}/windows/VulkanSDK-${env:VULKANSDK_VER}-Installer.exe -O VulkanSDK-Installer.exe
# .\VulkanSDK-Installer.exe /S
Invoke-WebRequest -Uri https://github.com/sunnycase/swiftshader/releases/download/v1.0/swiftshader-windows-2019-x86_64.zip -OutFile swiftshader.zip
Expand-Archive swiftshader.zip
Copy-Item swiftshader\lib\vk_swiftshader_icd.json swiftshader\bin\
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compiler-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- {name: x86_64-windows, os: windows-latest, arch: x64}

env:
VULKANSDK_VER: 1.2.182.0
VULKANSDK_VER: 1.3.268.0

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions benchmark/gen_kmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

MODELS = {
"mnist": {
"url": "https://github.com/onnx/models/raw/main/vision/classification/mnist/model/mnist-8.onnx",
"url": "https://github.com/onnx/models/raw/main/validated/vision/classification/mnist/model/mnist-8.onnx",
"in_shapes": {"Input3": [1, 1, 28, 28]}
},
"mobilenet_v2": {
"url": "https://github.com/onnx/models/raw/main/vision/classification/mobilenet/model/mobilenetv2-7.onnx",
"url": "https://github.com/onnx/models/raw/main/validated/vision/classification/mobilenet/model/mobilenetv2-7.onnx",
"in_shapes": {"data": [1, 3, 224, 224]}
}
}
Expand Down
13 changes: 12 additions & 1 deletion docs/FAQ_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
2. What kinds of ops can be fully accelerated by KPU?

All the following constraints must be met.
- Feature map shape: Input feature maps smaller than or equal to 320x240(WxH) and output features map larger than or equal to 4x4(WxH) and channels are between 1 to 1024 are supported.
- Feature map shape: Input feature maps smaller than or equal to *320x240(WxH)* and output features map larger than or equal to *4x4(WxH)* and channels are between 1 to 1024 are supported.
- Same symmetric paddings (TensorFlow use asymmetric paddings when stride=2 and size is even).
- Normal Conv2D and DepthwiseConv2D of 1x1 or 3x3 filters and stride is 1 or 2.
- MaxPool(2x2 or 4x4) and AveragePool(2x2 or 4x4).
Expand All @@ -22,11 +22,22 @@
- DilatedConv2D, nncase will replace it with a SpaceToBatch + KPUConv2D + BatchToSpace.
- TransposeConv2D, nncase will replace it with a Pad + KPUConv2D.

4. Attention point about K210。

- Use official SDK repo:[kendryte-standalone-sdk](https://github.com/kendryte/kendryte-standalone-sdk).
- Use a pure English path and keep the path as short as possible.
- Projects that need to be compiled are placed in the src directory, see other examples.
- Use administrator privileges in Windows.

### Compile models
1. Fatal: Not supported tflite opcode: DEQUANTIZE

Use float tflite models, nncase will take care of quantization.

2. Fatal: inputs are not compatible to xxx.

Please check if the input of model is valid. Not support dynamic input shape.

### Deploy models
1. Should I normalize inputs when running the model?

Expand Down
13 changes: 12 additions & 1 deletion docs/FAQ_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
2. 哪些算子可以被 KPU 完全加速?

下面的约束需要全部满足。
- 特征图尺寸:输入特征图小于等于 320x240(WxH) 同时输出特征图大于等于 4x4(WxH),通道数在 1 到 1024。
- 特征图尺寸:输入特征图小于等于 *320x240(WxH)* 同时输出特征图大于等于 *4x4(WxH)*,通道数在 1 到 1024。
- Same 对称 paddings (TensorFlow 在 stride=2 同时尺寸为偶数时使用非对称 paddings)。
- 普通 Conv2D 和 DepthwiseConv2D,卷积核为 1x1 或 3x3,stride 为 1 或 2。
- MaxPool(2x2 或 4x4) 和 AveragePool(2x2 或 4x4)。
Expand All @@ -22,11 +22,22 @@
- DilatedConv2D, nncase 会把它替换为一个 SpaceToBatch + KPUConv2D + BatchToSpace。
- TransposeConv2D, nncase 会把它替换为一个 Pad + KPUConv2D。

4. 使用K210注意事项。

- 请使用官方SDK仓库:[kendryte-standalone-sdk](https://github.com/kendryte/kendryte-standalone-sdk).
- 使用纯英文路径,路径尽量短。
- 需要编译的项目放在src目录下,参考其他example。
- Windows下使用管理员权限。

### 编译模型
1. Fatal: Not supported tflite opcode: DEQUANTIZE

使用浮点 tflite 模型,nncase 会做量化。

2. Fatal: inputs are not compatible to xxx.

请检查模型输入是否合法,不支持动态shape。

### 部署模型
1. 运行模型是我需要归一化输入吗?

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ before-all = [
"pip install conan==1.59",
"conan profile new default --detect",
"conan profile update settings.compiler.libcxx=libstdc++11 default",
"wget https://sdk.lunarg.com/sdk/download/1.2.182.0/linux/vulkansdk-linux-x86_64-1.2.182.0.tar.gz -O vulkansdk.tar.gz",
"tar xf vulkansdk.tar.gz",
"cp -P 1.2.182.0/x86_64/lib/libvulkan.so* /usr/local/lib/"
"wget https://sdk.lunarg.com/sdk/download/1.3.268.0/linux/vulkansdk-linux-x86_64-1.3.268.0.tar.xz -O vulkansdk.tar.xz",
"tar xf vulkansdk.tar.xz",
"cp -P 1.3.268.0/x86_64/lib/libvulkan.so* /usr/local/lib/"
]
before-build = "pip install https://github.com/sunnycase/auditwheel/releases/download/4.0.0-nncase-2/auditwheel-0.0.0-py3-none-any.whl"
repair-wheel-command = "LD_LIBRARY_PATH=/usr/lib64 auditwheel repair -w {dest_dir} {wheel} --exclude libvulkan.so.1,libgomp.so.1"
Expand Down

0 comments on commit cb3fc2d

Please sign in to comment.