-
Notifications
You must be signed in to change notification settings - Fork 10
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
Paddlebox #26
Paddlebox #26
Conversation
if(flags.empty()) { | ||
offset += outputs[i]->dims()[0]; | ||
} else { | ||
if(is_expand_slot_small==true){ |
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.
后面的==true可以删掉
std::vector<int> slot_inner_offset(total_length); | ||
int out_count = 0; | ||
for(int i=0;i<slot_num;i++) { | ||
for(int j=0;j<slot_lengths[i];j++) { |
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.
这里的slot_length[i]是int64的值,用int j去迭代循环存在死循环风险
push_offset, total_length, slot_vector, slot_lens, slot_num, | ||
hidden_size, batch_size, total_dims, skip_offset, key2slot); | ||
void *d_slot_inner_offset = nullptr; | ||
xpu_malloc((void **)&d_slot_inner_offset, total_length * sizeof(int)); |
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封装的Alloc
std::vector<int> slot_inner_offset(total_length); | ||
int out_count = 0; | ||
for(int i=0;i<slot_num;i++) { | ||
for(int j=0;j<slot_lengths[i];j++) { |
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.
< * 这些双目运算符的两边空格,后面建议都修改以下
if(outputs[embedx_offset]->numel()==0) { | ||
outputs[embedx_offset]->set_layout(paddle::framework::DataLayout::UNDEFINED); | ||
} else { | ||
int offset = slot_dims0_offset[i]*dims1* sizeof(T); |
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.
这里的offset类型建议用size_t, 后面set_offset传进去的就是size_t类型。
相应的,slot_dims0_offset也建议改成size_t类型
48b7466
to
e85e2a4
Compare
e85e2a4
to
da37757
Compare
@@ -3,6 +3,7 @@ | |||
#include "xpu/kernel/xtdk.h" | |||
// #include "xpu/kernel/debug.h" | |||
#include "xpu/kernel/xtdk_math.h" | |||
#include "xpu/kernel/xtdk_io.h" |
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.
这个不用的话,注意注释下
@@ -2114,8 +2114,11 @@ void PadBoxSlotDataset::PreLoadIntoDisk(const std::string& path, | |||
} | |||
CHECK(slot_pool_ != nullptr) << "slotrecord pool nullptr"; | |||
read_ins_ref_ = thread_num_; | |||
if (disable_shuffle_) { | |||
read_ins_ref_ = 1; | |||
} |
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.
此处会有问题,参考PadBoxSlotDataset::PreLoadIntoMemory()中修改方式
@@ -30,6 +30,9 @@ limitations under the License. */ | |||
#include "xpu/kernel/xtdk_simd.h" | |||
|
|||
#ifdef TRACE_PROFILE | |||
#include "xpu/kernel/xtdk_io.h" |
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.
这个是否有打开的必要
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.
参考下代码中部分comment修改下
PR types
PR changes
Describe