PaddlePaddle/Paddle.js v2.0.0
PaddlePaddle/Paddle.js
Captured source
source ↗Paddle.js-v2.0.0
Repository: PaddlePaddle/Paddle.js
Tag: v2.0.0
Published: 2021-03-30T03:34:31Z
Prerelease: no
Release notes:
2.0.0 Release Note
Paddle.js v2.0 全面支持 Paddle 2.0 模型推理,并进行了架构升级。同时,预测性能相对 1.0 版本有较大提升,支持数据 4 通道排布,支持 WebGPU、NodeGL 和 Cpu 多种计算加速方案。支持了更多模型结构和算子类型。
架构升级
通过缩减代码规模和进一步拆分和封装,让子模块都能够完整地工程化,从而提升 Paddle.js 的可维护性和代码质量,提升研发效率,降低使用门槛
1. 代码拆解解耦离线和在线模块,解耦主框架运行时和计算方案(backend);形成以独立迭代(开发、维护、上线)的模块;从单一代码库升级为 Monorepos 2. 提供统一的工程化规范约束,拆分出来的模块再对其加以个性化并使用 !image
框架升级
1. 新增支持计算方案:WebGPU、NodeGL 和 Cpu 2. 支持数据 4 通道排布,减少I/O,提升预测性能,MobileNetV2 在 webgl 2.0 下预测耗时提升 39.6%;webgl 1.0 预测性能提升 40% 3. 封装模型库 paddlejs-models 和工具包 paddlejs-mediapipe,提供简单 api,整体上提升 Paddle.js 易用性 4. 升级 paddlejs-backend-webgl 算子和模型转换工具 paddlejs-converter 适配 Paddle 2.0 5. 新增 benchmark,分析模型推理耗时,助力性能提升 6. 支持模型变形机制:preTransform 、transform 和 postTransform,便于对对特殊模型结构进行变换处理
性能增强
相对于 1.0 版本 Paddle.js 在 WebGL backend下,模型性能有较大提升: MobileNetV2 在 webgl 1.0 环境下 预测耗时性能提升 40%;在 webgl 2.0 环境下 预测耗时性能提升 39.6%。
浏览器/系统覆盖范围
PC浏览器: Chrome、Safari、Firefox 手机浏览器: Baidu App、Safari、Chrome、UC and QQ Browser 小程序: 百度小程序、微信小程序 系统: MacOS、Windows
模型结构支持
MobileNetV1 MobileNetV2 MobileNetV3 ShuffleNetV2 ssd-MobileNetV3 GhostNet HRNet_w18_small_v1
新增算子支持
arg_max arg_min elementwise_mul elementwise_div unsqueeze2 fc dropout hard_sigmoid sigmoid matmul clip flatten_contiguous_range greater_than reduce_sum where pow sqrt
2.0.0 Release Note
Paddle.js v2.0.0 fully supports Paddle v2.0. It implements architecture upgradation and separation. Compared with v1.0.0, the performance has been greatly improved. It supports texture packing and adds WebGPU, NodeGL, Cpu, NodeGL backends. More model structures and operator types are supported.
Breaking changes
This release contains a number of breaking changes, details of which are listed below:
Architecture upgrade:
Improve maintainability and code quality of Paddle.js by reducing code size and further splitting / packaging, so that sub-modules can be fully engineered, improving R&D efficiency and lowering the barrier to use.
1. Disassembled offline and online modules, decouple the main frame runtime and backend modules. Each module can be iterated independently. Organized the large codebases into monorepos.
2. Provide unified engineering specification constraints, and each package can be used individuality.
Functional upgrading:
1. Add new backends: WebGPU、NodeGL 和 Cpu
2. Support texture packing and reduce I/O operations to improve performance.
3. Package model library paddlejs-models and toolkit paddlejs-mediapipe. Provide simple api and better usability of Paddle.js.
4. Some operators are newly added or upgraded in Paddle v2.0, and model conversion tool paddlejs-converter is upgraded in Paddle v2.0.
5. Add benchmark tool to analyze model inference time to help performance optimization.
6. Support transform-mechanism, including preTransform, transform and postTransform, which helps users transform special model structure conveniently.
Performance optimization:
Compared with v1.0.0, the performance has been greatly improved. Optimized MobileNetV2 (speedup 40% in WebGL 1.0, 39.6% in WebGL 2.0)
Coverage:
PC: Chrome, Safari, Firefox Phone: Baidu App, Chrome, UC and QQ Browser Smartprogram: Baidu Smartprogram, WX Smartprogram Platform: macOS, Windows
Model architecture:
MobileNetV1 MobileNetV2 MobileNetV3 ShuffleNetV2 ssd-MobileNetV3 GhostNet HRNet_w18_small_v1
New Operators:
arg_max arg_min elementwise_mul elementwise_div unsqueeze2 fc dropout hard_sigmoid sigmoid matmul clip flatten_contiguous_range greater_than reduce_sum where pow sqrt