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

[Kernel] Cache oneDNN primitive when M < XFT_PRIMITIVE_CACHE_M, default 256. #460

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

Duyi-Wang
Copy link
Contributor

No description provided.

bool cache_matmul_primitive(dnnl::matmul::primitive_desc *matmul_pd, dnnl::matmul *matmul_prim, bool transA, int M,
int N, int K, int matmul_kind, const void *packedB = nullptr) {
// If M < primitiveCacheM or a power of 2, then cache.
if (M <= primitiveCacheM || !(M & 1)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

To check if M is in power of 2: (M&(M−1))==0

@Duyi-Wang Duyi-Wang merged commit c81d7f2 into intel:main Jun 27, 2024
1 check passed
@Duyi-Wang Duyi-Wang deleted the prim_cache branch June 27, 2024 00:54
Duyi-Wang added a commit that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants