-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add extra build flag 'HOROVOD_BUILD_ARCH_FLAGS' #1751
Conversation
setup.py
Outdated
@@ -118,7 +118,8 @@ def get_supported_instruction_set_flags(flags_to_check): | |||
def get_cpp_flags(build_ext): | |||
last_err = None | |||
default_flags = ['-std=c++11', '-fPIC', '-O2', '-Wall', '-fassociative-math', '-ffast-math', '-ftree-vectorize', '-funsafe-math-optimizations'] | |||
avx_fma_flags = get_supported_instruction_set_flags(['-mf16c', '-mavx', '-mfma']) | |||
avx_env_vars = os.environ.get('HOROVOD_BUILD_ARCH_FLAGS') | |||
avx_fma_flags = get_supported_instruction_set_flags(['-mf16c', '-mavx', '-mfma']) if avx_env_vars is None else avx_env_vars.split() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but I wonder if we should rename these variables to something more generic, like avx_env_vars
-> build_arch_flags_env
and avx_fma_flags
-> build_arch_flags
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, looks great, I think making the variable names consistent with the environment variable is a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
Add env variable to specify architecture-specific compiler flags. For example, to be compatible with the older CPU architecture 'Sandy Bridge' and tune for 'Broadwell': HOROVOD_BUILD_ARCH_FLAGS="-march=sandybridge -mtune=broadwell" ... pip install horovod Signed-off-by: Nicolas V Castet <nvcastet@us.ibm.com>
Signed-off-by: Nicolas V Castet <nvcastet@us.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the quick fix.
Add env variable to specify architecture-specific compiler flags.
For example, to be compatible with the older CPU architecture 'Sandy Bridge' and tune for 'Broadwell':
HOROVOD_BUILD_ARCH_FLAGS="-march=sandybridge -mtune=broadwell" ... pip install horovod
Signed-off-by: Nicolas V Castet nvcastet@us.ibm.com