Skip to content

Conversation

@chen2016013
Copy link
Contributor

@chen2016013 chen2016013 commented Jan 16, 2024

PR types

Others

PR changes

Others

Description

Pcard-67164
在yaml中为op配置complex_promote and support_trans_dtype ,对齐动态图和旧IR逻辑,参考paddle/fluid/pybind/eager_math_op_patch.cc和phi::KernelKey GetKernelTypeForVar。其中以下op实际存在dtype transfer逻辑,相应在ops.yaml中配置
截屏2024-01-17 19 33 43

@paddle-bot
Copy link

paddle-bot bot commented Jan 16, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

complex_promote : [X, Y]

- op : add_grad (elementwise_add_grad), add_double_grad (elementwise_add_grad_grad), add_triple_grad (elementwise_add_triple_grad)
complex_promote : [x, y, out_grad]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原始静态图逻辑仅仅根据out_grad选kernel的dtype,这里修改后改变了原来的逻辑

phi::KernelKey GetExpectedKernelType(
      const framework::ExecutionContext &ctx) const override {
    auto input_data_type = OperatorWithKernel::IndicateVarDataType(
        ctx, framework::GradVarName("Out"));
    return phi::KernelKey(input_data_type, ctx.GetPlace());
  }

@chen2016013 chen2016013 changed the title [PIR] Configure complex_promote and support_trans_dtype for ops.yaml according to phi op/dygraph [PIR] Configure support_trans_dtype for ops.yaml according to phi op/dygraph Jan 17, 2024
@chen2016013 chen2016013 merged commit 95dcf29 into PaddlePaddle:develop Jan 18, 2024
@chen2016013 chen2016013 deleted the yaml_data_transform branch January 23, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants