Skip to content
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

[GPU] Bugfix accumulate sum of FC dyn-quan #27657

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

byungilm
Copy link
Contributor

Details:

  • Updated dyn-quantize of fully_connected_gpu_bf_tiled kernel

Tickets:

@github-actions github-actions bot added the category: GPU OpenVINO GPU plugin label Nov 21, 2024
@byungilm byungilm marked this pull request as ready for review November 21, 2024 07:36
@byungilm byungilm requested review from a team as code owners November 21, 2024 07:36
@byungilm byungilm self-assigned this Nov 21, 2024
@@ -53,7 +53,7 @@ KERNEL(quantize_input)(
half4 buff = input_0[i] / (half4)quan_scale;
quantized_value[i] = CAT(CAT(convert_, MAKE_VECTOR_TYPE(DQ_TYPE, INPUT_LOAD_SIZE)), _rte)(buff);
#if COMPRESSED_WEIGHTS_INT8
quantized_sum += (buff[0] + buff[1] + buff[2] + buff[3]);
quantized_sum += ((half)quantized_value[i][0] + (half)quantized_value[i][1] + (half)quantized_value[i][2] + (half)quantized_value[i][3]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about using int for accumulation instead of half? It will reduce quantization error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied.

@isanghao isanghao modified the milestones: 2024.6, 2023.3 Nov 22, 2024
Signed-off-by: Min, Byungil <[email protected]>
@byungilm byungilm requested a review from isanghao November 22, 2024 05:27
Signed-off-by: Min, Byungil <[email protected]>
#endif
vstore4(quantized_value[i], 0, &quantized_input[input_offset + i * 4]);
}

// Pair of quantizing_scale and quantized activation_sum for each group
quan_var[offset * 2] = quan_scale;
#if COMPRESSED_WEIGHTS_INT8
quan_var[(offset * 2) + 1] = quantized_sum;
quan_var[(offset * 2) + 1] = CAT(convert_, INPUT0_TYPE)(quantized_sum);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use _rte

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied

@isanghao isanghao enabled auto-merge November 22, 2024 11:34
@byungilm byungilm requested review from isanghao November 22, 2024 11:48
@isanghao isanghao added this pull request to the merge queue Nov 26, 2024
Merged via the queue into openvinotoolkit:master with commit 611796c Nov 26, 2024
155 checks passed
byungilm added a commit to byungilm/openvino that referenced this pull request Nov 26, 2024
### Details:
 - Updated dyn-quantize of fully_connected_gpu_bf_tiled kernel


### Tickets:
 - CVS-151707

---------

Signed-off-by: Min, Byungil <[email protected]>
NishantPrabhuFujitsu pushed a commit to NishantPrabhuFujitsu/openvino that referenced this pull request Nov 26, 2024
### Details:
 - Updated dyn-quantize of fully_connected_gpu_bf_tiled kernel


### Tickets:
 - CVS-151707

---------

Signed-off-by: Min, Byungil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GPU OpenVINO GPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants