Yinggang Wang
Yinggang Wang
## Summary 由于 autograd.grad 的机制问题,会借用 tensor.retain_grad 属性,把临时的 grad 存在 tensor.grad 上,导致的结果错误。 ## Code to reproduce bug ```python import oneflow as flow # import torch as flow a = flow.ones(2, 3).requires_grad_()...
lazy tensor indexing 支持。 主要处理了: - indexing functor 内对 eager/lazy mode 的管理,value tensor 可以做合适的预处理 - 解决 lazy boxing 中对 0size tensor 没有处理,导致的程序崩溃
打开 ONEFLOW_DEBUG_MODE=1 环境变量后, 每次后向计算都会生成 AutogradEngine 执行图到 log 目录下的 dot file。可以从图中看到后向执行的算子以及拓扑结构,方便算法人员和研发人员 debug 后向的问题。 ### autograd.grad ```python import oneflow as flow # autograd.grad a = flow.rand(2, 3).requires_grad_() b = flow.rand(2, 3).requires_grad_() c...
## Code to reproduce bug ```python import oneflow as flow a = flow.ones(2, 3).requires_grad_() b = flow.ones(2, 3).requires_grad_() c = a + b c.sum().backward() print(id(a.grad)) print(id(a.grad)) print(id(a.grad)) print(id(a.grad)) print(id(a.grad)) print(id(a.grad))...
close #8248 重新审视之前的文档,有 #9402 的铺垫后(把 autograd.grad 接口和 retain_grad 功能解藕),目前只要能保证 current_grad 不做 inplace_add 且 current_grad -> acc_grad 拷贝时不共享指针,则 Tensor.grad 就可以在后续更新时使用 inplace 更新。 同时也方便 ddp 中对多个梯度做统一的打包传输,在 eager 的 optimizer 集体更新时也有一定的优化空间(如果能控制好 grad 显存的连续申请,则可以同时做更新。补充:这个想法已经有同事在推进了...
Hello arvention, thanks for your code. I have trained the network successfully. But I have a problem in testing part. The network detects image is too slow. It spends greater...