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

[CPU] Fix avx2 bf16 reorder #25353

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

maxnick
Copy link
Contributor

@maxnick maxnick commented Jul 3, 2024

Details:

Fix forked oneDNN JIT reorder kernel for the case of bf16 precision and AVX2 ISA.

OneDNN fork PR: openvinotoolkit/oneDNN#253

Tickets:

@maxnick maxnick requested review from a team as code owners July 3, 2024 10:31
@github-actions github-actions bot added the category: CPU OpenVINO CPU plugin label Jul 3, 2024
@maxnick maxnick added the bug Something isn't working label Jul 3, 2024
@maxnick maxnick added this to the 2024.3 milestone Jul 3, 2024
@maxnick
Copy link
Contributor Author

maxnick commented Jul 3, 2024

@luweizhou2016 , could you please review?

@luweizhou2016
Copy link
Contributor

@maxnick , My understanding is that for avx2 plaform:
bf16->fp32 is still supported in jit_uni_reorder_kernel_f32_t;
fp32->bf16 is not supported in jit_uni_reorder_kernel_f32_t for the bf16_emu bug?

@maxnick
Copy link
Contributor Author

maxnick commented Jul 5, 2024

@maxnick , My understanding is that for avx2 plaform: bf16->fp32 is still supported in jit_uni_reorder_kernel_f32_t; fp32->bf16 is not supported in jit_uni_reorder_kernel_f32_t for the bf16_emu bug?

fp32->bf16 is not supported by avx2 as the bf16_emu works only with avx512, and the avx2 instruction set doesn't have dedicated fp32->bf16 conversion instructions. Also fp32->bf16 reorders are supported by the avx2 platforms with the convert NE extension, and of course for AVX512_BF16, as they have native fp32->bf16 conversion instructions.

@luweizhou2016
Copy link
Contributor

@maxnick , My understanding is that for avx2 plaform: bf16->fp32 is still supported in jit_uni_reorder_kernel_f32_t; fp32->bf16 is not supported in jit_uni_reorder_kernel_f32_t for the bf16_emu bug?

fp32->bf16 is not supported by avx2 as the bf16_emu works only with avx512, and the avx2 instruction set doesn't have dedicated fp32->bf16 conversion instructions. Also fp32->bf16 reorders are supported by the avx2 platforms with the convert NE extension, and of course for AVX512_BF16, as they have native fp32->bf16 conversion instructions.

Thx for clarifying. Approved.

@maxnick maxnick added this pull request to the merge queue Jul 5, 2024
Merged via the queue into openvinotoolkit:master with commit 70b4c50 Jul 5, 2024
116 checks passed
@maxnick maxnick deleted the fix_bf16_reorder_avx2 branch July 5, 2024 11:26
ieliz pushed a commit to ieliz/openvino that referenced this pull request Jul 5, 2024
### Details:
Fix forked oneDNN JIT reorder kernel for the case of bf16 precision and
AVX2 ISA.

OneDNN fork PR: openvinotoolkit/oneDNN#253

### Tickets:
 - CVS-145874
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working category: CPU OpenVINO CPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants