Skip to content

Commit a5a75a5

Browse files
authored
[PIR AMP]Rename AMPState class (#61871)
1 parent bc5cd5c commit a5a75a5

20 files changed

Lines changed: 86 additions & 86 deletions

File tree

paddle/fluid/eager/api/manual/eager_manual/forwards/add_n_fwd_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ paddle::Tensor add_n_ad_func(const std::vector<paddle::Tensor>& x) {
4242

4343
{
4444
paddle::imperative::AutoCastGuard guard(
45-
egr::Controller::Instance().GetCurrentAMPState(),
45+
egr::Controller::Instance().GetCurrentAmpAttrs(),
4646
paddle::imperative::AmpLevel::O0);
4747
return add_n_ad_func(NEW_x);
4848
}

paddle/fluid/eager/api/manual/eager_manual/forwards/conv2d_fwd_function.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ paddle::Tensor conv2d_ad_func(const paddle::Tensor& input,
5353

5454
{
5555
paddle::imperative::AutoCastGuard guard(
56-
egr::Controller::Instance().GetCurrentAMPState(),
56+
egr::Controller::Instance().GetCurrentAmpAttrs(),
5757
paddle::imperative::AmpLevel::O0);
5858
return conv2d_ad_func(new_input,
5959
new_filter,

paddle/fluid/eager/api/manual/eager_manual/forwards/multiply_fwd_func.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ paddle::Tensor multiply_ad_func(const paddle::Tensor& x,
5252

5353
{
5454
paddle::imperative::AutoCastGuard guard(
55-
egr::Controller::Instance().GetCurrentAMPState(),
55+
egr::Controller::Instance().GetCurrentAmpAttrs(),
5656
paddle::imperative::AmpLevel::O0);
5757
return multiply_ad_func(new_x, new_y);
5858
}
@@ -399,7 +399,7 @@ paddle::Tensor multiply_ad_func(const paddle::Tensor& x,
399399

400400
{
401401
paddle::imperative::AutoCastGuard guard(
402-
egr::Controller::Instance().GetCurrentAMPState(),
402+
egr::Controller::Instance().GetCurrentAmpAttrs(),
403403
paddle::imperative::AmpLevel::O0);
404404
return multiply_ad_func(new_x, new_y);
405405
}

paddle/fluid/eager/api/manual/fluid_manual/forwards/fused_attention_fwd_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fused_attention_dygraph_function(
128128

129129
{
130130
paddle::imperative::AutoCastGuard guard(
131-
egr::Controller::Instance().GetCurrentAMPState(),
131+
egr::Controller::Instance().GetCurrentAmpAttrs(),
132132
paddle::imperative::AmpLevel::O0);
133133
return fused_attention_dygraph_function(NEW_X,
134134
NEW_LnScale,

paddle/fluid/eager/api/manual/fluid_manual/forwards/fused_bias_dropout_residual_layer_norm_fwd_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fused_bias_dropout_residual_layer_norm_dygraph_function(
8383

8484
{
8585
paddle::imperative::AutoCastGuard guard(
86-
egr::Controller::Instance().GetCurrentAMPState(),
86+
egr::Controller::Instance().GetCurrentAmpAttrs(),
8787
paddle::imperative::AmpLevel::O0);
8888
return fused_bias_dropout_residual_layer_norm_dygraph_function(
8989
NEW_X, NEW_Residual, NEW_Bias, NEW_LnScale, NEW_LnBias, attr_map);

paddle/fluid/eager/api/manual/fluid_manual/forwards/fused_feedforward_fwd_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fused_feedforward_dygraph_function(
122122

123123
{
124124
paddle::imperative::AutoCastGuard guard(
125-
egr::Controller::Instance().GetCurrentAMPState(),
125+
egr::Controller::Instance().GetCurrentAmpAttrs(),
126126
paddle::imperative::AmpLevel::O0);
127127
return fused_feedforward_dygraph_function(NEW_X,
128128
NEW_Dropout1Seed,

paddle/fluid/eager/api/manual/fluid_manual/forwards/fused_gate_attention_fwd_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fused_gate_attention_dygraph_function(
127127

128128
{
129129
paddle::imperative::AutoCastGuard guard(
130-
egr::Controller::Instance().GetCurrentAMPState(),
130+
egr::Controller::Instance().GetCurrentAmpAttrs(),
131131
paddle::imperative::AmpLevel::O0);
132132
return fused_gate_attention_dygraph_function(NEW_Query,
133133
NEW_Key,

paddle/fluid/eager/api/manual/fluid_manual/forwards/fused_gemm_epilogue_fwd_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ paddle::Tensor fused_gemm_epilogue_dygraph_function(
4949

5050
{
5151
paddle::imperative::AutoCastGuard guard(
52-
egr::Controller::Instance().GetCurrentAMPState(),
52+
egr::Controller::Instance().GetCurrentAmpAttrs(),
5353
paddle::imperative::AmpLevel::O0);
5454
return fused_gemm_epilogue_dygraph_function(
5555
NEW_X, NEW_Y, NEW_Bias, attr_map);

paddle/fluid/eager/api/utils/global_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class Controller {
9191
VLOG(6) << "Set current tracer for Controller: " << tracer_;
9292
}
9393

94-
const std::shared_ptr<paddle::imperative::AMPState>& GetCurrentAMPState() {
95-
return paddle::imperative::GetCurrentAMPState();
94+
const std::shared_ptr<paddle::imperative::AmpAttrs>& GetCurrentAmpAttrs() {
95+
return paddle::imperative::GetCurrentAmpAttrs();
9696
}
9797

9898
const std::unordered_map<std::string, std::vector<paddle::OpMetaInfo>>&

paddle/fluid/eager/auto_code_generator/eager_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ static std::pair<std::string, std::string> GenerateForwardFunctionContents(
17631763
const char* CALL_BACK_TEMPLATE =
17641764
" {\n"
17651765
" paddle::imperative::AutoCastGuard "
1766-
"guard(egr::Controller::Instance().GetCurrentAMPState(), "
1766+
"guard(egr::Controller::Instance().GetCurrentAmpAttrs(), "
17671767
"paddle::imperative::AmpLevel::O0);\n"
17681768
" return %s_dygraph_function(%s);\n"
17691769
" }";

0 commit comments

Comments
 (0)