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

Broadcast benchmarks #30

Merged
merged 6 commits into from
Oct 11, 2016
Merged

Broadcast benchmarks #30

merged 6 commits into from
Oct 11, 2016

Conversation

stevengj
Copy link
Contributor

@stevengj stevengj commented Oct 6, 2016

This adds a new suite (broadcast) of benchmarks testing the new broadcast-fusion functionality, the upcoming dot-operator=broadcast change, and broadcast on sparse vectors, for JuliaLang/julia#16285.

@stevengj
Copy link
Contributor Author

stevengj commented Oct 6, 2016

@jrevels, it seems like there is a .jld file I'm supposed to update somehow when I add a new benchmark directory. This isn't documented in the README; what am I supposed to do?

@jrevels
Copy link
Member

jrevels commented Oct 6, 2016

It's not necessary for you to update the JLD file. The failure is due to JuliaCI/BenchmarkTools.jl#23. That PR shouldn't have affected BaseBenchmarks yet, since I haven't tagged it in a release, but the Travis script in this repo clones BenchmarkTools directly instead of using the latest stable release (a holdover from before BenchmarkTools was registered). I'll open a PR to fix the Travis script, and rerun the tests here.

@jrevels
Copy link
Member

jrevels commented Oct 6, 2016

The Travis fix is merged, if you'd like to rebase and rerun the tests here.

@stevengj
Copy link
Contributor Author

stevengj commented Oct 7, 2016

Okay, thanks.

R = Array(Float64, length(x),length(y))
r = similar(z)

g["fusion", "Float64", size(r), 1] = @benchmarkable perf_bcast!($r, $z)
Copy link
Member

@jrevels jrevels Oct 8, 2016

Choose a reason for hiding this comment

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

As it is, the fully qualified ID for this benchmark will be ["broadcast", "fusion", ("fusion", "Float64", size(R), 1)]. Can we remove the extra "fusion" (same goes for the other benchmarks where the group name is duplicated in the local key)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@stevengj
Copy link
Contributor Author

Tests are green; any other comments?

perf_op_bcast!(r, x) = @dotcompat r .= 3 .* x .- 4 .* x.^2 .+ x .* x .- x .^ 3
perf_op_bcast!(R, x, y) = @dotcompat R .= 3 .* x .- 4 .* y.^2 .+ x .* y .- x .^ 3

g["dotop", "Float64", size(r), 1] = @benchmarkable perf_op_bcast!($r, $z)
Copy link
Member

Choose a reason for hiding this comment

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

"dotop" is redundant here for the reasons previously mentioned.

BTW, apologies for the slow review. I've been hiking on vacation, but just got back, so things should move a bit more quickly now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It needs something to distinguish it from the other benchmarks in the fusion group.

Copy link
Member

Choose a reason for hiding this comment

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

Unless I'm mistaken, it's already in a different group (the "dotop" group as defined on line 50). The difference in the fully qualified IDs is thus the group name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, right, I missed that addgroup line

@jrevels jrevels merged commit 916b87d into master Oct 11, 2016
@stevengj stevengj deleted the broadcast branch October 11, 2016 19:35
stevengj added a commit that referenced this pull request Oct 18, 2016
Keno pushed a commit that referenced this pull request Feb 4, 2022
* feed quasiquote variables in as arguments

interpolating these into the AST gives the optimizer too much flexibility
for a benchmark, that can mean the compiler will be able to just constant-fold away the work

* handle case where core isn't and Expr

not sure what it means to benchmark a constant value, but need to handle this case anyways
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants