maratyszcza / psimd Goto Github PK
View Code? Open in Web Editor NEWPortable 128-bit SIMD intrinsics
License: MIT License
Portable 128-bit SIMD intrinsics
License: MIT License
The title says it all. icc
fails with this message:
error: "__builtin_shuffle" is not supported
Any chance of getting an alternative implementation for icc
? This impacts the compilation of pytorch
with the intel compiler, making it essentially not possible.
Different vector units handle alignment in interesting ways. ARM/NEON supports fixing up unaligned accesses at runtime, or trapping on them depending on the instruction alignment specifier. PowerPC/Altivec however silently loads/stores...somewhere slightly different, which causes all manner of problems if an unaligned address makes it to the Altivec load/store unit.
Currently, GCC9 on PowerPC ignores the Altivec execution unit entirely when using PSIMD, this appears to be because aligned(N) has N set to at most 4 bytes, but the Altivec unit require 16 byte alignment before it can safely load/store vectors. Increasing N to 16 results in AltiVec instructions being used; however, much code using PSIMD isn't written to align its memory. For example, NNPACK fails the convolution tests.
I think this is because the psimd_(load|store)_ family of instructions aren't alignment-aware and support load/store to native C types, which may not be aligned to the requirements of a vector unit.
I'm not sure what the right solution would be, perhaps some combination of:
Trying to compile NNPACK I get the following psimd error on ubuntu 17.10
/usr/bin/cc -DNNP_BACKEND_PSIMD=1 -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=1 -Iinclude -Isrc -Ideps/cpuinfo/include -Ideps/pthreadpool/include -Ideps/fxdiv/include -Ideps/psimd/include -Ideps/fp16/include -std=gnu99 -MD -MT CMakeFiles/nnpack.dir/src/psimd/softmax.c.o -MF CMakeFiles/nnpack.dir/src/psimd/softmax.c.o.d -o CMakeFiles/nnpack.dir/src/psimd/softmax.c.o -c src/psimd/softmax.c
In file included from src/psimd/softmax.c:10:0:
src/psimd/exp.h: In function 'psimd_exp_f32':
src/psimd/exp.h:45:1: error: unrecognizable insn:
}
^
(insn 169 168 170 2 (set (reg:V4SI 126 [ _89 ])
(gt:V4SI (reg:V4SI 227)
(mem/c:V4SI (plus:DI (reg/f:DI 82 virtual-stack-vars)
(const_int -64 [0xffffffffffffffc0])) [2 b+0 S16 A32]))) "deps/psimd/include/psimd.h":669 -1
(nil))
src/psimd/exp.h:45:1: internal compiler error: in extract_insn, at recog.c:2311
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
[19/51] Building C object CMakeFiles/nnpack.dir/src/psimd/blas/shdotxf.c.o
FAILED: CMakeFiles/nnpack.dir/src/psimd/blas/shdotxf.c.o
/usr/bin/cc -DNNP_BACKEND_PSIMD=1 -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=1 -Iinclude -Isrc -Ideps/cpuinfo/include -Ideps/pthreadpool/include -Ideps/fxdiv/include -Ideps/psimd/include -Ideps/fp16/include -std=gnu99 -MD -MT CMakeFiles/nnpack.dir/src/psimd/blas/shdotxf.c.o -MF CMakeFiles/nnpack.dir/src/psimd/blas/shdotxf.c.o.d -o CMakeFiles/nnpack.dir/src/psimd/blas/shdotxf.c.o -c src/psimd/blas/shdotxf.c
src/psimd/blas/shdotxf.c: In function 'nnp_shdotxf1__psimd':
src/psimd/blas/shdotxf.c:33:1: error: unrecognizable insn:
}
^
(insn 200 199 201 5 (set (reg:V4SI 116 [ _104 ])
(gt:V4SI (reg:V4SI 247)
(mem/c:V4SI (plus:DI (reg/f:DI 82 virtual-stack-vars)
(const_int -416 [0xfffffffffffffe60])) [2 b+0 S16 A32]))) "deps/psimd/include/psimd.h":669 -1
(nil))
src/psimd/blas/shdotxf.c:33:1: internal compiler error: in extract_insn, at recog.c:2311```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.