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

seconds=Inf does not work #104

Closed
gdalle opened this issue Jun 4, 2024 · 5 comments · Fixed by #105
Closed

seconds=Inf does not work #104

gdalle opened this issue Jun 4, 2024 · 5 comments · Fixed by #105

Comments

@gdalle
Copy link

gdalle commented Jun 4, 2024

Is it possible to have unlimited seconds?

julia> using Chairmarks

julia> @be exp(rand(10, 10)) evals=1 samples=10 seconds=Inf
ERROR: InexactError: trunc(UInt64, Inf)
Stacktrace:
 [1] trunc
   @ ./float.jl:881 [inlined]
 [2] round(::Type{UInt64}, x::Float64)
   @ Base ./float.jl:385
 [3] benchmark(init::Any, setup::Any, f::Any, teardown::Any; evals::Union{…}, samples::Union{…}, seconds::Union{…}, gc::Bool, checksum::Bool, _map::Any, _reduction::Any)
   @ Chairmarks ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:102
 [4] benchmark
   @ ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:20 [inlined]
 [5] benchmark (repeats 2 times)
   @ ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:14 [inlined]
 [6] #benchmark#5
   @ ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:13 [inlined]
 [7] top-level scope
   @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.
@LilithHafner
Copy link
Owner

Sure! That seems like a reasonable thing to support (and arguably a bug to not support).

If you specify seconds=Inf and don't also specify both evals and samples then that should error telling you it would hang.

@gdalle
Copy link
Author

gdalle commented Jun 4, 2024

No actually I get the same rather obscure error:

julia> @be exp(rand(10, 10)) seconds=Inf
ERROR: InexactError: trunc(Int64, Inf)
Stacktrace:
 [1] trunc
   @ ./float.jl:905 [inlined]
 [2] floor(::Type{Int64}, x::Float64)
   @ Base ./float.jl:383
 [3] benchmark(init::Any, setup::Any, f::Any, teardown::Any; evals::Union{…}, samples::Union{…}, seconds::Union{…}, gc::Bool, checksum::Bool, _map::Any, _reduction::Any)
   @ Chairmarks ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:64
 [4] benchmark
   @ ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:20 [inlined]
 [5] benchmark (repeats 2 times)
   @ ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:14 [inlined]
 [6] #benchmark#5
   @ ~/.julia/packages/Chairmarks/7hE0Y/src/benchmarking.jl:13 [inlined]
 [7] top-level scope
   @ REPL[3]:1
Some type information was truncated. Use `show(err)` to see complete types.

@LilithHafner
Copy link
Owner

"should" means I should make it happen.

@gdalle
Copy link
Author

gdalle commented Jun 4, 2024

I have complete faith in you :)

@LilithHafner
Copy link
Owner

Related

  • A very high, non-Inf value also causes overflow
  • Overflow could occur if time_ns() reports a value close to typemax(UInt64), which it totally could according to its docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants