Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target AVX2 in releases? #227

Open
richardstartin opened this issue Jan 12, 2019 · 3 comments
Open

Target AVX2 in releases? #227

richardstartin opened this issue Jan 12, 2019 · 3 comments

Comments

@richardstartin
Copy link

I noticed this in the makefile

ifndef CXXFLAGS_BITSHUFFLE
  ifeq ($(OS_NAME)-$(OS_ARCH),Linux-x86_64)
	# SSE2 is supported in all the x86_64 platforms and AVX2 is only supported
        # in the small part of them. gcc in linux/x86_64 typically enables SSE2 by default though,
	# we explicitly set flags below to make this precondition clearer.
	CXXFLAGS_BITSHUFFLE:=-U__AVX2__ -msse2
  else
	# Undefined macros to generate a platform-independent binary
	CXXFLAGS_BITSHUFFLE:=-U__AVX2__ -U__SSE2__
  endif
endif

This was written in 2016 but AVX2 is quite mainstream now, is it worth revisiting this? Obviously a user can build their own, but not all users will have the required skills to do this in order to get more from their commodity class servers.

@xerial
Copy link
Owner

xerial commented Jan 16, 2019

@maropu What do you think?

@maropu
Copy link
Collaborator

maropu commented Jan 17, 2019

@richardstartin Thanks for your attention! Yea, as you said, I also think most processors have AVX2, e.g., we can use AVX2 on all the x64 AWS ec2 instances, right?

I found a list of processors with AVX2;
https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX2
It seems Intel processors based on Nehalem, Sandy Bridge, and Ivy Bridge don't have AVX2. I'm not 100% sure that no user uses these processors now? I remember we turn off AVX2 because the portability is the highest priority among the others, that is, run everywhere on x64 platforms! The decision depends on how we should respect minor users using these processors.

Anyway, I think we have some options for that;

  • Waits some more time to support AVX2, one or two more years? Not sure.
  • Turns on AVX2 by default and then document it explicitly
  • Bundles two binaries for x64 (with/without AVX2) and then load the correct binary by checking the support on runtime (cpuid)
  • Other ideas?

Also, it might be worth checking performance gain when turning on AVX2. If we have less gain, we might not need the support soon.

@re-thc
Copy link

re-thc commented Feb 11, 2019

Having multiple binaries and deciding at startup might be a good idea. If space is a concern, maven classifiers can always be used to filter out binaries included in the jar, so it's not an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants