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

RFC: Make inbounds macros expression-like more often #15558

Closed
wants to merge 1 commit into from

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Mar 18, 2016

With #11169 fixed, we can now make @inbounds return its value edit: in common cases.

@KristofferC
Copy link
Member

Seems like it could be worth to run the benchmarks? If Nanosoldier is feeling better now that is.

@eschnett
Copy link
Contributor

I would wait for #15548 to ensure that this behaviour doesn't go away.

@mbauman
Copy link
Member Author

mbauman commented Mar 19, 2016

ensure that this behaviour doesn't go away.

That's part of the plan. If this gets merged, I don't think there's any going back. :)

Sure, let's do benchmarks… touching these basic utilities can sometimes do surprising things. What are the categories these days? Is SIMD its own category?

@mbauman mbauman force-pushed the mb/inbounds-expression branch from d4470f8 to 4b0cf05 Compare May 20, 2016 04:34
@mbauman
Copy link
Member Author

mbauman commented May 20, 2016

@nanosoldier runbenchmarks("array")

@jrevels
Copy link
Member

jrevels commented May 20, 2016

The error on nanosoldier is

ERROR: LoadError: UndefVarError: A_ldiv_B not defined

@andreasnoack I believe the relevant benchmark is just testing the \ operator...did something change there recently? I searched all of Base on the merge commit the benchmarks ran on for a typo (i.e. A_ldiv_B instead of A_ldiv_B!) but didn't see anything.

@andreasnoack
Copy link
Member

I think the error is here. I'm surprised that we don't have coverage for those methods. I'll take a look.

@jrevels jrevels mentioned this pull request May 24, 2016
@timholy
Copy link
Member

timholy commented Jun 7, 2016

What needs to be done here?

@mbauman
Copy link
Member Author

mbauman commented Jun 7, 2016

Is nanosoldier feeling any better these days? @nanosoldier runbenchmarks("array")

Or we can just press merge. I don't foresee this causing trouble.

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - successfully executed benchmarks. A full report can be found here. cc @jrevels

@yuyichao
Copy link
Contributor

yuyichao commented Jun 7, 2016

Maybe you missed the vs part?

@mbauman
Copy link
Member Author

mbauman commented Jun 7, 2016

Doh. I saw it was optional but I figured the default was against master. Let's try that again: @nanosoldier runbenchmarks("array", vs = ":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@timholy
Copy link
Member

timholy commented Jun 12, 2016

Surprising number of performance regressions. Might be fixed by a simple rebase?

@mbauman mbauman changed the title Make inbounds macros expression-like RFH: Make inbounds macros expression-like Jun 12, 2016
@mbauman
Copy link
Member Author

mbauman commented Jun 12, 2016

Marking this as request-for-help. This change is very simple and would be very nice to merge, but I'm not well-equipped to debug this sort of regression.

@mbauman
Copy link
Member Author

mbauman commented Jun 12, 2016

Aha, I now see #16894 — I bet that's what's going on here.

@mbauman
Copy link
Member Author

mbauman commented Aug 7, 2016

@nanosoldier runbenchmarks("array", vs = ":master")?

@tkelman
Copy link
Contributor

tkelman commented Aug 7, 2016

I think nanosoldier is still being updated to work properly in a world where master is 0.6-dev. Too bad we lost track of this one, should've given it another go after #16897 was merged.

@jrevels
Copy link
Member

jrevels commented Aug 9, 2016

Alright, our dear Nanosoldier should be back on its feet:

@nanosoldier runbenchmarks("array", vs = ":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@vchuravy
Copy link
Member

Should we re-run nanosoldier one last time and merge this, if it comes back OK?

@nanosoldier runbenchmarks("array", vs = ":master")

@jrevels
Copy link
Member

jrevels commented Oct 10, 2016

Nanosoldier stopped working through it's job queue for some reason while I was away. Restarted the server:

@nanosoldier runbenchmarks("array", vs = ":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@mbauman
Copy link
Member Author

mbauman commented Oct 11, 2016

Hm, those regressions look real. I would bet that this is pushing the inlining heuristic over the edge in some cases.

@vchuravy
Copy link
Member

Interestingly the daily benchmark showed a bunch of improvements in the bitarray benchmark https://github.com/JuliaCI/BaseBenchmarkReports/blob/4c71955ce4d30d4938b34d5a74abfa64caf74a89/daily_2016_10_12/report.md

I am wondering if it was inline heuristics, then this might have helped.
@nanosoldier runbenchmarks("array", vs = ":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@mbauman
Copy link
Member Author

mbauman commented Aug 29, 2017

@nanosoldier runbenchmarks(ALL, vs = ":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@mbauman mbauman force-pushed the mb/inbounds-expression branch 2 times, most recently from 8f8028c to 0f2b7fd Compare September 15, 2017 17:57
@mbauman
Copy link
Member Author

mbauman commented Sep 15, 2017

Ok, well, I've identified a place where I'm still seeing an extra allocation with the expression-like behavior. See 0f2b7fd for the workaround. I'm having a hard time reducing it down.

@mbauman mbauman added the arrays [a, r, r, a, y, s] label Sep 15, 2017
@mbauman mbauman force-pushed the mb/inbounds-expression branch from 0f2b7fd to f4c1bd9 Compare November 22, 2017 19:19
@mbauman
Copy link
Member Author

mbauman commented Nov 22, 2017

Alright, let's see where we are again here. I may still need to do some work on the inlining cost calculation.

@nanosoldier runbenchmarks(ALL, vs = ":master")

@nanosoldier
Copy link
Collaborator

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

@ararslan
Copy link
Member

Looks like there was some internal server error. I restarted the server, so let's try again: @nanosoldier runbenchmarks(ALL, vs=":master")

@ararslan
Copy link
Member

Yeah okay something is wrong with Nanosoldier.

@mbauman mbauman force-pushed the mb/inbounds-expression branch from f4c1bd9 to 86e01d6 Compare November 24, 2017 20:08
@ararslan
Copy link
Member

I think Nanosoldier is feeling better now, so @nanosoldier runbenchmarks(ALL, vs=":master")

@nanosoldier
Copy link
Collaborator

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

@ararslan
Copy link
Member

Sorry, still a few more things to fix in Nanosoldier.

@ararslan
Copy link
Member

@nanosoldier runbenchmarks(ALL, vs=":master")

@nanosoldier
Copy link
Collaborator

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

@ararslan
Copy link
Member

Sorry for the noise here. Dates moving to the stdlib broke basically the entire Nanosoldier stack and there have still been a couple of things lurking. I think I've finally gotten them all, but we'll see.

@nanosoldier runbenchmarks(ALL, vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@blakejohnson
Copy link
Contributor

Looks like a few real memory regressions?

@mbauman
Copy link
Member Author

mbauman commented Nov 27, 2017

Yes, thanks for fixing up Nanosoldier for this, Alex!

It looks like we're still at the same place that stymied me last time — I worked around it before by changing

@inbounds idxs = to_indices(V.parent, reindex(V, V.indexes, I))

to:

idxs = @inbounds to_indices(V.parent, reindex(V, V.indexes, I))

It looks like the use of an intermediary variable here causes a tuple to be allocated.

@StefanKarpinski
Copy link
Member

Let's go ahead and merge this with the workaround now and then once #24113 is merged, verify that the workaround is no longer needed.

@StefanKarpinski
Copy link
Member

This seems to be good to go and passes CI. Shall we go ahead and merge this?

@JeffBezanson
Copy link
Member

Already merged as #25033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

Successfully merging this pull request may close these issues.