-
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
Enhence shrink_rnn_memory_op. #7176
Conversation
|
||
// should consider multiple levels | ||
size_t height = dst_num_rows; | ||
auto lod_level = rank_table.level(); |
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.
rank_table.level() is not related to ShrinkMemory.
Also, lod_level must always be zero? Since you cannot shrink the fine level of LoD without shrink the coarse level of 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.
Thanks, follow comments.
framework::AppendLoD(&remain, lod_offset.first); | ||
for (size_t j = 0; j < remain.size(); ++j) { | ||
out_lod->emplace_back(remain[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.
This logic is too complex. Since we just shrink the first level of LoD, we can just drop the last N element of the 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.
Follow comments.
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.
Do shrink for the first level LoD.
|
||
// should consider multiple levels | ||
size_t height = dst_num_rows; | ||
auto lod_level = rank_table.level(); |
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.
Thanks, follow comments.
framework::AppendLoD(&remain, lod_offset.first); | ||
for (size_t j = 0; j < remain.size(); ++j) { | ||
out_lod->emplace_back(remain[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.
Follow comments.
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
Resolves #7173