-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[CINN] Add castOp before addOp by AddCastToElementwiseAddPass
#76359
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
[CINN] Add castOp before addOp by AddCastToElementwiseAddPass
#76359
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
AddCastToElementwiseAddPass
AddCastToElementwiseAddPassAddCastToElementwiseAddPass
paddle/cinn/hlir/dialect/operator/transforms/add_cast_to_elementwise_add_pass.cc
Outdated
Show resolved
Hide resolved
abbf572 to
7662bfe
Compare
paddle/cinn/hlir/dialect/operator/transforms/add_cast_to_elementwise_add_pass.cc
Outdated
Show resolved
Hide resolved
e86727f to
c57b4c1
Compare
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (89.58%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #76359 +/- ##
==========================================
Coverage ? 89.58%
==========================================
Files ? 2
Lines ? 48
Branches ? 0
==========================================
Hits ? 43
Misses ? 5
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
TODO: 后续本PR内容需要与此处的💩代码一起删除 Paddle/paddle/phi/common/type_promotion.h Lines 206 to 222 in c645437
|
PR Category
Execute Infrastructure
PR Types
Bug fixes
Description
运行 GPT OSS 20B 出现:
打出IR图:
是这里的
pd_op.add出现了问题,本PR添加AddCastToElementwiseAddPass在 add op 之前插入 cast op,保证类型一致--
这个 PR 给 add 的两个输入都添加了 cast ,如下:
Paddle/paddle/cinn/hlir/dialect/operator/transforms/add_cast_to_elementwise_add_pass.cc
Lines 78 to 93 in f956a3b
不过不必担心
CreateAddBroadcastToElementwisePass是ApplyGroupOpPass中的第一个Pass之后其中的不必要的 cast 将会被其他 pass 消除
Paddle/paddle/cinn/hlir/dialect/operator/transforms/add_cinn_pass.cc
Lines 195 to 201 in f956a3b
这个 Pass 处于 CINN 前端: