Commit Graph

125 Commits

Author SHA1 Message Date
YdrMaster 8a871c3773 feat: 导出 conv 到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster afed749b74 feat: 支持导出权重
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 40fb8390b1 feat: 导入时保存权重
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster a5e692baea feat: 导出 batchnorm 到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 71ca4459d9 fmt
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 5b6698bac7 feat: 导出全图的输出张量到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 59bf59c10b docs: update README.md
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster fb3478bf3e build: update Makefile
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
wanghailu 514666591e add batch_norm 2023-03-15 17:23:32 +08:00
YdrMaster 3d122aebfe feat: 支持导出浮点向量
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster cf9bdb0562 feat: 支持打印结果
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster f44a4daf70 feat: 导出未初始化的张量
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 6dce129cb3 fix: TensorObj::dataMalloc
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster dc79b72655 fix: 重新导出 cuda_runtime()
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 9ab78f13f7 feat: 导出 cuda_runtime
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 60c5d6b5b8 fix: 先不在 cpu 上测试
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster ed81861375 temp: 实现初始值导入,但 resnet 报错
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster 4ffaa44c1e fix: Matmul 支持 2 维或以上的输入
> 现在能导入 resnet18

Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
YdrMaster a27391fcdc fix: 修正 batchNorm 实现
- onnx 和 pytorch 认为 batchNorm 的 4 个参数是 [c] 形状的,cuDNN 可能认为是 [1,c,1,...]。
优化已改为 [c],但 cuDNN 推理没有改;

Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 17:23:32 +08:00
Haojie Wang dd5d091dbc
wip: onnx 导出 (#65)
| Notice | Work in progress
|-|-

> based on #63 

## Progress

1. [x] 对节点拓扑排序
2. [x] 遍历节点,命名并导出其输出张量(`make_tensor_value_info`)
3. [x] 识别图的输入张量,命名并导出(`make_tensor_value_info`)
4. [x] 根据节点类型,识别权重及属性,导出节点(`make_node`)
5. [x] `make_graph` -> `check_graph` -> `make_model` -> `check_model`
2023-03-15 15:22:09 +08:00
YdrMaster 62fd619987 fix: 移除中文注释
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:16:16 +08:00
YdrMaster 71a87c27d1 feat: 导出 ReduceMean 到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster bb9b62b169 fix: 改正类型转换
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 2a23669394 feat: 导出 Reshape 到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster ffd0473bd2 feat: check everything
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 9e0f8f21bf feat: 生成模型对象
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 6b7af7077b feat: 导出 Gather Concat 到 onnx
- 并优化 python 代码

Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 9d9fbd44af feat: 导出 MatMul Concat 到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 32f6f02c81 feat: 导出 5 个单目算子到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 0517089dca feat: 导出输入张量到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster eff4c14a85 feat: 封装上下文对象以复用建图代码
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 0833a2f779 feat: 导出加减乘除幂到 onnx
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster f2591edbb4 feat: 导出 OpType,为节点命名
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster fe81fccf76 feat: 导出 OperatorObj
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster 45a3cdfa30 feat: GraphObj 增加一个拓扑排序方法及其测试
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
YdrMaster f20e791cf5 style: 修改 graph.h/graph.cc
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 15:09:12 +08:00
Haojie Wang 0f52d04882
Merge branch 'master' into dev-onnx 2023-03-15 14:52:03 +08:00
YdrMaster 978269162a fix: 移除 c++ 中的中文注释,python TODO 改 FIXME
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-03-15 14:48:39 +08:00
deathwings602 40d1b1c91b
Add ConvTransposedNHWC (#67)
* Add: IT_ASSERT_TODO

* [WIP] Add: ConvTranspose2d mutation test

* add ConvTransposedNHWC

* fix test_cuda_transposed_2d

---------

Co-authored-by: Liyan Zheng <liyan-zheng@outlook.com>
Co-authored-by: huangshuhong <huangsh19@mails.tsinghua.edu.cn>
2023-03-01 14:15:02 +08:00
YdrMaster 6871fff02b feat: 导出分配内存和运行推理的接口
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-23 11:08:00 +08:00
YdrMaster d7e52054e6 fix: 修正 GlobalAveragePool 和 Reshape 导入
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-23 08:59:06 +08:00
YdrMaster 4c7fdf44c5 feat: 前端支持 Conv 及单元测试
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-22 15:05:44 +08:00
YdrMaster ce04177585 style: use __path__ to import
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-21 09:17:34 +08:00
YdrMaster 6a4de807e6 style: remove non-ascii comments from cpp
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-16 14:57:51 +08:00
YdrMaster c9fee3f667 feat: 前端支持 GlobalAveragePool 及单元测试
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-16 10:33:24 +08:00
YdrMaster 391b9d16c0 cleanup
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-15 14:08:30 +08:00
YdrMaster afa90ec9c9 feat: 前端支持 gemm 及单元测试
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-15 13:20:34 +08:00
YdrMaster 315763a83a feat: 前端支持 pad 及单元测试
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-15 11:41:06 +08:00
YdrMaster 7893ae0cca opt: 优化 PadObj 和 SplitObj 构造器实现
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-15 11:28:49 +08:00
YdrMaster bb0e7540cc fix: revert ci yml
Signed-off-by: YdrMaster <ydrml@hotmail.com>
2023-02-15 07:45:21 +08:00