Highlights

Python API

  • 重构 DTR 相关的 API 并修复其中随机数算子相关的 bug。
  • 新增 gradient clip 相关 API。
  • 新增 correlation 算子。
  • 新增 sliding_window 算子。
  • 重构随机数生成的代码,解决随机数生成速度慢的问题。
  • 添加了参数量/计算量统计与可视化工具。

问题修复

CUDA

  • 修复 NCHW4 layout 使用 cuDNN8.0.4 时候 convbias 中融合Z错误。
  • 修复多个库用了不同版本的 cub 可能带来的隐藏链接问题。

Python API

  • argmax 和 argmin 的 axis 参数接受负数。
  • 如果 attach 到 grad manager 的参数不是 iterable of tensors 时报错。
  • 退出前删除已有的 tensor 以避免非零的退出码。
  • 修复动态图下使用 fastrun 查询算法结果过慢的问题。
  • 如果 batch normalization 的 mode 在 dump 时是 training 就报错。
  • 修复 param pack 中的 UAF。
  • 修复 gather 求导卡住。
  • 修复 trace 中 tensor 共享存储时导致的 bug。

分布式训练

  • 修复程序退出释放资源时多线程竞态问题。

周边工具

  • 修复 dump_with_mge.py 脚本中的 bug。
  • 修复 CUDA pytest 概率下卡死。
  • 修复 VOC dataset 中缺失的 class_colors。
  • 修复 VarNode 的 inplace 操作时的 bug。

文档

  • API 文档修复了 BN momentum 描述。

通用组件

  • 修复 fast-run workspace 限制 bug。
  • 修复 elementise mode 中 enum 和 string 类型比较时的 bug。
  • 修复 optimizer 在 step 时修改了 param.grad 的问题。
  • 修复了 Lighting 中的 scale 范围。
  • 修复 fast run 从 cache 中找算法时过滤规则缺失的问题。
  • 模型 dump 支持 backward opr。
  • 修改 TensorRT Runtime Opr 的是否有batch的判断依据,只根据输入来判断。
  • 修复由 module setattr 引起的打印 module 出错的问题。

新功能

通用组件

  • dnn opt assert 时增加输出关键 log 的功能。
  • 为了更好的支持后续功能,对 fastrun cache 结构做了重构。

周边工具

  • 添加命令行工具 mge 以便捷调用 tools 目录中的脚本,并支持 bash 补全。

参数量/计算量统计与可视化工具

  • 统计类型增加 norm 和 pooling。
  • 增加 统计 activations 功能 (比 flops 更能反应GPU性能)。
  • 增加递归更改 module status。
  • module_stats 的 input_size 参数修改为 input_shapes,表示可支持复数。
  • 对于 flops/parameters/activations 支持返回值。
  • 支持关掉打印信息便于自动化脚本集成。

发版流程

  • 构建系统从 make 迁移到 ninjia ,优化发版时间。

Python API

  • 重构随机数生成的代码,解决随机数生成速度慢的问题。
  • 添加 MegEngine.ConvTranspose3D。

改进

CUDA

  • 增加 CUDA conv_bwd_data 和 conv_bwd_filter 算法精度抖动测试。

Python API

  • 增加计算 loss 时的 reduction 选项。
  • trace 可以返回任意类型的输出。

周边工具

  • 对 qat and quantized module 增加__repr__ 方法。
  • 避免 load_graph 时不必要的 "span dist too large" 警告。
  • 提升统计工具的用户体验。

通用组件

  • 增加 CUDA API 调用的 cache。

Known Issue

  • 在开启DTR训练时,可能会出现申请显存失败的报错日志,这说明当前正在进行碎片整理,整理后程序可能可以继续运行。

MegEngine Release Notes

Highlights

Python API

  • The API of Dynamic Tensor Rematerialization is refactored and there is a minor bug fix to work around random operators.
  • Add gradient clip.
  • Add correlation operator.
  • Add sliding_window operator.
  • Refactor random operator and resolve the performance issue.
  • Add parameter/calculation statistics and visualization.

Bug Fixes

CUDA

  • Fix fusing Z error in convbias when use nchw4 layout in cuDNN8.0.4.
  • Fix potential linking issues caused by multiple libraries using different versions of cub.

Python API

  • Argmax and argmin accept negtive axis.
  • Error out if parameters attached to grad manager are not iterable of tensors.
  • Delete existing tensors before compnode finalizing to avoid non-zero exit code.
  • Fix overhead of query algorithm when execution strategy is set to PROFILE.
  • Error out if batch normalization is dumped in training mode.
  • Fix UAF in param pack.
  • Fix hanging when taking gradient to gather operator.
  • Fix bug in trace when memory is shared between tenors.

Distributed Training

  • Fix multi-thread race condition when the program exits.

Tools

  • Minor fixes to the dump_with_mge.py script
  • Fix CUDA pytest random hang.
  • Fix missed class_colors in VOC dataset.
  • Fix bug of VarNode inplace operations.

Documents

  • Fix  BN momentum description of API documentation.

General components

  • Fix fast run workspace limitation bug.
  • Fix comparison between enum and string types for elemwise mode.
  • Fix the problem that the optimizer modifies param.grad during step.
  • Fix the scale range of Lighting.
  • Fix the problem of incomplete filtering rules when fast run searches for algorithms from the cache.
  • Support dumping backward opr.
  • Modify TensorRT Runtime Opr to determine whether there is a batch dim, only set based on input dim.
  • Fix the problem of printing module error caused by module setattr.

New Features

General components

  • Add more critical log when assert occurs.
  • In order to better support future work, the fastrun cache structure has been refactored.

Tools

  • Add the command line tool mge to conveniently call the scripts in the tools directory, and support bash completion.

Parameter/calculation statistics and visualization

  • Statistics type adds support norm and pooling .
  • Add support activation statistics.
  • Change module status recursively.
  • The input_size parameter of module_stats is modified to input_shapes.
  • Support return value of flops/parameters/activations.
  • Support preventing information print to facilitate the integration of automated scripts.

Release workflow

  • Build system migration from make to ninjia.

Python API

  • Refactor random operator and resolve the performance issue.
  • Add MegEngine.ConvTranspose3D.

Improvements

CUDA

  • Add CUDA  conv_bwd_Data and conv_bwd_Filter algorithm accuracy shake check.

Python API

  • Add reduction choices to loss functions.
  • Make trace return any kind of output.

Tools

  • Add repr method for qat and quantized module.
  • Avoid unnecessary "span dist too large" warning in load_graph.
  • Improve statistical tools' user experience .

General components

  • Add CUDA API cache.

Known Issue

  • When DTR training is enabled, there may be some error logs showing that allocating memory has failed. This indicates that the program is currently in defragmentation phase and the program may continue to run after defragmentation.

项目简介

MegEngine 是一个快速、可拓展、易于使用且支持自动求导的深度学习框架

🚀 Github 镜像仓库 🚀

源项目地址

https://github.com/MegEngine/MegEngine

发行版本 37

MegEngine v1.13.1

全部发行版

贡献者 39

全部贡献者

开发语言

  • C++ 79.8 %
  • Cuda 13.8 %
  • Python 4.9 %
  • C 0.9 %
  • CMake 0.5 %