Skip to content

Commit

Permalink
1. Support export sub_model
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 19, 2024
1 parent e33c86e commit 8c47d8d
Show file tree
Hide file tree
Showing 174 changed files with 1,781 additions and 749 deletions.
7 changes: 7 additions & 0 deletions tools/pnnx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ set(CMAKE_CXX_STANDARD 14)
# set(CMAKE_BUILD_TYPE relwithdebinfo)
# set(CMAKE_BUILD_TYPE release)

string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
if(${BUILD_TYPE_UPPER} STREQUAL "DEBUG")
add_compile_definitions(DEBUG)
else()
add_compile_definitions(NDEBUG)
endif()

option(PNNX_COVERAGE "build for coverage" OFF)

# set(Torch_INSTALL_DIR "/home/nihui/osd/pnnx/install" CACHE STRING "")
Expand Down
35 changes: 35 additions & 0 deletions tools/pnnx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,41 @@ TORCH_LIBRARY(upfirdn2d_op, m) {
]
}
```

2. 通过pnnx可执行文件直接进行c++调试
```json

{
"version": "0.2.0",
"configurations": [

{
"name": "msvc",
"type": "cppvsdbg",
"request": "launch",
// "program": "${workspaceFolder}/bin/test_ReduceL1_wrapper.exe",
"program": "${workspaceFolder}/python/build/lib.win-amd64-cpython-38/pnnx/Debug/pnnx.exe",

// "args": ["D:\\project\\programs\\ncnn_project\\nvppnnx\\model_zoo\\segformer\\model.pt",
// "inputshape=[1,3,512,512]","start_nodes=597,591,585,579","end_nodes=598"],

"args": ["D:/project/programs/my_project/tests/test_python/test_op/model_zoo3/script_test/test.pt",
"D:/project/programs/ncnn_project/nvppnnx/model_zoo/script_test",
"inputshape=[2,3],[1]i64"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
// "preLaunchTask": "task of build with msvc"
}
]
}
```

修改了输入参数,第二个参数为保存pnnx的路径。

新增"extract_model_name"输入参数,指定拆分网络的name,可以是主网络也可是是子网络。

# 添加自定义算子实例
在 mytests文件夹下添加了自定义算子实例,可以参考
|op_name|path|
Expand Down
8 changes: 7 additions & 1 deletion tools/pnnx/Releasenotes
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@ dev.1.0.18.20240613
1. Skip conv2d nodes of type NoneType

dev.1.0.19.20240614
1. Add extracting sub graph function
1. Add extracting sub graph function

dev.1.0.20.20240617
1. Add loop op parse function

dev.1.0.21.20240619
1. Support export sub_model
Loading

0 comments on commit 8c47d8d

Please sign in to comment.