-
Notifications
You must be signed in to change notification settings - Fork 535
Introduced Packers/Matmul for QC2W weights and QP8 activations #10877
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,10 +101,10 @@ http_archive( | |
| # KleidiAI library, used for ARM microkernels. | ||
| http_archive( | ||
| name = "KleidiAI", | ||
| sha256 = "b147799b94c51f5e57492930bfd9e5294fb7ffe44fee1dbcd3f8048adeedd5e3", | ||
| strip_prefix = "kleidiai-b87ef9c94f45f11c81a6b1fdaed1b2b45ea58c0c", | ||
| sha256 = "97fa06184bb32a207470cb485742aa4c82e794a862016138f286ea138514d887", | ||
| strip_prefix = "kleidiai-13cd35993d8439143aff1e756a862d366acded0d", | ||
| urls = [ | ||
| "https://gitlab.arm.com/kleidi/kleidiai/-/archive/b87ef9c94f45f11c81a6b1fdaed1b2b45ea58c0c/kleidiai-b87ef9c94f45f11c81a6b1fdaed1b2b45ea58c0c.zip", | ||
| "https://github.com/ARM-software/kleidiai/archive/13cd35993d8439143aff1e756a862d366acded0d.zip", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the Gitlab url.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted to GitLab |
||
| ], | ||
| ) | ||
| # LINT.ThenChange(cmake/DownloadKleidiAI.cmake) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,8 @@ ENDIF() | |
| # LINT.IfChange | ||
| INCLUDE(ExternalProject) | ||
| ExternalProject_Add(kleidiai | ||
| URL https://gitlab.arm.com/kleidi/kleidiai/-/archive/b87ef9c94f45f11c81a6b1fdaed1b2b45ea58c0c/kleidiai-b87ef9c94f45f11c81a6b1fdaed1b2b45ea58c0c.zip | ||
| URL_HASH SHA256=b147799b94c51f5e57492930bfd9e5294fb7ffe44fee1dbcd3f8048adeedd5e3 | ||
| URL https://github.com/ARM-software/kleidiai/archive/13cd35993d8439143aff1e756a862d366acded0d.zip | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the Gitlab url.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted to GitLab |
||
| URL_HASH SHA256=97fa06184bb32a207470cb485742aa4c82e794a862016138f286ea138514d887 | ||
| SOURCE_DIR "${CMAKE_BINARY_DIR}/kleidiai-source" | ||
| BINARY_DIR "${CMAKE_BINARY_DIR}/kleidiai" | ||
| CONFIGURE_COMMAND "" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Copyright 2026 Google LLC | ||
| // | ||
| // This source code is licensed under the BSD-style license found in the | ||
| // LICENSE file in the root directory of this source tree. | ||
|
|
||
| #include <assert.h> | ||
| #include <stddef.h> | ||
|
|
||
| #include "src/xnnpack/microparams.h" | ||
|
|
||
| #if XNN_ENABLE_KLEIDIAI | ||
| #include "kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsu2cxp/kai_matmul_clamp_f32_qai8dxp1vlx4_qsu2cxp4vlx4_1vlx4vl_sme2_mopa.h" | ||
|
|
||
| static const int32_t xnn_qc2w_signed_lut[4] = {0, 1, -2, -1}; | ||
|
|
||
| size_t xnn_qp8_f32_qc2w_gemm_minmax_ukernel_16x64c4__neonsme2_get_mr(void) { | ||
| return kai_get_mr_matmul_clamp_f32_qai8dxp1vlx4_qsu2cxp4vlx4_1vlx4vl_sme2_mopa(); | ||
| } | ||
|
|
||
| size_t xnn_qp8_f32_qc2w_gemm_minmax_ukernel_16x64c4__neonsme2_get_nr(void) { | ||
| return kai_get_nr_matmul_clamp_f32_qai8dxp1vlx4_qsu2cxp4vlx4_1vlx4vl_sme2_mopa(); | ||
| } | ||
| #endif // XNN_ENABLE_KLEIDIAI | ||
|
|
||
| void xnn_qp8_f32_qc2w_gemm_minmax_ukernel_16x64c4__neonsme2( | ||
| size_t m, size_t n, size_t k, const void* lhs_packed, | ||
| const void* rhs_packed, float* dst, size_t dst_stride_row, | ||
| size_t dst_stride_col, struct xnn_f32_minmax_params* minmax_params) { | ||
| #if XNN_ENABLE_KLEIDIAI | ||
| kai_run_matmul_clamp_f32_qai8dxp1vlx4_qsu2cxp4vlx4_1vlx4vl_sme2_mopa( | ||
| m, n, k, lhs_packed, rhs_packed, dst, dst_stride_row, | ||
| /*dst_stride_col=*/sizeof(float), minmax_params->scalar.min, | ||
| minmax_params->scalar.max, xnn_qc2w_signed_lut); | ||
| #else | ||
| assert( | ||
| "Calling KleidiAI microkernel wrapper, but XNNPACK was compiled without " | ||
| "`XNN_ENABLE_KLEIDIAI`." && | ||
| 0); | ||
| #endif // XNN_ENABLE_KLEIDIAI | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the Gitlab url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted to GitLab