Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

signed 8-bit * signed 8-bit VNNI

lin__chiungliang
Beginner
2,057 Views

Hi,

I'm trying to use VNNI in my program.

I ran the sample code, which do MAC operation by _mm512_dpbusds_epi32,

I found that it's singed 8-bit and unsigned 8-bit operation

Does there any optimized instruction support

1. signed 8-bit and signed 8-bit MAC operation

2. unsigned 8-bit and unsigned 8-bit MAC operation

Lot of thanks

chiungliang

0 Kudos
1 Solution
McCalpinJohn
Honored Contributor III
2,057 Views

The best place to look for the detailed meaning of instructions is Volume 2 of the Intel Architectures Software Developer's Manual, available at https://software.intel.com/en-us/articles/intel-sdm.  Each of the instruction descriptions lists the corresponding intrinsic names from the Intel C++ compiler where applicable.

You can look also up the instructions that are used by each intrinsic at https://software.intel.com/sites/landingpage/IntrinsicsGuide/

Searching for "AVX512_VNNI" in Volume 2 of the SWDM shows 4 instructions (each with various vector widths):

  • VPDPBUSDS -- this is the instruction used by your intrinsic
  • VPDPBUSD -- the same as your intrinsic, but without saturation
  • VPDPWSSDS -- analogous to your intrinsic, but using signed words (16-bit) for both input arguments
  • VPDPWSSD -- same as above, but without saturation

I have not worked through the details for these instruction types, but you could use VPMOVSXBW to copy the signed byte input data (with sign extension) to a register of signed words (16-bit) and then use the VNNI VPDPWSSDS instruction to perform the signed arithmetic.

View solution in original post

0 Kudos
7 Replies
RahulV_intel
Moderator
2,055 Views

Hi chiungliang,

We are looking into your query. Meanwhile, could you share your icc/icpc compiler version and the OS that you are working on?

 

--Rahul

 

0 Kudos
lin__chiungliang
Beginner
2,055 Views

Hi,

compiler version: 

COLLECT_GCC=g++-9
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9-20190428-1ubuntu1~18.04.york0' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.0.1 20190428 (prerelease) [gcc-9-branch revision 270630] (Ubuntu 9-20190428-1ubuntu1~18.04.york0)

OS: ubuntu 18.04.3 LTS

 

BTW, why do you want to know compiler version and OS?

I'm running programs with  _mm512_dpbusds_epi32 well,

which is signed 8-bit and unsigned 8-bit VNNI MAC operation,

I think my compiler version and OS is not a problem.

 

Thanks,

chiungliang

0 Kudos
McCalpinJohn
Honored Contributor III
2,058 Views

The best place to look for the detailed meaning of instructions is Volume 2 of the Intel Architectures Software Developer's Manual, available at https://software.intel.com/en-us/articles/intel-sdm.  Each of the instruction descriptions lists the corresponding intrinsic names from the Intel C++ compiler where applicable.

You can look also up the instructions that are used by each intrinsic at https://software.intel.com/sites/landingpage/IntrinsicsGuide/

Searching for "AVX512_VNNI" in Volume 2 of the SWDM shows 4 instructions (each with various vector widths):

  • VPDPBUSDS -- this is the instruction used by your intrinsic
  • VPDPBUSD -- the same as your intrinsic, but without saturation
  • VPDPWSSDS -- analogous to your intrinsic, but using signed words (16-bit) for both input arguments
  • VPDPWSSD -- same as above, but without saturation

I have not worked through the details for these instruction types, but you could use VPMOVSXBW to copy the signed byte input data (with sign extension) to a register of signed words (16-bit) and then use the VNNI VPDPWSSDS instruction to perform the signed arithmetic.

0 Kudos
lin__chiungliang
Beginner
2,055 Views

Thanks for your help

chiungliang

0 Kudos
RahulV_intel
Moderator
2,055 Views

Hi chiungliang,

Please let us know if we can close this thread.

 

--Rahul

0 Kudos
lin__chiungliang
Beginner
2,055 Views

Yes

Thanks

0 Kudos
RahulV_intel
Moderator
2,055 Views

Hi,

Thanks for the confirmation. We are closing this thread. Feel free to reach out to us, if you have further queries.

 

--Rahul

0 Kudos
Reply