Skip to content

[CPU][ARM] Constrain MHA single-token dot_product templates#34616

Open
alvoron wants to merge 5 commits intoopenvinotoolkit:masterfrom
alvoron:alvoron_arm_dot_product
Open

[CPU][ARM] Constrain MHA single-token dot_product templates#34616
alvoron wants to merge 5 commits intoopenvinotoolkit:masterfrom
alvoron:alvoron_arm_dot_product

Conversation

@alvoron
Copy link
Contributor

@alvoron alvoron commented Mar 10, 2026

Details:

  • Updated ARM64 dot_product(TA*, TB*, ...) to only participate for float/float16 template types via SFINAE
  • Updated ARM64 dot_product(TA*, uint8_t*, ...) to only participate for TA in {float, float16} via SFINAE
  • Kept SVE path only for float x float and used the NEON path as fallback for other supported ARM64 combinations
  • Wrapped bf16 query dispatch in mha_single_token with !defined(OPENVINO_ARCH_ARM64) to avoid ARM64 bf16 instantiation paths

Tickets:

@alvoron alvoron requested review from a team as code owners March 10, 2026 19:37
@alvoron alvoron requested a review from maxnick March 10, 2026 19:37
@github-actions github-actions bot added the category: CPU OpenVINO CPU plugin label Mar 10, 2026
@alvoron alvoron added platform: arm OpenVINO on ARM / ARM64 and removed category: CPU OpenVINO CPU plugin labels Mar 10, 2026
@alvoron alvoron added this to the 2026.1 milestone Mar 10, 2026
@github-actions github-actions bot added the category: CPU OpenVINO CPU plugin label Mar 10, 2026
@maxnick
Copy link
Contributor

maxnick commented Mar 11, 2026

This function is extracted into common part in #34447.
Better to apply these changes once the PR above is merged.

Comment on lines +671 to +679
#if defined(OPENVINO_ARCH_ARM64)
template <typename TA,
typename TB,
typename std::enable_if<(std::is_same_v<TA, float> || std::is_same_v<TA, ov::float16>) &&
(std::is_same_v<TB, float> || std::is_same_v<TB, ov::float16>),
bool>::type = true>
#else
template <typename TA, typename TB>
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Such a construct looks cumbersome and difficult to read.
Better use static_accert under corresponding macro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines +1329 to +1334
#if defined(OPENVINO_ARCH_ARM64)
template <typename TA,
typename std::enable_if<std::is_same_v<TA, float> || std::is_same_v<TA, ov::float16>, bool>::type = true>
#else
template <typename TA>
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Such a construct looks cumbersome and difficult to read.
Better use static_accert under corresponding macro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: CPU OpenVINO CPU plugin platform: arm OpenVINO on ARM / ARM64

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants