-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
【PIR OpTest Fix No.15】 fix test match matrix tensor op #60277
【PIR OpTest Fix No.15】 fix test match matrix tensor op #60277
Conversation
paddle/phi/infermeta/multiary.cc
Outdated
if (config.is_runtime) { | ||
const auto& x_lod = x.lod(); | ||
PADDLE_ENFORCE_EQ(x_lod.empty(), | ||
false, | ||
phi::errors::InvalidArgument( | ||
"The Input(X) should hold LoD information, but " | ||
"received Input(X).lod() is empty.")); | ||
const auto& x_lod_0 = x_lod[0]; | ||
PADDLE_ENFORCE_GE(x_lod_0.size(), | ||
2, | ||
phi::errors::InvalidArgument( | ||
"The dimensions of Input(X)'s LoD data should be " | ||
"equal to 2, but received %d.", | ||
x_lod_0.size())); | ||
PADDLE_ENFORCE_EQ(x_dims[0], | ||
static_cast<int64_t>(x_lod_0.back()), | ||
phi::errors::InvalidArgument( | ||
"The last element of Input(X)'s LoD data should be " | ||
"equal to the first dimension of Input(X). " | ||
"But received the last element of Input(X)'s LoD " | ||
"data is %d, the first dimension of Input(X) is %d.", | ||
x_lod_0.back(), | ||
x_dims[0])); | ||
|
||
const auto& y_lod = y.lod(); |
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.
如果lod信息仅在runtime时计算,是否可以将此处的计算逻辑放在kernel里?这样就不必将MetaTensor
中的lod接口暴露出来。
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.
这里主要是用lod信息推导tmp和out的ddim
信息,这些可以在kernel里再设置吗?
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.
这里是运行时的处理,infermeta里写和在kernel里写是等价的
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.
已修改
Sorry to inform you that 14ac734's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
paddle/phi/infermeta/multiary.cc
Outdated
|
||
int64_t out_dim_0 = -1; | ||
int64_t tmp_dim_0 = -1; | ||
if (!config.is_runtime) { |
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.
这里还有必要判断是否为runtime吗?
paddle/phi/infermeta/multiary.cc
Outdated
void MatchMatrixTensorInferMeta(const MetaTensor& x, | ||
const MetaTensor& y, | ||
const MetaTensor& w, | ||
int dim_t, | ||
MetaTensor* out, | ||
MetaTensor* tmp, | ||
MetaConfig config) { |
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/phi/infermeta/multiary.cc
Outdated
out->set_dims(common::make_ddim(out_dims_vec)); | ||
tmp->set_dims(common::make_ddim(tmp_dims_vec)); |
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.
设置dtype
99b23cc
to
40303e7
Compare
PR types
Others
PR changes
Others
Description
PIR Op单测修复
修复单测
test match matrix tensor op
修复后打开
FLAGS_enable_pir_in_executor
单测是否通过:否报错信息: