Skip to content
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

Fix program constructed by programdesc incomplete bug #27705

Merged

Conversation

chenwhql
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Describe

Fix program constructed by programdesc incomplete bug

only update var name is not enough, need use BlockDesc._rename_var update var info.

original:

the var linear_0.w_0.load_0 and linear_0.b_0.load_0

{ // block 0
    var linear_1.tmp_0 : fluid.VarType.LOD_TENSOR.shape(16, 10).astype(VarType.FP32)
    var linear_1.tmp_1 : fluid.VarType.LOD_TENSOR.shape(16, 10).astype(VarType.FP32)
    var linear_0.w_0.load_0 : fluid.VarType.LOD_TENSOR.shape().astype(VarType.BOOL)
    var translated_layer/scale_0.tmp_0 : fluid.VarType.LOD_TENSOR.shape(16, 10).astype(VarType.FP32)
    var linear_0.b_0.load_0 : fluid.VarType.LOD_TENSOR.shape().astype(VarType.BOOL)
    var generated_var_0 : fluid.VarType.LOD_TENSOR.shape(16, 784).astype(VarType.FP32)

    {Out=['linear_1.tmp_0']} = matmul(inputs={X=['generated_var_0'], Y=['linear_0.w_0.load_0']}, Scale_out = 1.0, Scale_x = 1.0, Scale_y = 1.0, alpha = 1.0, force_fp32_output = False, fused_reshape_Out = [], fused_reshape_X = [], fused_reshape_Y = [], fused_transpose_Out = [], fused_transpose_X = [], fused_transpose_Y = [], mkldnn_data_type = float32, op_device = , op_namescope = /, op_role = 0, op_role_var = [], transpose_X = False, transpose_Y = False, use_mkldnn = False, use_quantizer = False)
    {Out=['linear_1.tmp_1']} = elementwise_add(inputs={X=['linear_1.tmp_0'], Y=['linear_0.b_0.load_0']}, Scale_out = 1.0, Scale_x = 1.0, Scale_y = 1.0, axis = 1, mkldnn_data_type = float32, op_device = , op_namescope = /, op_role = 0, op_role_var = [], use_mkldnn = False, use_quantizer = False, x_data_format = , y_data_format = )
    {Out=['translated_layer/scale_0.tmp_0']} = scale(inputs={ScaleTensor=[], X=['linear_1.tmp_1']}, bias = 0.0, bias_after_scale = True, op_device = , op_namescope = /, op_role = 0, op_role_var = [], scale = 1.0)
}
  • fixed:
{ // block 0
    persist var linear_0.b_0.load_0 : fluid.VarType.LOD_TENSOR.shape(10,).astype(VarType.FP32)
    var linear_1.tmp_0 : fluid.VarType.LOD_TENSOR.shape(16, 10).astype(VarType.FP32)
    var linear_1.tmp_1 : fluid.VarType.LOD_TENSOR.shape(16, 10).astype(VarType.FP32)
    persist var linear_0.w_0.load_0 : fluid.VarType.LOD_TENSOR.shape(784, 10).astype(VarType.FP32)
    var translated_layer/scale_0.tmp_0 : fluid.VarType.LOD_TENSOR.shape(16, 10).astype(VarType.FP32)
    var generated_var_0 : fluid.VarType.LOD_TENSOR.shape(16, 784).astype(VarType.FP32)

    {Out=['linear_1.tmp_0']} = matmul(inputs={X=['generated_var_0'], Y=['linear_0.w_0.load_0']}, Scale_out = 1.0, Scale_x = 1.0, Scale_y = 1.0, alpha = 1.0, force_fp32_output = False, fused_reshape_Out = [], fused_reshape_X = [], fused_reshape_Y = [], fused_transpose_Out = [], fused_transpose_X = [], fused_transpose_Y = [], mkldnn_data_type = float32, op_device = , op_namescope = /, op_role = 0, op_role_var = [], transpose_X = False, transpose_Y = False, use_mkldnn = False, use_quantizer = False)
    {Out=['linear_1.tmp_1']} = elementwise_add(inputs={X=['linear_1.tmp_0'], Y=['linear_0.b_0.load_0']}, Scale_out = 1.0, Scale_x = 1.0, Scale_y = 1.0, axis = 1, mkldnn_data_type = float32, op_device = , op_namescope = /, op_role = 0, op_role_var = [], use_mkldnn = False, use_quantizer = False, x_data_format = , y_data_format = )
    {Out=['translated_layer/scale_0.tmp_0']} = scale(inputs={ScaleTensor=[], X=['linear_1.tmp_1']}, bias = 0.0, bias_after_scale = True, op_device = , op_namescope = /, op_role = 0, op_role_var = [], scale = 1.0)
}

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@Channingss Channingss left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@liym27 liym27 left a comment

Choose a reason for hiding this comment

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

LGTM

@chenwhql chenwhql merged commit 5380320 into PaddlePaddle:develop Sep 29, 2020
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.

3 participants