Skip to content

Commit

Permalink
implement qs8 x8c8 pack using avxvnniint8
Browse files Browse the repository at this point in the history
  • Loading branch information
xujuntwt95329 committed Sep 26, 2024
1 parent 467338f commit 2c0a33a
Show file tree
Hide file tree
Showing 8 changed files with 848 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/gen/avxvnniint8_microkernels.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SET(PROD_AVXVNNIINT8_MICROKERNEL_SRCS
src/qs8-qc8w-igemm/gen/qs8-qc8w-igemm-1x8c8-minmax-fp32-avxvnniint8-prfm.c
src/qs8-qc8w-igemm/gen/qs8-qc8w-igemm-5x8c8-minmax-fp32-avxvnniint8-prfm.c)

SET(NON_PROD_AVXVNNIINT8_MICROKERNEL_SRCS)
SET(NON_PROD_AVXVNNIINT8_MICROKERNEL_SRCS
src/qs8-packw/gen/qs8-packw-x8c8-gemm-goi-avxvnniint8.c)

SET(ALL_AVXVNNIINT8_MICROKERNEL_SRCS ${PROD_AVXVNNIINT8_MICROKERNEL_SRCS} + ${NON_PROD_AVXVNNIINT8_MICROKERNEL_SRCS})
1 change: 1 addition & 0 deletions gen/avxvnniint8_microkernels.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PROD_AVXVNNIINT8_MICROKERNEL_SRCS = [
]

NON_PROD_AVXVNNIINT8_MICROKERNEL_SRCS = [
"src/qs8-packw/gen/qs8-packw-x8c8-gemm-goi-avxvnniint8.c",
]

ALL_AVXVNNIINT8_MICROKERNEL_SRCS = PROD_AVXVNNIINT8_MICROKERNEL_SRCS + NON_PROD_AVXVNNIINT8_MICROKERNEL_SRCS
2 changes: 2 additions & 0 deletions scripts/generate-x8-packw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ tools/xngen src/x8-packw/kr-scalar.c.in -D NR=16 -D KR=4 -D TYPE=int8_t -o src/q
tools/xngen src/x8-packw/kr-scalar.c.in -D NR=32 -D KR=4 -D TYPE=int8_t -o src/qs8-packw/gen/qs8-packw-x32c4-gemm-goi-scalar.c &
tools/xngen src/x8-packw/kr-scalar.c.in -D NR=64 -D KR=4 -D TYPE=int8_t -o src/qs8-packw/gen/qs8-packw-x64c4-gemm-goi-scalar.c &

tools/xngen src/x8-packw/kr-avxvnniint8.c.in -D NR=8 -D KR=8 -D TYPE=int8_t -o src/qs8-packw/gen/qs8-packw-x8c8-gemm-goi-avxvnniint8.c &

wait
1 change: 1 addition & 0 deletions src/configs/hardware-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ static void init_hardware_config(void) {
if (hardware_config.use_x86_avx256skx) hardware_config.arch_flags |= xnn_arch_x86_avx256skx;
if (hardware_config.use_x86_avx256vnni) hardware_config.arch_flags |= xnn_arch_x86_avx256vnni;
if (hardware_config.use_x86_avx256vnnigfni) hardware_config.arch_flags |= xnn_arch_x86_avx256vnnigfni;
if (hardware_config.use_x86_avxvnniint8) hardware_config.arch_flags |= xnn_arch_x86_avxvnniint8;
#endif
#if XNN_ARCH_RISCV
if (hardware_config.use_riscv_vector) hardware_config.arch_flags |= xnn_arch_riscv_vector;
Expand Down
Loading

0 comments on commit 2c0a33a

Please sign in to comment.