-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[CPU] Set score_len = 1 if no score_aggregation_window #30682
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
[CPU] Set score_len = 1 if no score_aggregation_window #30682
Conversation
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, thanks.
@@ -2410,7 +2410,7 @@ struct MHAHelper { | |||
int32_t total_kv_len_aligned = 0; | |||
int32_t total_kv_len = 0; | |||
for (int32_t i = 0; i < seq_cout; i++) { | |||
auto score_win_len = score_aggregation_window.ptr<int32_t>()[i]; | |||
auto score_win_len = score_aggregation_window ? score_aggregation_window.ptr<int32_t>()[i] : 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.
According to the spec, when score_aggregation_window
is unspecified, the value should be 1.
@@ -2538,7 +2538,7 @@ struct MHAHelper { | |||
score_block_ptr, | |||
reinterpret_cast<DATA_TYPE*>(score), | |||
1, | |||
rnd_up(cur_kv_len, _block_size), | |||
cur_kv_len, |
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.
NOTE for the change: The score_output
is aligned to 64 bytes(aka 16 floats), rnd_up(cur_kv_len, _block_size)
will align to 32 floats then 2 threads may write to same address and make random wrong result. cvt_add
already handles tails so the padding may be removed.
7751623
Details:
Tickets: