CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Auto Parallel] Add fused_gemm_epilogur spmd rule #73126
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
12cfb07
to
5b2546a
Compare
bias_shape, bias_tensor_dist_attr | ||
) | ||
|
||
def test_fused_gemm_epilogue_infer_forward_bias_replicated(self): |
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.
These three test sample results are similar and can be merged together
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.
Done
a5291c9
to
faed5bd
Compare
paddle/phi/api/generator/api_gen.py
Outdated
if self.api == "fused_gemm_epilogue" and i == 1: | ||
output_create = ( | ||
output_create | ||
+ f""" | ||
phi::DenseTensor* kernel_out_{i} = nullptr; | ||
if (activation != "none") {{ | ||
{code_indent} kernel_out_{i} = {set_out_func}({get_out_code}); | ||
}}""" | ||
) | ||
else: | ||
output_create = ( | ||
output_create | ||
+ f""" |
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.
这两地方都需要该判断,手工实现的话是指在api_custom_impl.cc里实现吗?
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.
Done
@@ -1211,11 +1223,14 @@ def generate_output_creation_code(self) -> str: | |||
idx=i | |||
) | |||
else: | |||
output_creation_code += ( | |||
MULTI_SINGLE_OUT_CREATION_TEMPLATE.format( | |||
if self.api == 'fused_gemm_epilogue' and i == 1: |
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.
同上
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.
Done
if in_dynamic_mode(): | ||
return _legacy_C_ops.fused_gemm_epilogue( | ||
x, y, bias, 'trans_x', transpose_x, 'trans_y', transpose_y | ||
out, _ = _C_ops.fused_gemm_epilogue( | ||
x, y, bias, transpose_x, transpose_y, "none" | ||
) | ||
return out | ||
if in_pir_mode(): | ||
out, _ = _C_ops.fused_gemm_epilogue( |
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.
Done
faed5bd
to
0cbd812
Compare
x, y, bias, 'trans_x', transpose_x, 'trans_y', transpose_y | ||
) | ||
if in_pir_mode(): | ||
if in_dynamic_mode() or in_pir_mode(): |
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.
这种情况大家一般用这个接口 paddle.framework.in_dynamic_or_pir_mode()
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.
Done
PR Category
Auto Parallel
PR Types
New features
Description