Final Work Product —GSoC 2020

Himanshi
5 min readAug 18, 2020

--

— Himanshi Mathur

The GSoC period might be coming to an end, but the journey is not over yet. Here’s the summary so far…

Project Details

Abstract/Summary

SVML functions are math intrinsics in Intel which support vector variants of the corresponding scalar mathematical operations. Precisely, these are mathematical functions not natively supported by the CPU. They perform mathematical operations on each element of source vectors, which are taken as arguments and then return them as a vector.

For example, division, error function, trigonometric are some broad categories of these intrinsics.

Peripheral Features:

  • Portable implementations of 128-bit functions, including generating the test cases for each implementation.
  • Portable implementations of 256-bit functions, including generating the test cases for each implementation.
  • Portable implementations of 512-bit functions, including generating the test cases for each implementation.
  • Researching and working on finding optimizations for some functions using vector-based optimizations for non-libm functions and using SLEEF support for optimizations of builtin libm functions.
  • We are using benchmarking to compare the performance of different versions.
  • Also worked on adding initial support for files AVX-512VL and AVX-512DQ under the category of AVX-512 and implementing basic functions for these.

Code Links

Links to Pull Requests in SIMDe: SIMDe-himanshi18037

Links to Commits in SIMDe: Commits in SIMDe

Blogs:

Quick Glance

Macros for using libm functions in simde-math.h
Defining non-libm functions in simde-math.h
Libm and SLEEF implementation together in svml.h
Vectorising non-libm functions in svml.h
Initial support for avx512dq.h
Initial support for avx512vl.h
Adding broadcast functions for avx512vl/avx512dq
Makefile for Benchmarking for different versions
Benchmarking Results

My Experience

Working with SIMDe for about 6 months now has been a humbling experience. The community has been extremely helpful and I have enjoyed working with amazingly talented people.
I have learned so much, before and during GSoC, both about development and how to work in different projects, and I want to continue to do so in the days to come.
I will remain active as a contributor and would love to be able to share my knowledge as well as experience with others.

Challenges faced

I believe that constant determination and hard work could be challenging. GSoC is also actively teaching me lessons about time management and overcoming challenges of working remotely.

Once the coding period starts, being familiar with the codebase did not take me much time initially to implement some easier SVML intrinsics, but it becomes quite challenging at times, I remember spending around 2–3 days only on a particular function, but my mentors really helped me here, and this also lets me push my own boundaries and is in benefit of greater learning.

In addition to it, something that bugged me initially was the very varying difference of time-zone of I and my mentors, but now I am used to it, and to be honest, I feel right now it can not get any better.

There are also different responsibilities at home, and creating a focused, constructive space for me to focus on project work is an extremely important part of helping me accomplish my work. Learning to be consistent in my own work and setting my own deadlines is a large part of what I’m working on doing now. Learning the ability to follow and set personal goals for working on the project was a hard lesson to learn at first, but finding that balance quickly and swiftly is something that is helping me move forward

I am really excited about completing my set of work and for new challenges to be able to expand my skill set and hope to enjoy it the way I am doing right now:).

What’s left

It’s been one packed summer for me and I have worked on this project from scratch, one by one executing the ideas I had suggested in my proposal. But as I went along, I stumbled upon a few more additions that can be well implemented.

Some of the planning issues I have in my mind are:

  • A more comprehensive addition of fallbacks for 256-bit and 512-bit functions, for better clarity and more efficiency.
  • A shift from dynamic-dispatch functions in SLEEF to static dispatch, but for that, we are waiting as some code needs to be added to SLEEF library. https://github.com/shibatch/sleef/pull/318
  • Possible integration with NEON, AltiVec, WASM optimizations to increase the speed wherever possible.
  • Implementing other functions in AVX-512VL/AVX-512DQ to complete these libraries.
  • Building a stronger open-source community around our project, by creating more issues and welcoming contributors.

These were a few ideas I had during the project. I would like to take them forward, and would appreciate more ideas from the members of the community, or potentially, for the next Summer of Code to come!

--

--