JuliaCI / JuliaCI/BenchmarkTools.jl

InexactError when running on 32-bit platform

Open
#166 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
684
Forks
107
PR merge metrics
No merged PRs in 30d

Description

I am reliably hitting an InexactError when using @benchmark on a 32-bit ARM platform (a Zynq7020 with a Cortex A9).

Here is an example of when it does and doesn't happen:

julia> using BenchmarkTools

julia> @benchmark sleep(1)
BenchmarkTools.Trial: 
  memory estimate:  64 bytes
  allocs estimate:  5
  --------------
  minimum time:     1.001 s (0.00% GC)
  median time:      1.002 s (0.00% GC)
  mean time:        1.002 s (0.00% GC)
  maximum time:     1.002 s (0.00% GC)
  --------------
  samples:          5
  evals/sample:     1

julia> @benchmark sleep(5)
ERROR: InexactError: trunc(Int32, 5.005859015e9)
Stacktrace:
 [1] trunc at ./float.jl:682 [inlined]
 [2] ceil(::Type{Int32}, ::Float64) at ./float.jl:365
 [3] tune!(::BenchmarkTools.Benchmark{Symbol("##benchmark#258")}, ::BenchmarkTools.Parameters; progressid::Nothing, nleaves::Float64, ndone::Float64, verbose::Bool, pad::String, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:209
 [4] tune! at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:208 [inlined] (repeats 2 times)
 [5] top-level scope at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:288

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/execution.jl around line 209, where the stack trace shows tune! failing, and reproduce the issue with @benchmark sleep(5) on a 32-bit ARM platform. Compare it with the working sleep(1) case; done means the longer benchmark completes without InexactError.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.