-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 patch to set -O2
for suitesparse build
#20165
Conversation
Where are you getting that from? I see a heck of a lot more instances of @nanosoldier |
deps/suitesparse.mk
Outdated
ifeq ($(USE_SYSTEM_BLAS), 0) | ||
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/openblas | ||
else ifeq ($(USE_SYSTEM_LAPACK), 0) | ||
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: | $(build_prefix)/manifest/lapack | ||
endif | ||
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied | ||
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/build-compiled: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/source-extracted $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-O2.patch-applied |
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.
run make check-whitespace
locally if you ever do ci skip
Your benchmark job has completed - no performance regressions were detected. A full report can be found here. cc @jrevels |
Ah some might be under linalg... @nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels |
As @nalimilan pointed out elsewhere, we really ought to be using |
@tkelman So it looks like we've got significant performance regressions with this changeset, huh. |
I'm not so sure those were related, but I'd also prefer this be targeted to the specific architectures where it's known to cause a problem. And, you know, report the gcc bug and see how long it takes them to fix it (they can be very quick on some bugs). In this case I'm not sure the benchmarks on nanosoldier include good test cases for suitesparse functionality. A cholfact or lufact of some large known sparse matrix (say from the formerly-UF collection) would be worth timing. |
Those regressions might be due to #19976 |
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.
need to fix the whitespace, and benchmark on something that exercises suitesparse thoroughly
-O3 definitely enables a whole range of tree vectorization passes in gcc that should be improving performance on code like suitesparse. Since we've been using O3 for so long, the burden should be on proving that changing to O2 doesn't hurt. |
238b9cc
to
8dcf9ca
Compare
On this branch (newly rebased on top of
On
@ViralBShah are there any other tests that it might be instructive to run to make sure that I should note that the only difference between these two builds is to switch branches and |
Here are the same results on the same machine but using With
With
I.....huh. Looks like GCC 6.3.0's |
test runtime isn't as useful as a perf benchmark run via BenchmarkTools, the tests are likely driven by julia JIT compile time rather than library function runtime |
I ran the # sparse_perf.jl
using BaseBenchmarks
using BenchmarkTools
benchmarks = BaseBenchmarks.load!("sparse")
warmup(benchmarks)
results = run(benchmarks; verbose = true)
BenchmarkTools.save("../master.jld", "results", results) With an identical one that output to # compare.jl
using BenchmarkTools, BaseBenchmarks, JLD
pr = load("pr.jld", "results")
master = load("master.jld", "results")
pairs = leaves(regressions(judge(minimum(pr), minimum(master)))) Which found no consistent regressions. The full results are available as a |
what does that benchmark run though? is it actually doing anything that exercises suitesparse, or only the pure-julia sparse code? this needs to be reported as a gcc bug. |
As I'm assuming I would have to boil this down into an MWE, I do not have the time or energy to report this as a GCC bug at the moment.
I downloaded # sparse_perf.jl
using BenchmarkTools
using MatrixMarket
#M1 = MatrixMarket.mmread("rosen2/rosen2.mtx")
M2 = MatrixMarket.mmread("bayer09/bayer09.mtx")
M3 = MatrixMarket.mmread("bcsstk23/bcsstk23.mtx")
#t1 = @benchmark factorize(M1)
t2 = @benchmark factorize(M2)
t3 = @benchmark factorize(M3)
println("Real unsymmetric (bayer09)")
display(t2)
println("\nReal symmetric (bcsstk23)")
display(t3)
println() Here's the
Here's the
It looks to me that we don't have too much difference here. |
We already have the Julia-side example here, right? #20123 (comment) Translating that into |
I'd like to get this merged for 0.6 so that building with the latest GCC doesn't cause problems. |
8dcf9ca
to
2c62f07
Compare
I still don't like doing this on platforms where it doesn't cause problems, or merging without an upstream bug report to gcc. |
Sorry @tkelman I am going ahead with this. |
Agree about the upstream bug report to gcc and we should perhaps also notify Tim Davis. |
And if we don't do these things before merging, they never happen. |
The passes enabled by |
Here's a |
@@ -37,12 +37,17 @@ $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied: $ | |||
cd $(dir $@) && patch -p0 < $(SRCDIR)/patches/SuiteSparse-winclang.patch | |||
echo 1 > $@ | |||
|
|||
$(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-O2.patch-applied: $(BUILDDIR)/SuiteSparse-$(SUITESPARSE_VER)/SuiteSparse-winclang.patch-applied |
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.
this is also wrong, these belong in srccache
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.
Should we move all the .patch-applied
files into srccache
then? I was just following what was already in the file.
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.
ah on second thought it depends whether the dependency is capable of being built out of tree. we could use comments in these makefiles that explain inconsistencies like this
This reverts commit 145eae8. This was actually a bug in the power kernels in OpenBLAS, not a GCC or SuiteSparse problem
This fixes the compiler regression noticed in GCC 6.3.0 in #20123 by disabling
-ftree-slp-vectorize
as a side-effect of moving from-O3
to-O2
. We prefer to compile with-O2
by default anyway, so let's do so.