-
Notifications
You must be signed in to change notification settings - Fork 1.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
[X86/ARM] add gru mode for rnn #7026
Conversation
… host, fix precision_profile bug
@@ -0,0 +1,248 @@ | |||
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. | |||
// |
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.
有时间新提Pr,将日期修改下:2019->2021
cur_h_ptr[offset] = out_ptr[offset] + pre_h_ptr[offset] * mask_ptr_1[i]; | ||
} | ||
} | ||
if ("LSTM" == 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.
如果mode 不是LSTM,则不处理是吗?
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.
是的,gru不做处理,目前仅支持gru lstm
last_c_temp.Resize(init_h[layer_idx].dims()); | ||
last_c_temp.mutable_data<float>(); | ||
last_c_holder = &last_c_temp; | ||
} |
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.
是否还有其他mode 呢,不管是否有,请加上else LOG(FATAL)<< "提示暂不支持“
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.
run函数入口处已经做了检测,后面不用再检测了
&output_tensors[i], | ||
&vec[3 + offset * 4], | ||
&weight_hh_tmp); | ||
} |
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.
同上
} else if ("GRU" == mode) { | ||
gate_num = 3; | ||
} else { | ||
LOG(FATAL) << "X86 RNN ERROR: unsupport mode except gru and lstm," |
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.
这个是ARM 不支持
last_c_temp.Resize(init_h[layer_idx].dims()); | ||
last_c_temp.mutable_data<float>(); | ||
last_c_holder = &last_c_temp; | ||
} |
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.
加上else log(FATAL)
&output_tensors[i], | ||
&vec[3 + offset * 4], | ||
&weight_hh_tmp); | ||
} |
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.
同时,加上 else
@@ -0,0 +1,802 @@ | |||
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. |
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.
改为2021
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
[X86/ARM] add gru mode for rnn, fix elementwise left problem, move cast op to host