Skip to content

[WIP/RFC] Start benchmarking #69

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using BenchmarkTools
using FixedPointNumbers
import JLD

suite = BenchmarkGroup()
suite["conversion"] = BenchmarkGroup()

for FT in (Q0f7, Q1f14, Q7f24, N0f8, N2f14, N0f32, N2f30, N0f64, N2f62)
x = FT(0.25)
# Float16 doesn't behave well
Copy link
Member

Choose a reason for hiding this comment

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

I think only on julia 0.5

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yeah... We (I) did change those semantics on v0.6

for T in (Float32, Float64, BigFloat)
y = convert(T, x)
suite["conversion"]["$FT-to-$T"] = @benchmarkable convert($T, $x)
suite["conversion"]["$T-to-$FT"] = @benchmarkable convert($FT, $y)
end
end

# Load the suite's cached parameters as part of including the file. This is much
# faster and more reliable than re-tuning `suite` every time the file is included
paramspath = Pkg.dir("FixedPointNumbers", "benchmark", "params.jld")
# tune!(suite); JLD.save(paramspath, "suite", params(suite));
loadparams!(suite, JLD.load(paramspath, "suite"), :evals, :samples);
Copy link

Choose a reason for hiding this comment

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

This should probably check to see if the parameters have been generated locally, and if not, generate them.

You don't want to check in params.jld - the whole point of the benchmark parameters tuning process is that BenchmarkTools is trying to estimate the most stable/efficient experimental configuration for your machine.

Copy link

Choose a reason for hiding this comment

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

Also, I do realize this comes from BenchmarkTools example, so I should probably update that to reflect what I'm actually saying here...




Binary file added benchmark/params.jld
Binary file not shown.