-
Notifications
You must be signed in to change notification settings - Fork 294
【Hackathon 6th No.4】为 Paddle 新增 ormqr API #850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[ -79.54292 24.00183 -41.34253 ]] | ||
""" | ||
|
||
ormqr_ = _get_cache_prim(Ormqr)(left, transpose) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的Ormqr是一个class吗,能看到Mindspore在哪里定义的吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以的,我已经提上来了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体实现,也已经在写了,大概明天就可以了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lxd-cumt 您好,这里需要您再review一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| 提交时间 `<input type="checkbox" class="rowselector hidden">` | 2024-03-27 | | ||
| 版本号 | V2.0 | | ||
| 依赖飞桨版本 `<input type="checkbox" class="rowselector hidden">` | develop | | ||
| 文件名 | 20240326_api_design_for_ormqr.md `<br>` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已处理
|
||
- 实现方式不同 | ||
|
||
PyTorch 通过 c++ 实现;MindSpore 通过 python 实现。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已调整
|
||
# 五、设计思路与实现方案 | ||
|
||
paddle 目前的算子已经支持矩阵的转置,行列计算等操作,因此,可以使用 paddle 已有算子实现 `ormqr` ,由于要求输入 `input` 与 `othrt` 具有相同的 `ndim`,因此,不需要使用 `decrease_axes` 等参数。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
othrt
这个参数从哪里来的?上文中也没有decrease_axes
等参数从哪儿来的?上文中也没有
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应为other,已修改
decrease_axes应是调整维度的参数,但此处并不需要,因此已删除
|
||
## PyTorch | ||
|
||
PyTorch 中有 API `torch.ormqr(input, tau, other, left=True, transpose=False, *, out=None) → Tensoor` 以及对应的 `torch.Tensor.ormqr` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tensoor-》Tensor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
- input: (Tensor) shape(\*,mn,k),当 left 为 True 时, mn 的值等于 m,否则 mn 的值等于 n。 \*表示 Tensor 在轴 0 上的长度为 0 或者大于 0。 | ||
- tau: (Tensor) shape(\*,min(mn,k)),其中 \_ 表示 Tensor 在轴 0 上的长度为 0 或者大于 0,其类型与 input 相同。 | ||
- other: (Tensor) shape(\*,m,n),其中 \* 表示 Tensor 在轴 0 上的长度为 0 或者大于 0,其类型与 input 相同。 | ||
- left: (bool, 可选) 决定了矩阵乘积运算的顺序。如果 left 为 True ,计算顺序为 op(Q) x other ,否则,计算顺序为 other x op(Q)。默认值:True。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
op(Q) x other,中间的x是乘号还是字母x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是乘号
# 附件及参考资料 | ||
|
||
[【Hackathon 6th No.4】为 Paddle 新增 ormqr API](https://github.com/PaddlePaddle/community/pull/668) | ||
[PyTorch slice_scatter 文档](https://pytorch.org/docs/stable/generated/torch.slice_scatter.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
371和372行需要有段落符号
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已添加
# 六、测试和验收的考量 | ||
|
||
- GPU 测试场景 | ||
- 支持各种 Tensor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 只有GPU测试场景,没有CPU的么?
- 需要写清楚支持哪些数据类型
- 需要写清楚:计算正确性怎么验证,是和numpy对比,还是其他方案?
- 多维:能支持到几维?
- 静态图和动态图都需要支持
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已提交修改,并提交adaptivelogsoftmaxwithloss rfc
#854
- 支持 CPU、GPU 测试场景 | ||
- 支持动态图以及静态图 | ||
- 支持各种 Tensor,如:float32, float64, complex64, complex128 | ||
- 通过对比 mindspore 框架中的 ormqr 算子输出,计算结果是否一致 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
支持各种 Tensor,如:float32, float64, complex64, complex128
请 @lxd-cumt 再review下这块的数据类型,能支持复数么?以及是否要支持其他数据类型。
通过对比 mindspore 框架中的 ormqr 算子输出,计算结果是否一致
这个单侧里没法实现吧,飞桨单侧框架里也不会 import mindspore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我是本地需要的摘出来跑的。精度上paddlepaddle会比mindspore上高
No description provided.