-
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
Optimize the perf of top_k when k is too large #40941
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
Copy(dev_ctx, sorted_output, out->place(), false, out); | ||
return; | ||
} else { | ||
LOG(INFO) << "TopKOP: Some errors happened when use cub sorting, use " |
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.
这里使用LOG(INFO),但是后面报错信息有 errors,是不是使用LOG(ERROR)更适合?或者可以使用paddle的报错函数:phi::errors::XXX
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.
这个并不是说走到这个分支就要退出,而是可以选择后续的分支继续完成计算,所以用errors不太合适
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.
使用VLOG
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.
done,thx
int k_left = k; | ||
|
||
#pragma unroll | ||
for (int digit_pos = sizeof(T) * 8 - RADIX_BITS; digit_pos >= 0; |
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.
这里为什么是*8?
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.
1byte=8bit
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
PR types
Performance optimization
PR changes
OPs
Describe
Optimize the perf of top_k when k is too large