Skip to content

Commit 5d4527a

Browse files
authored
Merge branch 'breaking' into py/params-from-ldf
2 parents 8129340 + c4cec0b commit 5d4527a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

benchmarks/benchmarks.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ using StableRNGs: StableRNG
99

1010
rng = StableRNG(23)
1111

12-
head_filename = "benchmarks_result_head.json"
13-
base_filename = "benchmarks_result_base.json"
14-
1512
colnames = [
1613
"Model", "Dim", "AD Backend", "VarInfo", "Linked", "t(eval)/t(ref)", "t(grad)/t(eval)"
1714
]
@@ -176,6 +173,14 @@ function combine(head_filename::String, base_filename::String)
176173
for c in sorted_testcases
177174
head_eval, head_grad = get(head_testcases, c, (missing, missing))
178175
base_eval, base_grad = get(base_testcases, c, (missing, missing))
176+
# If the benchmark errored, it will return `missing` in the `run()` function above.
177+
# The issue with this is that JSON serialisation converts it to `null`, and then
178+
# when reading back from JSON, it becomes `nothing` instead of `missing`!
179+
head_eval = head_eval === nothing ? missing : head_eval
180+
head_grad = head_grad === nothing ? missing : head_grad
181+
base_eval = base_eval === nothing ? missing : base_eval
182+
base_grad = base_grad === nothing ? missing : base_grad
183+
# Finally that lets us do this division safely
179184
speedup_eval = base_eval / head_eval
180185
speedup_grad = base_grad / head_grad
181186
push!(

0 commit comments

Comments
 (0)