-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support static graph code-gen for yolo_loss #52946
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
kernel : | ||
func : yolo_loss | ||
data_type : x | ||
optional : gt_score |
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.
增加
intermediate : objectness_mask, gt_match_mask
修改ops.py
中的195行
loss, _, _ = _C_ops.yolo_loss(
修改为:
loss = _C_ops.yolo_loss(
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.
请问研发大哥这个是怎么发现的?我看log就看不出来
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.
这个是由于intermediate : objectness_mask, gt_match_mask
,这个配置对应xxxop.cc
中的intermediate
属性,表示这个output只会在grad中使用,不需要真正的输出。动态图的api配置了这个属性后,对应的output旧不会return了
解决一下冲突 |
请解一下冲突 |
好的,最近业务比较繁忙,我中午or下午解一下 |
@@ -2048,3 +2048,13 @@ | |||
kernel : | |||
func : where_grad | |||
no_need_buffer : x, y | |||
|
|||
- backward_op : yolo_loss_grad |
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.
legacy_backward.yaml
中的yolo_loss_grad
是不是没有删除,ci-py3
编译信息显示重定义了
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.
确实= = 估计解冲突的时候搞挂了
phi::KernelKey GetExpectedKernelType( | ||
const framework::ExecutionContext& ctx) const override { | ||
return phi::KernelKey(OperatorWithKernel::IndicateVarDataType(ctx, "X"), | ||
platform::CPUPlace()); |
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.
这个GetExpectedKernelType
目前看跟自动生成的有区别,需要手动生成,需要如下工作:
op_compat.yaml
中配置get_expected_kernel_type : yolo_loss : GetYoloLossExpectedKernelType
2.在get_expected_kernel_func.cc
增加对应的函数:
phi::KernelKey GetYoloLossExpectedKernelType(
const framework::ExecutionContext& ctx,
const framework::OperatorWithKernel* op_ptr) {
return phi::KernelKey(op_ptr->IndicateVarDataType(ctx, "X"),
platform::CPUPlace());
在get_expected_kernel_func.h
增加相应的声明
phi::KernelKey GetYoloLossExpectedKernelType(
const framework::ExecutionContext& ctx,
const framework::OperatorWithKernel* op_ptr);
可以参考frobenius_norm
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.
LGTM
@sanbuphy 需要解决下冲突 |
rerun一下相关CI,可能是随机挂 |
已经 rerun,请 @heavyrain-lzy 再看下 |
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
@sanbuphy 请解决下冲突 |
PR types
Others
PR changes
Others
Description
#51842