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] sns f16_mha_on_avx512_core_amx_f16_target #27514

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chenhu-wang
Copy link
Contributor

@chenhu-wang chenhu-wang commented Nov 12, 2024

Details:

  • support f16 precision mha on GNR

Tickets:

@chenhu-wang chenhu-wang requested review from a team as code owners November 12, 2024 07:56
@github-actions github-actions bot added the category: CPU OpenVINO CPU plugin label Nov 12, 2024
@chenhu-wang
Copy link
Contributor Author

@a-sidorova @v-Golubev @IvanNovoselov , Could you please review? Thanks!

@a-sidorova a-sidorova self-assigned this Nov 13, 2024
Comment on lines 125 to +130
if (dnnl::impl::cpu::x64::mayiuse(dnnl::impl::cpu::x64::avx512_core_bf16) && ov::is_type<snippets::op::Brgemm>(op)) {
return {{element::bf16, element::bf16}};
}
if (dnnl::impl::cpu::x64::mayiuse(dnnl::impl::cpu::x64::avx512_core_amx_fp16) && ov::is_type<snippets::op::Brgemm>(op)) {
return {{element::f16, element::f16}};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I just think that the function body should be so:

std::set<std::vector<ov::element::Type>> types;
if (ov::is_type<snippets::op::Brgemm>(op)) {
    if (dnnl::impl::cpu::x64::mayiuse(dnnl::impl::cpu::x64::avx512_core_amx_fp16))
         types.insert({element::f16, element::f16});
     if (dnnl::impl::cpu::x64::avx512_core_bf16)
         types.insert({element::bf16, element::bf16});
}
return types;

Also tell me please, if you have verified this pass and it works?

MHA,
::testing::Combine(::testing::ValuesIn(transposedShape_4D(false)),
::testing::ValuesIn(precision_f32(4)),
::testing::ValuesIn(mha_infer_precision_fp16_if_supported()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
::testing::ValuesIn(mha_infer_precision_fp16_if_supported()),
::testing::ValuesIn(ov::element::f16),

And just skip test in skip_test_config if there is no ISA amx_fp16 on the platform as it's implemented for bf16

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you tell me please if you launched these added tests on GNR or using SDE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: CPU OpenVINO CPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants