-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Replace matmul with matmul_v2 during oneDNN fuse passes #49108
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
LGTM
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.
LGTM!
if (matmul_alpha != 1.0f) { | ||
matmul_op->SetAttr("alpha", matmul_alpha); | ||
} |
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.
alpha
is not a attribute of matmul_v2
, I'm not sure whether this alpha
can work in kernel of matmul_v2
, please do a check ~
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.
Yes, it works because alpha
is added as extra OneDNN-specific attribute in ops_extra_info.h. I'm aware that it's not elegant solution, so in next PR I will introduce fused_matmul with all necessary attributes declared in OPMaker.
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.
LGTM
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.
LGTM for skip_check_grad_ci
@jczaja please merge |
…lePaddle#49108)" This reverts commit 2c444df.
PR types
Others
PR changes
OPs
Describe
During PHI migration
matmul_v2
kernel was migrated to PHI andmatmul
was left in common matmul_v2_mkldnn_op.cc file which could lead to many misunderstandings in a future. Also we have maintained support for both operators in each fuse pass, although they share same oneDNN kernel.After merging this PR it will be easier to introduce
fused_matmul
and remove extra attributes from base operator.Changes made in this PR:
matmul
withmatmul(v2)
during fuse passes,matmul
operator and kernel,