-
Notifications
You must be signed in to change notification settings - Fork 682
[Code Simplification] Refactor Post-processing in VL Model Forward Method #2937
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
Conversation
|
Thanks for your contribution! |
xiaoxiaohehe001
left a comment
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
ming1753
left a comment
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
ming1753
left a comment
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
gongshaotian
left a comment
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分为三步:
114c5eb(#2937) 精简了forward 后 半部分的算子,通过布尔索引移除了if语句,解决了forward后面碎算子的问题,但是由于引入了bool索引(在全文本token,没有图片token的情况下),性能会下降10b36e6(#2937) 精简了forward 前 半部分不必要的算子e545864(#2937) 修复了第一个 commit 中性能下降的问题,将布尔索引移动到后面自定义算子extract_text_token_output_kernel中,原因是Paddle中的布尔索引,使用non_zero+gather_nd组合实现,non_zero存在一个 gpu -> cpu 的过程,这个过程比较耗时,同时,由于移除了布尔索引,性能会略有提升cc @zyfncg @SigureMo