6 ms·
Yeppp: A High-Performance SIMD-Optimized Math Library for X86, ARM, and MIPS
- sonium 11y agoI would be interested in seeing some real-world figures for HPC applications (e.g. VASP). I think most people use Intel MKL these days. A 30% performance increase over MKL as in the first figure would be huge.
- kale 11y agoI looked over the types defined. I'm guessing it uses built-in types for scalar float/double, and integer? It looks like the only defined types are for complex floats and 128 bit integers. EDIT: I looked at the functions listed for multiplication. Although it has a 64-bit x 64-bit multiply, the result is not in the internal 128-bit format. Also there was a warning that 64bx64b multiply was not yet optimized. Still very cool though.
- Marat_Dukhan 11y agoYes, on most platforms types map to intX_t/uintX_t.
- yellowapple 11y agoA comparison with (and/or bindings for) Julia would be really interesting, seeing as it makes similar claims about high-level performant programming. I think Julia was doing some work on SIMD-exploiting compiler optimizations, but I don't know off the top of my head whether or not that ended up coming through.
- Marat_Dukhan 11y agoThere are bindings for Julia - https://github.com/JuliaLang/Yeppp.jl https://github.com/JuliaLang/Yeppp.jl
- Marat_Dukhan 11y agoAuthor here. AMA. Note to mods: it would be fair to add (2013) to the link, as the site wasn't updated since Yeppp 1.0.0 release
- ArchD 11y agoI'm using C++. How does Yepp compare to libeigen in terms of performance and functionality? Can it do things that libeigen cannot do?
- nkurz 11y agoHi Marat -- Looks like a great approach! Do you have thoughts on how this could be extended to work with Xeon Phi and graphics coprocessors? The particular grail I'm searching for would do what you have done, but also allow some operations to be offloaded. Also, I see you have some preliminary R bindings: https://bitbucket.org/MDukhan/yeppp/src/7830144789416f9fbed3998a4c711147533cb546/bindings/R/?at=default https://bitbucket.org/MDukhan/yeppp/src/7830144789416f9fbed3... Are these thought to be working?
- Marat_Dukhan 11y agoYeppp! supports Xeon Phi, and includes binaries for it, albeit without hand-tuned kernels. Support for GPUs is unlikely: Yeppp! is a single-threaded library by design, and GPUs programming models are intrinsically multi-threaded. The R bindings are working and do provide speedup, but they are in no way of release quality. The officially supported bindings (.Net, JVM, and FORTRAN) are auto-generated. Additionally, Julia team maintains Yeppp.jl - bindings for Julia (https://github.com/JuliaLang/Yeppp.jl https://github.com/JuliaLang/Yeppp.jl)
- swills 11y agoGlad to see a BSD license, some support for BSD licensed OSs would be nice. Am I missing it?
- Marat_Dukhan 11y agoThe only supported OS are Linux, Windows, OS X, Android, and Blue Gene/Q OS.
- ant6n 11y agoWhy aren't there types like int32x4, float64x2, in8x8 built into languages like C/C++, that just compile to SSE or NEON? Writing asm or using intrinsics seems like such a pain and non-portable.
- Marat_Dukhan 11y agoBecause there is more to performance optimization than just using SIMD types. Well-optimized assembly code tries to hide instruction latency and balance load on different execution units. Both instruction latency and sets of execution units depend on processor microarchitecture, thus you can't do it in a portable way.
- phkahler 11y ago>> Because there is more to performance optimization than just using SIMD types. But that doesn't explain the lack of language support for 3- and 4-element vectors (or even 2d). I think the GCC intrinsics are nice, they allow you to pass by value and are cross-platform with x86, ARM NEON, and AltiVec. So many people think SIMD is somehow about parallel computation, but to me the obvious use is small vector math with basic vector types and standard operators.
- theresistor 11y ago> So many people think SIMD is somehow about parallel computation, but to me the obvious use is small vector math with basic vector types and standard operators. The fact that you think that indicates that you have no experience with SIMD programming or instruction sets. Using SIMD for small vector math is at best a wash, and typically a poor idea for performance. You only get significant performance benefit out of SIMD instructions when you can use vectorize an entire inner loop (moving between scalar and vector ALUs is fairly expensive on some microarchitectures), and when data arrangement and movement is arranged to maximize throughput (think SoA instead of AoS). Using SIMD for short vector math is generally moving in the opposite direction of those goals, resulting neutral to negative performance delta compared to scalar code.
- kungfooman 11y agoWhat's the usage? Can't even see classes for Vector3, Quaternions etc.
- yoklov 11y agoThis library doesn't seem to be focused on matrix math for computer graphics. FWIW, you don't tend to see a significant gain from writing those individual types as SIMD. The gain is from operations over large arrays of numbers. E.g. each vector has only one component type in it (e.g. you have vectors of [x0, x1, x2, x3] and [y0, y1, y2, y3] instead of [x0, y0, z0, w0] etc). Here's a set of slides that elaborate further on what I mean and explain why: https://deplinenoise.files.wordpress.com/2015/03/gdc2015_afredriksson_simd.pdf https://deplinenoise.files.wordpress.com/2015/03/gdc2015_afr...
- ris 11y agoFar more interesting to me is the PeachPy library that underlies this, generating all the assembly in python: https://github.com/Maratyszcza/PeachPy https://github.com/Maratyszcza/PeachPy