Skip to content

Commit e70723f

Browse files
committed
fix benchmarks
1 parent 5dc5238 commit e70723f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

benchmarks/benchmarks.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ function combine(head_filename::String, base_filename::String)
176176
for c in sorted_testcases
177177
head_eval, head_grad = get(head_testcases, c, (missing, missing))
178178
base_eval, base_grad = get(base_testcases, c, (missing, missing))
179+
# If the benchmark errored, it will return `missing` in the `run()` function above.
180+
# The issue with this is that JSON serialisation converts it to `null`, and then
181+
# when reading back from JSON, it becomes `nothing` instead of `missing`!
182+
head_eval = head_eval === nothing ? missing : head_eval
183+
head_grad = head_grad === nothing ? missing : head_grad
184+
base_eval = base_eval === nothing ? missing : base_eval
185+
base_grad = base_grad === nothing ? missing : base_grad
186+
# Finally that lets us do this division safely
179187
speedup_eval = base_eval / head_eval
180188
speedup_grad = base_grad / head_grad
181189
push!(

0 commit comments

Comments
 (0)