-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
Compile with -march=native #27122
Comments
comment:1
The topic has nothing to do with polyhedra, many parts of Sage could benefit from it. |
Changed keywords from Intrinsics, SIMD, Polyhedra, FindPoly to Intrinsics, SIMD |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:3
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually) |
comment:4
As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9). |
Branch: public/27122 |
New commits:
|
Commit: |
comment:7
I added a very naive approach of doing it. Wondering if this is remotely ok or going in the right direction. |
comment:8
looks OK - not sure whether converting version to I'm also not sure whether this will pass the argument to Cython, or it needs
in |
comment:9
I believe it works, but I'm not entirely sure. This seems to state that I have not set it with
|
This comment has been minimized.
This comment has been minimized.
comment:10
It works for me. All tests passed. No significant time difference.
|
This comment has been minimized.
This comment has been minimized.
comment:13
Works on
|
comment:14
Success on my notebook running a Python 3-based 9.0.beta2 on top of Debian testing :
HTH, |
comment:15
works on Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz (in 32-bit mode), Ubunty 14.04 LTS |
comment:16
I don't think we should be reinventing the thirty-year-old standard CFLAGS here. It looks like setup.py will already use CFLAGS if it's set. I'm not arguing against sane defaults, just saying that appending Instead, why don't we try to set a decent default for CFLAGS if the user does not already have it set? Typically this amounts to something like
in a makefile somewhere. For people who don't care, CFLAGS will get set to something nice, and setup.py will use that value. For the people who have set CFLAGS to something special, nothing goes wrong. |
Changed work issues from Merge latest branch of dependencies to none |
Changed reviewer from Matthias Koeppe to Matthias Koeppe, https://github.com/mkoeppe/sage/actions/runs/434965861 |
comment:135
Instead of |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:137
Replying to @mkoeppe:
Sure. |
comment:138
And I thought you had found a better solution for that |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:141
Looks good to me. If you have capacity on GH Actions, could you run it one more time? (Ideally with #31064 for the latest version of the cygwin workflow) |
Changed reviewer from Matthias Koeppe, https://github.com/mkoeppe/sage/actions/runs/434965861 to Matthias Koeppe, https://github.com/mkoeppe/sage/actions/runs/434965861, https://github.com/kliem/sage/pull/30/checks |
Changed reviewer from Matthias Koeppe, https://github.com/mkoeppe/sage/actions/runs/434965861, https://github.com/kliem/sage/pull/30/checks to Matthias Koeppe |
comment:144
Looking good. Thanks for your patience with this long review process. |
Changed branch from u/gh-kliem/march_native_on_30375 to |
comment:146
Replying to @mkoeppe:
Thank you. And thank you in particular for creating the github workflow for testing. |
Changed commit from |
We should compile Sage with the extra compile argument
-march=native
for extra performance, at least ifSAGE_FAT_BINARY
is not set.In
gcc/spkg_configure.ac
we check, whether the argument-march=native
is accepted.In
build/make/Makefile.in
we assemble the flags.We add
-march=native
to the compiler flags, if not building fat binaries and the compiler and the package accepts it.During the build of sage there are now the following flags that can be exported in
spkg_install.in
with one line, instead of checkingSAGE_DEBUG
etc. for each individual package, e.g. byexport CFLAGS=$CFLAGS
(redundant, use flags as above with-march=native
if possible)export CFLAGS=$CFLAGS_NON_NATIVE
(flags as above without-march=native
)export CFLAGS=$CFLAGS_O3
(O3
instead ofO2
, but only if not in debug mode, add-march=native
if possible)export CFLAGS=$CFLAGS_O3_NON_NATIVE
(O3
instead ofO2
, no-march=native
)export CFLAGS=$ORIGINAL_CFLAGS
(use$CFLAGS
as set beforeconfigure
)Likewise we do with
CXXFLAGS
,FCFLAGS
,F77FLAGS
.We try to respect the users choice and do not overwrite the flags if already set by the user, but only add compile flags if absolutely necessary for packages to work.
Inidividual packages can still be compiled with specified flags or in debug mode using
or
Depends on #30375
CC: @sophiasage @vbraun @embray @kiwifb
Component: build
Keywords: Intrinsics, SIMD
Author: Jonathan Kliem
Branch:
7bc1f28
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/27122
The text was updated successfully, but these errors were encountered: