-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
paddle support stride, fix dy2st #6539
paddle support stride, fix dy2st #6539
Conversation
Thanks for your contribution! |
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.
不能新增Fluid相关API,如果API很关键新增非Fluid目录下的API
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.
Add more comment and future TODO
@@ -1351,8 +1351,9 @@ def forward( | |||
|
|||
option_logits = paddle.matmul(q.unsqueeze(1), k, transpose_y=True).squeeze(1) | |||
option_logits = option_logits / self.predict_size**0.5 | |||
for index, logit in enumerate(option_logits): | |||
option_logits[index] -= (1 - (omask_positions[index] > 0).astype("float32")) * 1e12 | |||
with paddle.fluid.framework._stride_in_no_check_dy2st_diff(): |
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正常运行,如 paddle 2.4.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.
done, thx!
done, thx! |
done, thx! |
…nto support_stride_dy2st
|
||
if hasattr(paddle.framework, "_no_check_dy2st_diff"): |
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
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
…nto support_stride_dy2st
Codecov Report
@@ Coverage Diff @@
## develop #6539 +/- ##
===========================================
- Coverage 62.94% 62.93% -0.01%
===========================================
Files 531 531
Lines 77721 77725 +4
===========================================
- Hits 48918 48917 -1
- Misses 28803 28808 +5
|
PR types
Others
PR changes
Others
Description
Paddle支持stride后,需要检查动转静不一致的情况。但检查难度大,简单的检查会有误报,但这种方式获得评审会的同意。通过with可以避免误报。