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

Try using "native" boundschecking for Array #20485

Closed
wants to merge 3 commits into from
Closed

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Feb 7, 2017

Just a trial balloon. The LLVM looks pretty good, but it's semantically different as it uses & instead of && for each dimension. Let's try this. @nanosoldier runbenchmarks(ALL, vs = ":master")

Fixes #20469.

@nanosoldier
Copy link
Collaborator

Something went wrong when running your job:

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

Logs and partial data can be found here
cc @jrevels

@andreasnoack
Copy link
Member

andreasnoack commented Feb 7, 2017

@jrevels Do you know why the soldier is still giving the blas_set_num_threads error?

@jrevels
Copy link
Member

jrevels commented Feb 7, 2017

Ref here, I'm not deploying the changes/doing all the test runs until Nanosoldier supports a serialization compatibility layer to prevent JLD breakage with the current BenchmarkTools.

@ararslan ararslan added the collections Data structures holding multiple items, e.g. sets label Feb 7, 2017
@vchuravy
Copy link
Member

vchuravy commented Feb 8, 2017

Trial by fire it is ;) JuliaCI/Nanosoldier.jl#28 (comment) @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 @jrevels

## Indexing: getindex ##

# This is more complicated than it needs to be in order to get Win64 through bootstrap
getindex(A::Array, i1::Int) = arrayref(A, i1)
getindex(A::Array, i1::Int, i2::Int, I::Int...) = (@_inline_meta; arrayref(A, i1, i2, I...)) # TODO: REMOVE FOR #14770
function getindex(A::Array, i1::Int)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why is the 1-argument definition needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's historical. Win32 had trouble with this at some point. It can probably be simplified, but I'm not inclined to mess with it unless there's a good reason to change it.

@jrevels
Copy link
Member

jrevels commented Feb 8, 2017

ref my comment here:

Silly me, I forgot to push all the BaseBenchmarks updates to the nanosoldier branch (i.e. the branch that Nanosoldier pulls down before running the benchmarks).
I just did so, let's see if it works now:

@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 @jrevels

@jrevels
Copy link
Member

jrevels commented Feb 8, 2017

Argh, forgot to update FileIO on one of the nodes. Just did so. Third time's a charm?

@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 @jrevels

@mbauman
Copy link
Member Author

mbauman commented Feb 9, 2017

Thanks @jrevels! Let's try short-circuiting.

@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 @jrevels

@mbauman
Copy link
Member Author

mbauman commented Feb 9, 2017

Bummer. That's better, but still terrible. The first few benchmarks I looked at were slower because getindex now contains more Julia code… which can push an enclosing function over the inlining boundary. The generated LLVM of getindex itself, though, is nearly identical. And micro benchmarks of individual calls are performing identically.

@mbauman
Copy link
Member Author

mbauman commented Feb 9, 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 @jrevels

@vtjnash
Copy link
Member

vtjnash commented Feb 20, 2017

This seems like a good plan: it should make switching to a Julia-based implementation of multi-dimensional arrays easier. I might request keeping the code around for doing codegen-based bounds checking, as it can come in useful when debugging inference / codegen errors. But it's OK if that's a slower, coarser memory range validation.

@mbauman
Copy link
Member Author

mbauman commented Feb 20, 2017

Any advice or help on the remaining regressions here? I've gotten this as close as I can for now.

@mbauman
Copy link
Member Author

mbauman commented Aug 28, 2017

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

@mbauman
Copy link
Member Author

mbauman commented Aug 30, 2017

Hm, Nanosoldier seems to have missed the prod. @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

@vtjnash
Copy link
Member

vtjnash commented Aug 30, 2017

I expect (most of?) those regressions should be fixed now that #22826 is merged.

@ararslan
Copy link
Member

ararslan commented Aug 30, 2017

Only one way to find out. :) @nanosoldier runbenchmarks(ALL, vs=":master")

Edit: Except there are merge conflicts so this won't be informative. Sorry! Need conflicts resolved before Nanosoldier can use the merge commit.

@nanosoldier
Copy link
Collaborator

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

@StefanKarpinski
Copy link
Member

Regressions are real, but they're for the old version – this needs to have conflicts resolved or be merged and then have nanosoldier retriggered before we can find out if it's ok now.

@mbauman
Copy link
Member Author

mbauman commented Aug 31, 2017

This isn't nearly as important as it was before Jameson's #22826. That PR solved the real problem in the disparity between the Julia and C bounds check removal. See #20469 (comment) for an example; #23516 adds that as a test.

Moving more things from C to Julia is nice, and dogfooding boundscheck/checkbounds in Array is also good, but now that the bug is fixed it would be unobservable. So this PR will go to the bottom of my list now.

@vtjnash vtjnash closed this Apr 8, 2021
@vtjnash vtjnash deleted the mb/native-bounds branch April 8, 2021 21:05
@vtjnash
Copy link
Member

vtjnash commented Apr 8, 2021

Closing, since we fixed the problem this was attempting to address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collections Data structures holding multiple items, e.g. sets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Policy regarding @inbounds annotations
9 participants