Skip to content

Commit 114c53e

Browse files
committed
aarch64: matmul: addition of JIT int8 kernel
1 parent 46a9c22 commit 114c53e

13 files changed

+2326
-7
lines changed

cmake/options.cmake

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#===============================================================================
22
# Copyright 2018-2025 Intel Corporation
3+
# Copyright 2025 FUJITSU LIMITED
34
#
45
# Licensed under the Apache License, Version 2.0 (the "License");
56
# you may not use this file except in compliance with the License.
@@ -34,6 +35,10 @@ option(DNNL_VERBOSE
3435
"allows oneDNN be verbose whenever ONEDNN_VERBOSE
3536
environment variable set to 1" ON) # enabled by default
3637

38+
option(DNNL_AARCH64_MATMUL_SRC_QUANT
39+
"allows oneDNN to use dynamic quantisation for source(A) matrix when
40+
environment variable set to 1" OFF) # disabled by default
41+
3742
option(DNNL_ENABLE_CONCURRENT_EXEC
3843
"disables sharing a common scratchpad between primitives.
3944
This option must be turned ON if there is a possibility of executing
@@ -424,4 +429,4 @@ option(DNNL_AARCH64_USE_ACL "Enables use of AArch64 optimised functions
424429
from Arm Compute Library.
425430
This is only supported on AArch64 builds and assumes there is a
426431
functioning Compute Library build available at the location specified by the
427-
environment variable ACL_ROOT_DIR." OFF)
432+
environment variable ACL_ROOT_DIR." OFF)

include/oneapi/dnnl/dnnl.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* Copyright 2016-2025 Intel Corporation
3-
* Copyright 2024 FUJITSU LIMITED
3+
* Copyright 2024-2025 FUJITSU LIMITED
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -1615,6 +1615,9 @@ struct memory : public handle<dnnl_memory_t> {
16151615
BA16a32b4a = dnnl_BA16a32b4a,
16161616
BA16a48b4a = dnnl_BA16a48b4a,
16171617
BA16a64b4a = dnnl_BA16a64b4a,
1618+
BA24b8a = dnnl_BA24b8a,
1619+
aCB24c8b = dnnl_aCB24c8b,
1620+
abDC24d8c = dnnl_abDC24d8c,
16181621
decbA16a = dnnl_decbA16a,
16191622
decbA8a = dnnl_decbA8a,
16201623
defcbA16a = dnnl_defcbA16a,

include/oneapi/dnnl/dnnl_types.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* Copyright 2016-2025 Intel Corporation
3-
* Copyright 2024 FUJITSU LIMITED
3+
* Copyright 2024-2025 FUJITSU LIMITED
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -715,6 +715,9 @@ typedef enum {
715715
dnnl_aBC16b32c,
716716
dnnl_AB16a16b,
717717
dnnl_AB16a32b,
718+
dnnl_BA24b8a,
719+
dnnl_aCB24c8b,
720+
dnnl_abDC24d8c,
718721
dnnl_ABcde16a16b2a,
719722
dnnl_aBCdef16b16c2b,
720723
dnnl_Acedb16a,

src/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#===============================================================================
22
# Copyright 2016-2025 Intel Corporation
3+
# Copyright 2025 FUJITSU LIMITED
34
#
45
# Licensed under the Apache License, Version 2.0 (the "License");
56
# you may not use this file except in compliance with the License.
@@ -80,6 +81,10 @@ if(DNNL_EXPERIMENTAL_SPARSE)
8081
message(STATUS "Experimental functionality for sparse domain is enabled")
8182
endif()
8283

84+
if(DNNL_AARCH64_MATMUL_SRC_QUANT)
85+
message(STATUS "Functionality for dynamic quantisation for source(A) matrix in matmuls")
86+
endif()
87+
8388
if(DNNL_EXPERIMENTAL_UKERNEL)
8489
if(DNNL_TARGET_ARCH STREQUAL "ARCH_GENERIC")
8590
message(FATAL_ERROR "ukernel API does not support generic architecture.")

src/common/c_types_map.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* Copyright 2016-2025 Intel Corporation
3-
* Copyright 2024 FUJITSU LIMITED
3+
* Copyright 2024-2025 FUJITSU LIMITED
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -372,6 +372,9 @@ const format_tag_t aCB16b16c = dnnl_aCB16b16c;
372372
const format_tag_t aCB16b32c = dnnl_aCB16b32c;
373373
const format_tag_t aCB16b48c = dnnl_aCB16b48c;
374374
const format_tag_t aCB16b64c = dnnl_aCB16b64c;
375+
const format_tag_t BA24b8a = dnnl_BA24b8a;
376+
const format_tag_t aCB24c8b = dnnl_aCB24c8b;
377+
const format_tag_t abDC24d8c = dnnl_abDC24d8c;
375378
const format_tag_t aCB16b16c2b = dnnl_aCB16b16c2b;
376379
const format_tag_t aCB16b32c2b = dnnl_aCB16b32c2b;
377380
const format_tag_t aCB16b48c2b = dnnl_aCB16b48c2b;

src/common/memory_desc_wrapper.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* Copyright 2016-2025 Intel Corporation
3-
* Copyright 2024 FUJITSU LIMITED
3+
* Copyright 2024-2025 FUJITSU LIMITED
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -202,6 +202,9 @@ status_t memory_desc_wrapper::compute_blocking(
202202
C(BA16a32b, {1, 0}, {16, 32}, {0, 1});
203203
C(BA16a48b, {1, 0}, {16, 48}, {0, 1});
204204
C(BA16a64b, {1, 0}, {16, 64}, {0, 1});
205+
C(BA24b8a, {1, 0}, {24, 8}, {1, 0});
206+
C(aCB24c8b, {0, 2, 1}, {24, 8}, {2, 1});
207+
C(abDC24d8c, {0, 1, 3, 2}, {24, 8}, {3, 2});
205208
C(BA16a16b2a, {1, 0}, {16, 16, 2}, {0, 1, 0});
206209
C(BA16a32b2a, {1, 0}, {16, 32, 2}, {0, 1, 0});
207210
C(BA16a48b2a, {1, 0}, {16, 48, 2}, {0, 1, 0});

src/common/primitive_attr_quant.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*******************************************************************************
22
* Copyright 2024-2025 Intel Corporation
3+
* Copyright 2025 FUJITSU LIMITED
34
*
45
* Licensed under the Apache License, Version 2.0 (the "License");
56
* you may not use this file except in compliance with the License.
@@ -277,6 +278,9 @@ struct zero_points_t : public c_compatible {
277278

278279
// arg-specific checks
279280
bool common(int arg) const { return get_mask(arg) == 0; }
281+
bool per_ocic(int arg, int ndims) const {
282+
return get_mask(arg) == 3 << (ndims - 2);
283+
}
280284
bool per_dim_1(int arg) const { return get_mask(arg) == 2; }
281285
bool has_default_values(int arg) const {
282286
return is_set(arg) == false && has_default_data_type(arg);

0 commit comments

Comments
 (0)