Skip to content

Commit

Permalink
【PIR】add batch_norm_grad_grad in pir (#59373)
Browse files Browse the repository at this point in the history
* add batch_norm_grad_grad in pir

* fix

* fix 2023-11-27
  • Loading branch information
yangguohao authored Nov 29, 2023
1 parent ede6b06 commit a4a66c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions paddle/fluid/ir_adaptor/translator/op_compat_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,17 @@ def insert_new_mutable_attributes(
"grad_y_grad": "DDY",
"grad_out_grad": "DDOut",
}
op_arg_name_mappings["batch_norm_grad_grad"] = {
"scale_grad": "DScale",
"x_grad": "DX",
"grad_out_grad": "DDY",
"out_mean": "OutMean",
"out_variance": "OutVariance",
"grad_x_grad": "DDX",
"grad_scale_grad": "DDScale",
"grad_bias_grad": "DDBias",
"grad_out": "DY",
}

op_name_normailzer_template = env.get_template("op_compat_info.cc.j2")
with open(output_source_file, 'wt') as f:
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
{auc : AUC, stat_pos_out : StatPosOut, stat_neg_out : StatNegOut}

- op : batch_norm
backward : batch_norm_grad
backward : batch_norm_grad, batch_norm_double_grad(batch_norm_grad_grad)
inputs:
x : X
mean : Mean
Expand Down

0 comments on commit a4a66c8

Please sign in to comment.