CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Infer Symbolic Shape No.220】Add infer_symbol_shape for rnn #68882
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提交成功,感谢你对开源项目的贡献! |
paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc
Outdated
Show resolved
Hide resolved
test/legacy_test/op_test.py
Outdated
self.op_test._infer_and_compare_symbol( | ||
place, no_check_set=no_check_set | ||
) |
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.
符号推导会要求对所有的op result 都做推导,一般要求对所有 result 都做检查,添加no_check_set 可能会导致存量单测中某些result 的检查失效,例如ClassCenterSampleOp
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.
这里加no_check_set的目的是啥
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.
因为这里会check dropout_state
的shape,但是 dropout_state
输出shape 推导不出来,导致这个单测失败
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.
因为这里会check
dropout_state
的shape,但是dropout_state
输出shape 推导不出来,导致这个单测失败
dropout_state 不同设备上的rank都是1,用新符号是没问题的,可以把符号推导的检查关掉;与PIR checker 的no_check_set 不适配问题等扩量任务结束之后我们再来处理
test/legacy_test/op_test.py
Outdated
self.op_test._infer_and_compare_symbol( | ||
place, no_check_set=no_check_set | ||
) |
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.
这里加no_check_set的目的是啥
int state_num = static_cast<int>(pre_state_shape_or_data_list.size()); | ||
symbol::TensorListShapeOrDataDimExprs state_shape_or_data_list; | ||
for (int i = 0; i < state_num; ++i) { | ||
state_shape_or_data_list.emplace_back( | ||
pre_state_shape_or_data_list[i].shape()); | ||
} |
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.
直接使用size_t i吧
Sorry to inform you that c204436's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
PR Category
CINN
PR Types
New features
Description
其中
dropout_state
输出 Tensor 的 shape 是设备相关的。在GPU上,将会通过
Paddle/paddle/phi/kernels/gpu/rnn_functor.h
Line 148 in 8f67128
cudnnDropoutGetStatesSize() 得到
而在CPU kernel 中,将是
Paddle/paddle/phi/kernels/cpu/rnn_functor.h
Line 142 in 8f67128
该PR同时也为 symbolcheck 添加了no_check_set 支持